Commit 4d41ae9f authored by Dmitry Yu. Naumov's avatar Dmitry Yu. Naumov
Browse files

[PL] IPWriter creation for internal state vars.

Similar to the secondary variables function but now for
the integration point writers.
parent 9ed70d74
......@@ -78,7 +78,56 @@ void solidMaterialInternalToSecondaryVariables(
add_secondary_variable(name, num_components, std::move(getIntPtValues));
template <typename LocalAssemblerInterface, typename AddIntegrationPointWriter,
int DisplacementDim>
void solidMaterialInternalVariablesToIntegrationPointWriter(
std::map<int, std::unique_ptr<MaterialLib::Solids::MechanicsBase<
DisplacementDim>>> const& solid_materials,
std::vector<std::unique_ptr<LocalAssemblerInterface>> const&
AddIntegrationPointWriter const& add_integration_point_writer)
// Collect the internal variables for all solid materials.
std::vector<typename MaterialLib::Solids::MechanicsBase<
for (auto const& solid_material : solid_materials)
auto const ivs = solid_material.second->getInternalVariables();
copy(begin(ivs), end(ivs), back_inserter(internal_variables));
// Create integration point writers for each of the internal variables.
for (auto const& internal_variable : internal_variables)
auto const& name =;
auto const& fct = internal_variable.reference;
auto const n_components = internal_variable.num_components;
DBUG("Creating integration point writer for internal variable {:s}.",
auto get_integration_point_data = [fct, n_components,
&local_assemblers]() {
// Result containing integration point data for each local
// assembler.
std::vector<std::vector<double>> result;
std::transform(begin(local_assemblers), end(local_assemblers),
[fct, n_components](auto const& local_assembler) {
return local_assembler
fct, n_components);
return result;
add_integration_point_writer(name, n_components,
} // namespace ProcessLib::Deformation
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment