34 std::vector<GlobalVector*>
const& x,
35 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_table,
36 std::unique_ptr<GlobalVector>& result_cache)>;
38 template <
typename F1,
typename F2>
49 typename std::invoke_result_t<
50 F1,
double const, std::vector<GlobalVector*>
const&,
51 std::vector<NumLib::LocalToGlobalIndexMap const*>
const&,
52 std::unique_ptr<GlobalVector>&>>,
53 "The function eval_field_ does not return a const reference"
54 " to a GlobalVector");
59 typename std::invoke_result_t<
60 F2,
double const, std::vector<GlobalVector*>
const&,
61 std::vector<NumLib::LocalToGlobalIndexMap const*>
const&,
62 std::unique_ptr<GlobalVector>&>>,
63 "The function eval_residuals_ does not return a const reference"
64 " to a GlobalVector");
67 template <
typename F1>
77 typename std::invoke_result_t<
78 F1,
double const, std::vector<GlobalVector*>
const&,
79 std::vector<NumLib::LocalToGlobalIndexMap const*>
const&,
80 std::unique_ptr<GlobalVector>&>>,
81 "The function eval_field_ does not return a const reference"
82 " to a GlobalVector");
112 std::string
const& external_name);
131 std::map<std::string, std::string>::const_iterator
begin()
const;
132 std::map<std::string, std::string>::const_iterator
end()
const;
156template <
typename LocalAssemblerCollection>
158 const unsigned num_components,
160 LocalAssemblerCollection
const& local_assemblers,
162 LocalAssemblerCollection>::IntegrationPointValuesMethod
163 integration_point_values_method)
165 auto const eval_field =
166 [num_components, &extrapolator, &local_assemblers,
167 integration_point_values_method](
169 std::vector<GlobalVector*>
const& x,
170 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_tables,
171 std::unique_ptr<GlobalVector>&
175 local_assemblers, integration_point_values_method);
176 extrapolator.
extrapolate(num_components, extrapolatables, t, x,
181 auto const eval_residuals =
182 [num_components, &extrapolator, &local_assemblers,
183 integration_point_values_method](
185 std::vector<GlobalVector*>
const& x,
186 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_tables,
187 std::unique_ptr<GlobalVector>&
191 local_assemblers, integration_point_values_method);
196 return {num_components, eval_field, eval_residuals};
205template <
typename LocalAssemblerCollection,
typename IPDataAccessor>
207 const unsigned num_components,
209 LocalAssemblerCollection
const& local_assemblers,
210 IPDataAccessor&& accessor)
213 decltype(*std::declval<LocalAssemblerCollection>()[0])>;
214 static_assert(std::is_invocable_r_v<std::vector<double>, IPDataAccessor,
217 if (num_components == 1)
219 auto method_wrapped =
222 std::vector<GlobalVector*>
const& ,
225 std::vector<double>& cache) -> std::vector<double>
const&
227 cache = accessor(loc_asm);
235 auto method_wrapped =
236 [accessor, num_components](
238 std::vector<GlobalVector*>
const& ,
241 std::vector<double>& cache) -> std::vector<double>
const&
243 cache = accessor(loc_asm);
MathLib::EigenVector GlobalVector
Handles configuration of several secondary variables from the project file.
SecondaryVariable const & get(std::string const &external_name) const
Returns the secondary variable with the given external name.
std::map< std::string, std::string > _map_external_to_internal
void addNameMapping(std::string const &internal_name, std::string const &external_name)
Register a variable with the given internal and external names.
std::map< std::string, std::string >::const_iterator begin() const
void addSecondaryVariable(std::string const &internal_name, SecondaryVariableFunctions &&fcts)
std::map< std::string, std::string >::const_iterator end() const
std::map< std::string, SecondaryVariable > _configured_secondary_variables
ExtrapolatableLocalAssemblerCollection< LocalAssemblerCollection > makeExtrapolatable(LocalAssemblerCollection const &local_assemblers, IntegrationPointValuesMethod integration_point_values_method)
std::vector< double > transposeInPlace(StoreValuesFunction const &store_values_function)
SecondaryVariableFunctions makeExtrapolator2(const unsigned num_components, NumLib::Extrapolator &extrapolator, LocalAssemblerCollection const &local_assemblers, IPDataAccessor &&accessor)
SecondaryVariableFunctions makeExtrapolator(const unsigned num_components, NumLib::Extrapolator &extrapolator, LocalAssemblerCollection const &local_assemblers, typename NumLib::ExtrapolatableLocalAssemblerCollection< LocalAssemblerCollection >::IntegrationPointValuesMethod integration_point_values_method)
SecondaryVariableFunctions(const unsigned num_components_, F1 &&eval_field_, F2 &&eval_residuals_)
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)> Function
SecondaryVariableFunctions(const unsigned num_components_, F1 &&eval_field_, std::nullptr_t)
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.
Function const eval_residuals
Stores information about a specific secondary variable.
SecondaryVariableFunctions fcts
Functions used for computing the secondary variable.
std::string const name
Name of the variable; used, e.g., for output.