OGS
ProcessLib::SecondaryVariableFunctions Struct Referencefinal

Detailed Description

Holder for function objects that compute secondary variables, and (optionally) also the residuals (e.g., in case of extrapolation)

Definition at line 26 of file SecondaryVariable.h.

#include <SecondaryVariable.h>

Public Types

using Function = std::function< GlobalVector const &(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::unique_ptr< GlobalVector > &result_cache)>
 

Public Member Functions

template<typename F1 , typename F2 >
 SecondaryVariableFunctions (const unsigned num_components_, F1 &&eval_field_, F2 &&eval_residuals_)
 
template<typename F1 >
 SecondaryVariableFunctions (const unsigned num_components_, F1 &&eval_field_, std::nullptr_t)
 

Public Attributes

const unsigned num_components
 Number of components of the variable. More...
 
Function const eval_field
 Computes the value of the field at every node of the underlying mesh. More...
 
Function const eval_residuals
 

Member Typedef Documentation

◆ Function

using ProcessLib::SecondaryVariableFunctions::Function = std::function<GlobalVector const&( const double t, std::vector<GlobalVector*> const& x, std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table, std::unique_ptr<GlobalVector>& result_cache)>

Type of functions used.

Note
The argument dof_table is the d.o.f. table of the process, i.e. it possibly contains information about several process variables.
Remarks
The result_cache can be used to store the GlobalVector if it is computed on-the-fly. Then a reference to the result cache can be returned. Otherwise the Function must return a reference to a GlobalVector that is stored somewhere else.

Definition at line 38 of file SecondaryVariable.h.

Constructor & Destructor Documentation

◆ SecondaryVariableFunctions() [1/2]

template<typename F1 , typename F2 >
ProcessLib::SecondaryVariableFunctions::SecondaryVariableFunctions ( const unsigned  num_components_,
F1 &&  eval_field_,
F2 &&  eval_residuals_ 
)
inline

Definition at line 45 of file SecondaryVariable.h.

47  : num_components(num_components_),
48  eval_field(std::forward<F1>(eval_field_)),
49  eval_residuals(std::forward<F2>(eval_residuals_))
50  {
51  // Used to detect nasty implicit conversions.
52  static_assert(
53  std::is_same_v<
54  GlobalVector const&,
55  typename std::invoke_result_t<
56  F1, double const, std::vector<GlobalVector*> const&,
57  std::vector<NumLib::LocalToGlobalIndexMap const*> const&,
58  std::unique_ptr<GlobalVector>&>>,
59  "The function eval_field_ does not return a const reference"
60  " to a GlobalVector");
61 
62  static_assert(
63  std::is_same_v<
64  GlobalVector const&,
65  typename std::invoke_result_t<
66  F2, double const, std::vector<GlobalVector*> const&,
67  std::vector<NumLib::LocalToGlobalIndexMap const*> const&,
68  std::unique_ptr<GlobalVector>&>>,
69  "The function eval_residuals_ does not return a const reference"
70  " to a GlobalVector");
71  }
Global vector based on Eigen vector.
Definition: EigenVector.h:28
Function const eval_field
Computes the value of the field at every node of the underlying mesh.
const unsigned num_components
Number of components of the variable.

◆ SecondaryVariableFunctions() [2/2]

template<typename F1 >
ProcessLib::SecondaryVariableFunctions::SecondaryVariableFunctions ( const unsigned  num_components_,
F1 &&  eval_field_,
std::nullptr_t   
)
inline

Definition at line 74 of file SecondaryVariable.h.

76  : num_components(num_components_),
77  eval_field(std::forward<F1>(eval_field_))
78  {
79  // Used to detect nasty implicit conversions.
80  static_assert(
81  std::is_same_v<
82  GlobalVector const&,
83  typename std::invoke_result_t<
84  F1, double const, std::vector<GlobalVector*> const&,
85  std::vector<NumLib::LocalToGlobalIndexMap const*> const&,
86  std::unique_ptr<GlobalVector>&>>,
87  "The function eval_field_ does not return a const reference"
88  " to a GlobalVector");
89  }

Member Data Documentation

◆ eval_field

Function const ProcessLib::SecondaryVariableFunctions::eval_field

Computes the value of the field at every node of the underlying mesh.

Definition at line 94 of file SecondaryVariable.h.

Referenced by addSecondaryVariableNodes().

◆ eval_residuals

Function const ProcessLib::SecondaryVariableFunctions::eval_residuals

If the secondary variable is extrapolated from integration points to mesh nodes, this function computes the extrapolation residual. For further information check the specific NumLib::Extrapolator documentation.

Definition at line 100 of file SecondaryVariable.h.

Referenced by addSecondaryVariableResiduals().

◆ num_components

const unsigned ProcessLib::SecondaryVariableFunctions::num_components

Number of components of the variable.

Definition at line 91 of file SecondaryVariable.h.

Referenced by addSecondaryVariableNodes(), and addSecondaryVariableResiduals().


The documentation for this struct was generated from the following file: