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 27 of file SecondaryVariable.h.

#include <SecondaryVariable.h>

Public Types

using Function

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.
Function const eval_field
 Computes the value of the field at every node of the underlying mesh.
Function const eval_residuals

Member Typedef Documentation

◆ Function

Initial value:
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)>
MathLib::EigenVector GlobalVector

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 39 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 46 of file SecondaryVariable.h.

48 : num_components(num_components_),
49 eval_field(std::forward<F1>(eval_field_)),
50 eval_residuals(std::forward<F2>(eval_residuals_))
51 {
52 // Used to detect nasty implicit conversions.
53 static_assert(
54 std::is_same_v<
55 GlobalVector const&,
56 typename std::invoke_result_t<
57 F1, double const, std::vector<GlobalVector*> const&,
58 std::vector<NumLib::LocalToGlobalIndexMap const*> const&,
59 std::unique_ptr<GlobalVector>&>>,
60 "The function eval_field_ does not return a const reference"
61 " to a GlobalVector");
62
63 static_assert(
64 std::is_same_v<
65 GlobalVector const&,
66 typename std::invoke_result_t<
67 F2, double const, std::vector<GlobalVector*> const&,
68 std::vector<NumLib::LocalToGlobalIndexMap const*> const&,
69 std::unique_ptr<GlobalVector>&>>,
70 "The function eval_residuals_ does not return a const reference"
71 " to a GlobalVector");
72 }
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.

References eval_field, eval_residuals, and num_components.

◆ SecondaryVariableFunctions() [2/2]

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

Definition at line 75 of file SecondaryVariable.h.

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

References eval_field, and num_components.

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 95 of file SecondaryVariable.h.

Referenced by SecondaryVariableFunctions(), SecondaryVariableFunctions(), and 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 101 of file SecondaryVariable.h.

Referenced by SecondaryVariableFunctions(), and addSecondaryVariableResiduals().

◆ num_components

const unsigned ProcessLib::SecondaryVariableFunctions::num_components

Number of components of the variable.

Definition at line 92 of file SecondaryVariable.h.

Referenced by SecondaryVariableFunctions(), SecondaryVariableFunctions(), addSecondaryVariableNodes(), and addSecondaryVariableResiduals().


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