28namespace SmallDeformation
30template <
int DisplacementDim>
34 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
35 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
36 unsigned const integration_order,
37 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
41 :
Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
42 integration_order, std::move(process_variables),
43 std::move(secondary_variables)),
44 _process_data(std::move(process_data))
53 MeshLib::getOrCreateMeshProperty<double>(
54 const_cast<MeshLib::Mesh&
>(mesh),
"principal_stress_vector_1",
58 MeshLib::getOrCreateMeshProperty<double>(
59 const_cast<MeshLib::Mesh&
>(mesh),
"principal_stress_vector_2",
63 MeshLib::getOrCreateMeshProperty<double>(
64 const_cast<MeshLib::Mesh&
>(mesh),
"principal_stress_vector_3",
68 MeshLib::getOrCreateMeshProperty<double>(
74 DisplacementDim>::getReflectionDataForOutput(),
79template <
int DisplacementDim>
85template <
int DisplacementDim>
89 unsigned const integration_order)
97 auto add_secondary_variable = [&](std::string
const& name,
98 int const num_components,
99 auto get_ip_values_function)
101 _secondary_variables.addSecondaryVariable(
105 std::move(get_ip_values_function)));
108 ProcessLib::Reflection::addReflectedSecondaryVariables<DisplacementDim>(
110 DisplacementDim>::getReflectionDataForOutput(),
111 _secondary_variables, getExtrapolator(), _local_assemblers);
118 add_secondary_variable);
122 _process_data.solid_materials, _local_assemblers,
123 _integration_point_writer, integration_order);
131 *_local_to_global_index_map);
134template <
int DisplacementDim>
136 double const t,
double const dt, std::vector<GlobalVector*>
const& x,
137 std::vector<GlobalVector*>
const& x_prev,
int const process_id,
140 DBUG(
"Assemble SmallDeformationProcess.");
142 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
143 _local_to_global_index_map.get()};
147 getActiveElementIDs(), dof_table, t, dt, x, x_prev, process_id, &M, &K,
150 _global_output(t, process_id, M, K, b);
153template <
int DisplacementDim>
156 double const t,
double const dt, std::vector<GlobalVector*>
const& x,
157 std::vector<GlobalVector*>
const& x_prev,
int const process_id,
160 DBUG(
"AssembleWithJacobian SmallDeformationProcess.");
162 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
163 _local_to_global_index_map.get()};
167 _local_assemblers, getActiveElementIDs(), dof_table, t, dt, x, x_prev,
168 process_id, &b, &Jac);
170 transformVariableFromGlobalVector(b, 0, *_local_to_global_index_map,
171 *_nodal_forces, std::negate<double>());
173 _global_output(t, process_id, b, Jac);
176template <
int DisplacementDim>
178 std::vector<GlobalVector*>
const& x,
179 std::vector<GlobalVector*>
const& x_prev,
double const t,
double const dt,
180 int const process_id)
182 DBUG(
"PostTimestep SmallDeformationProcess.");
183 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
184 dof_tables.reserve(x.size());
185 std::generate_n(std::back_inserter(dof_tables), x.size(),
186 [&]() { return _local_to_global_index_map.get(); });
190 getActiveElementIDs(), dof_tables, x, x_prev, t, dt, process_id);
192 std::unique_ptr<GlobalVector> material_forces;
194 material_forces, _local_assemblers, *_local_to_global_index_map,
197 material_forces->copyValues(*_material_forces);
200template <
int DisplacementDim>
202 double const t,
double const dt, std::vector<GlobalVector*>
const& x,
205 DBUG(
"Compute the secondary variables for SmallDeformationProcess.");
206 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
207 dof_tables.reserve(x.size());
208 std::generate_n(std::back_inserter(dof_tables), x.size(),
209 [&]() { return _local_to_global_index_map.get(); });
213 getActiveElementIDs(), dof_tables, t, dt, x, x_prev, process_id);
215 computeCellAverages<DisplacementDim>(cell_average_data_, _local_assemblers);
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Global vector based on Eigen vector.
bool isAxiallySymmetric() const
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Properties & getProperties()
virtual void postTimestep(std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
virtual void computeSecondaryVariable(std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id)
virtual void initialize(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > _integration_point_writer
Handles configuration of several secondary variables from the project file.
void assemble(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalMatrix *M, GlobalMatrix *K, GlobalVector *b)
void assembleWithJacobian(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalVector *b, GlobalMatrix *Jac)
void addReflectedIntegrationPointWriters(ReflData const &reflection_data, std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > &integration_point_writers, unsigned const integration_order, std::vector< std::unique_ptr< LocAsmIF > > const &local_assemblers)
SecondaryVariableFunctions makeExtrapolator(const unsigned num_components, NumLib::Extrapolator &extrapolator, LocalAssemblerCollection const &local_assemblers, typename NumLib::ExtrapolatableLocalAssemblerCollection< LocalAssemblerCollection >::IntegrationPointValuesMethod integration_point_values_method)
void setIPDataInitialConditions(std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > const &_integration_point_writer, MeshLib::Properties const &mesh_properties, LocalAssemblersVector &local_assemblers)
static void executeSelectedMemberOnDereferenced(Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
static void executeSelectedMemberDereferenced(Object &object, Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
static void executeMemberOnDereferenced(Method method, Container const &container, Args &&... args)