https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
18template <typename T>
19class GenericTwoVector : public Eigen::Matrix<T, 2, 1>
20{
21public:
22 GenericTwoVector() { this->setZero(); }
23 using Eigen::Matrix<T, 2, 1>::Matrix;
24};
25
28
29namespace MetaPhysicL
30{
31// raw_value AD->non-AD conversion for ADReal valued Eigen::Matrix objects
32template <>
33struct 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}
A two-component zero initialized vector used for tangential quantities.
Definition TwoVector.h:20
We need to instantiate the following CompareTypes to tell the compiler that ADReal is a subtype of Ch...
auto raw_value(const Eigen::Map< T > &in)
static value_type value(const ADTwoVector &in)
Definition TwoVector.h:37