https://mooseframework.inl.gov
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 
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 {
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 }
auto raw_value(const Eigen::Map< T > &in)
static value_type value(const ADTwoVector &in)
Definition: TwoVector.h:37
A two-component zero initialized vector used for tangential quantities.
Definition: TwoVector.h:19