https://mooseframework.inl.gov
contact
include
utils
TwoVector.h
Go to the documentation of this file.
1
//* This file is part of the MOOSE framework
2
//* https://mooseframework.inl.gov
3
//*
4
//* All rights reserved, see COPYRIGHT for full restrictions
5
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6
//*
7
//* Licensed under LGPL 2.1, please see LICENSE for details
8
//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10
#pragma once
11
12
#include "
EigenADReal.h
"
13
#include <Eigen/Dense>
14
18
template
<
typename
T>
19
class
GenericTwoVector
:
public
Eigen::Matrix<T, 2, 1>
20
{
21
public
:
22
GenericTwoVector
() { this->setZero(); }
23
using
Eigen::Matrix<T, 2, 1>::Matrix;
24
};
25
26
using
TwoVector
=
GenericTwoVector<Real>
;
27
using
ADTwoVector
=
GenericTwoVector<ADReal>
;
28
29
namespace
MetaPhysicL
30
{
31
// raw_value AD->non-AD conversion for ADReal valued Eigen::Matrix objects
32
template
<>
33
struct
RawType<
ADTwoVector
>
34
{
35
typedef
TwoVector
value_type
;
36
37
static
value_type
value
(
const
ADTwoVector
& in)
38
{
39
return
value_type::NullaryExpr([&in](Eigen::Index i) {
return
raw_value
(in(i)); });
40
}
41
};
42
}
MetaPhysicL::raw_value
auto raw_value(const Eigen::Map< T > &in)
MetaPhysicL
MetaPhysicL::RawType< ADTwoVector >::value_type
TwoVector value_type
Definition:
TwoVector.h:35
EigenADReal.h
MetaPhysicL::RawType< ADTwoVector >::value
static value_type value(const ADTwoVector &in)
Definition:
TwoVector.h:37
GenericTwoVector
A two-component zero initialized vector used for tangential quantities.
Definition:
TwoVector.h:19
GenericTwoVector::GenericTwoVector
GenericTwoVector()
Definition:
TwoVector.h:22
Generated on Fri Jul 18 2025 13:42:46 for https://mooseframework.inl.gov by
1.8.14