20class LocalToGlobalIndexMap;
41 std::vector<GlobalVector*>
const& x,
42 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_table,
43 std::unique_ptr<GlobalVector>& result_cache)>;
45 template <
typename F1,
typename F2>
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");
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");
74 template <
typename F1>
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");
119 std::string
const& external_name);
138 std::map<std::string, std::string>::const_iterator
begin()
const;
139 std::map<std::string, std::string>::const_iterator
end()
const;
163template <
typename LocalAssemblerCollection>
165 const unsigned num_components,
167 LocalAssemblerCollection
const& local_assemblers,
169 LocalAssemblerCollection>::IntegrationPointValuesMethod
170 integration_point_values_method)
172 auto const eval_field =
173 [num_components, &extrapolator, &local_assemblers,
174 integration_point_values_method](
176 std::vector<GlobalVector*>
const& x,
177 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_tables,
178 std::unique_ptr<GlobalVector>&
182 local_assemblers, integration_point_values_method);
183 extrapolator.
extrapolate(num_components, extrapolatables, t, x,
188 auto const eval_residuals =
189 [num_components, &extrapolator, &local_assemblers,
190 integration_point_values_method](
192 std::vector<GlobalVector*>
const& x,
193 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_tables,
194 std::unique_ptr<GlobalVector>&
198 local_assemblers, integration_point_values_method);
203 return {num_components, eval_field, eval_residuals};
212template <
typename LocalAssemblerCollection,
typename IPDataAccessor>
214 const unsigned num_components,
216 LocalAssemblerCollection
const& local_assemblers,
217 IPDataAccessor&& accessor)
220 decltype(*std::declval<LocalAssemblerCollection>()[0])>;
221 static_assert(std::is_invocable_r_v<std::vector<double>, IPDataAccessor,
224 if (num_components == 1)
226 auto method_wrapped =
229 std::vector<GlobalVector*>
const& ,
232 std::vector<double>& cache) -> std::vector<double>
const&
234 cache = accessor(loc_asm);
242 auto method_wrapped =
243 [accessor, num_components](
245 std::vector<GlobalVector*>
const& ,
248 std::vector<double>& cache) -> std::vector<double>
const&
250 cache = accessor(loc_asm);
Global vector based on Eigen vector.
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.