https://mooseframework.inl.gov
Loading...
Searching...
No Matches
RawValueFunctor.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 "MooseFunctor.h"
13
14namespace Moose
15{
16template <typename T>
18{
19public:
22 using typename Moose::FunctorBase<T>::DotType;
23
24 RawValueFunctor(const FunctorBase<typename ADType<T>::type> & ad_functor)
25 : FunctorBase<T>(ad_functor.functorName() + "_raw_value", {EXEC_ALWAYS}),
26 _ad_functor(ad_functor)
27 {
28 }
29
30 virtual bool isExtrapolatedBoundaryFace(const FaceInfo & fi,
31 const Elem * const elem,
32 const Moose::StateArg & state) const override
33 {
34 return _ad_functor.isExtrapolatedBoundaryFace(fi, elem, state);
35 }
36 virtual bool isConstant() const override { return _ad_functor.isConstant(); }
37 virtual bool hasBlocks(const SubdomainID id) const override { return _ad_functor.hasBlocks(id); }
38 virtual bool hasFaceSide(const FaceInfo & fi, const bool fi_elem_side) const override
39 {
40 return _ad_functor.hasFaceSide(fi, fi_elem_side);
41 }
42
43 bool supportsFaceArg() const override final { return _ad_functor.supportsFaceArg(); }
44 bool supportsElemSideQpArg() const override final { return _ad_functor.supportsElemSideQpArg(); }
45
46protected:
48
51 ValueType evaluate(const ElemArg & elem, const StateArg & state) const override
52 {
53 return MetaPhysicL::raw_value(_ad_functor(elem, state));
54 }
55 ValueType evaluate(const FaceArg & face, const StateArg & state) const override
56 {
57 return MetaPhysicL::raw_value(_ad_functor(face, state));
58 }
59 ValueType evaluate(const ElemQpArg & qp, const StateArg & state) const override
60 {
61 return MetaPhysicL::raw_value(_ad_functor(qp, state));
62 }
63 ValueType evaluate(const ElemSideQpArg & qp, const StateArg & state) const override
64 {
65 return MetaPhysicL::raw_value(_ad_functor(qp, state));
66 }
67 ValueType evaluate(const ElemPointArg & elem_point, const StateArg & state) const override
68 {
69 return MetaPhysicL::raw_value(_ad_functor(elem_point, state));
70 }
71 ValueType evaluate(const NodeArg & node, const StateArg & state) const override
72 {
73 return MetaPhysicL::raw_value(_ad_functor(node, state));
74 }
75 ValueType evaluate(const PointArg & point, const StateArg & state) const override
76 {
77 return MetaPhysicL::raw_value(_ad_functor(point, state));
78 }
79
80 GradientType evaluateGradient(const ElemArg & elem, const StateArg & state) const override
81 {
82 return MetaPhysicL::raw_value(_ad_functor.gradient(elem, state));
83 }
84 GradientType evaluateGradient(const FaceArg & face, const StateArg & state) const override
85 {
86 return MetaPhysicL::raw_value(_ad_functor.gradient(face, state));
87 }
88 GradientType evaluateGradient(const ElemQpArg & qp, const StateArg & state) const override
89 {
90 return MetaPhysicL::raw_value(_ad_functor.gradient(qp, state));
91 }
92 GradientType evaluateGradient(const ElemSideQpArg & qp, const StateArg & state) const override
93 {
94 return MetaPhysicL::raw_value(_ad_functor.gradient(qp, state));
95 }
97 const StateArg & state) const override
98 {
99 return MetaPhysicL::raw_value(_ad_functor.gradient(elem_point, state));
100 }
101 GradientType evaluateGradient(const NodeArg & node, const StateArg & state) const override
102 {
103 return MetaPhysicL::raw_value(_ad_functor.gradient(node, state));
104 }
105 GradientType evaluateGradient(const PointArg & point, const StateArg & state) const override
106 {
107 return MetaPhysicL::raw_value(_ad_functor.gradient(point, state));
108 }
109
110 DotType evaluateDot(const ElemArg & elem, const StateArg & state) const override
111 {
112 return MetaPhysicL::raw_value(_ad_functor.dot(elem, state));
113 }
114 DotType evaluateDot(const FaceArg & face, const StateArg & state) const override
115 {
116 return MetaPhysicL::raw_value(_ad_functor.dot(face, state));
117 }
118 DotType evaluateDot(const ElemQpArg & qp, const StateArg & state) const override
119 {
120 return MetaPhysicL::raw_value(_ad_functor.dot(qp, state));
121 }
122 DotType evaluateDot(const ElemSideQpArg & qp, const StateArg & state) const override
123 {
124 return MetaPhysicL::raw_value(_ad_functor.dot(qp, state));
125 }
126 DotType evaluateDot(const ElemPointArg & elem_point, const StateArg & state) const override
127 {
128 return MetaPhysicL::raw_value(_ad_functor.dot(elem_point, state));
129 }
130 DotType evaluateDot(const NodeArg & node, const StateArg & state) const override
131 {
132 return MetaPhysicL::raw_value(_ad_functor.dot(node, state));
133 }
134 DotType evaluateDot(const PointArg & point, const StateArg & state) const override
135 {
136 return MetaPhysicL::raw_value(_ad_functor.dot(point, state));
137 }
138
139 GradientType evaluateGradDot(const ElemArg & elem, const StateArg & state) const override
140 {
141 return MetaPhysicL::raw_value(_ad_functor.gradDot(elem, state));
142 }
143 GradientType evaluateGradDot(const FaceArg & face, const StateArg & state) const override
144 {
145 return MetaPhysicL::raw_value(_ad_functor.gradDot(face, state));
146 }
147 GradientType evaluateGradDot(const ElemQpArg & qp, const StateArg & state) const override
148 {
149 return MetaPhysicL::raw_value(_ad_functor.gradDot(qp, state));
150 }
151 GradientType evaluateGradDot(const ElemSideQpArg & qp, const StateArg & state) const override
152 {
153 return MetaPhysicL::raw_value(_ad_functor.gradDot(qp, state));
154 }
156 const StateArg & state) const override
157 {
158 return MetaPhysicL::raw_value(_ad_functor.gradDot(elem_point, state));
159 }
160 GradientType evaluateGradDot(const NodeArg & node, const StateArg & state) const override
161 {
162 return MetaPhysicL::raw_value(_ad_functor.gradDot(node, state));
163 }
164 GradientType evaluateGradDot(const PointArg & point, const StateArg & state) const override
165 {
166 return MetaPhysicL::raw_value(_ad_functor.gradDot(point, state));
167 }
169
170private:
173};
174}
subdomain_id_type SubdomainID
const ExecFlagType EXEC_ALWAYS
Definition Moose.C:54
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition FaceInfo.h:38
Base class template for functor objects.
typename FunctorReturnType< T, FunctorEvaluationKind::Gradient >::type GradientType
This rigmarole makes it so that a user can create functors that return containers (std::vector,...
const MooseFunctorName & functorName() const
Return the functor name.
ValueType evaluate(const NodeArg &node, const StateArg &state) const override
DotType evaluateDot(const PointArg &point, const StateArg &state) const override
DotType evaluateDot(const ElemSideQpArg &qp, const StateArg &state) const override
GradientType evaluateGradient(const ElemSideQpArg &qp, const StateArg &state) const override
GradientType evaluateGradDot(const ElemQpArg &qp, const StateArg &state) const override
GradientType evaluateGradient(const ElemQpArg &qp, const StateArg &state) const override
GradientType evaluateGradient(const ElemPointArg &elem_point, const StateArg &state) const override
Evaluate the functor gradient with a given element and point.
bool supportsFaceArg() const override final
Whether this functor supports evaluation with FaceArg.
virtual bool hasFaceSide(const FaceInfo &fi, const bool fi_elem_side) const override
DotType evaluateDot(const ElemQpArg &qp, const StateArg &state) const override
ValueType evaluate(const PointArg &point, const StateArg &state) const override
Evaluate the functor at a physical point without any mesh information.
ValueType evaluate(const ElemArg &elem, const StateArg &state) const override
Forward calls to wrapped object.
DotType evaluateDot(const ElemPointArg &elem_point, const StateArg &state) const override
Evaluate the functor time derivative with a given element and point.
ValueType evaluate(const ElemQpArg &qp, const StateArg &state) const override
GradientType evaluateGradDot(const PointArg &point, const StateArg &state) const override
GradientType evaluateGradient(const ElemArg &elem, const StateArg &state) const override
Evaluate the functor gradient with a given element.
GradientType evaluateGradDot(const FaceArg &face, const StateArg &state) const override
bool supportsElemSideQpArg() const override final
Whether this functor supports evaluation with ElemSideQpArg.
DotType evaluateDot(const FaceArg &face, const StateArg &state) const override
ValueType evaluate(const FaceArg &face, const StateArg &state) const override
GradientType evaluateGradDot(const NodeArg &node, const StateArg &state) const override
GradientType evaluateGradDot(const ElemSideQpArg &qp, const StateArg &state) const override
RawValueFunctor(const FunctorBase< typename ADType< T >::type > &ad_functor)
DotType evaluateDot(const NodeArg &node, const StateArg &state) const override
virtual bool isExtrapolatedBoundaryFace(const FaceInfo &fi, const Elem *const elem, const Moose::StateArg &state) const override
Returns whether this (sided) face is an extrapolated boundary face for this functor.
GradientType evaluateGradDot(const ElemPointArg &elem_point, const StateArg &state) const override
Evaluate the functor gradient-dot with a given element and point.
ValueType evaluate(const ElemSideQpArg &qp, const StateArg &state) const override
GradientType evaluateGradient(const PointArg &point, const StateArg &state) const override
virtual bool hasBlocks(const SubdomainID id) const override
Returns whether the functor is defined on this block.
GradientType evaluateGradient(const NodeArg &node, const StateArg &state) const override
DotType evaluateDot(const ElemArg &elem, const StateArg &state) const override
Evaluate the functor time derivative with a given element.
const FunctorBase< typename ADType< T >::type > & _ad_functor
Our wrapped AD object.
virtual bool isConstant() const override
Returns true if this functor is a constant.
GradientType evaluateGradient(const FaceArg &face, const StateArg &state) const override
ValueType evaluate(const ElemPointArg &elem_point, const StateArg &state) const override
Evaluate the functor with a given element and point.
GradientType evaluateGradDot(const ElemArg &elem, const StateArg &state) const override
Evaluate the functor gradient-dot with a given element.
auto raw_value(const Eigen::Map< T > &in)
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
A structure that is used to evaluate Moose functors logically at an element/cell center.
A structure that is used to evaluate Moose functors at an arbitrary physical point contained within a...
Argument for requesting functor evaluation at a quadrature point location in an element.
Argument for requesting functor evaluation at quadrature point locations on an element side.
A structure defining a "face" evaluation calling argument for Moose functors.
A structure that is used to evaluate Moose functors at an arbitrary physical point,...
State argument for evaluating functors.