29namespace SmallDeformation
31template <
int DisplacementDim>
35 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
36 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
37 unsigned const integration_order,
38 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
42 :
Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
43 integration_order, std::move(process_variables),
44 std::move(secondary_variables)),
45 _process_data(std::move(process_data))
55 const_cast<MeshLib::Mesh&
>(mesh),
"principal_stress_vector_1",
60 const_cast<MeshLib::Mesh&
>(mesh),
"principal_stress_vector_2",
65 const_cast<MeshLib::Mesh&
>(mesh),
"principal_stress_vector_3",
75 DisplacementDim>::getReflectionDataForOutput(),
80template <
int DisplacementDim>
86template <
int DisplacementDim>
90 unsigned const integration_order)
98 auto add_secondary_variable = [&](std::string
const& name,
99 int const num_components,
100 auto get_ip_values_function)
102 _secondary_variables.addSecondaryVariable(
106 std::move(get_ip_values_function)));
111 DisplacementDim>::getReflectionDataForOutput(),
112 _secondary_variables, getExtrapolator(), _local_assemblers);
119 add_secondary_variable);
123 _process_data.solid_materials, _local_assemblers,
124 _integration_point_writer, integration_order);
132 *_local_to_global_index_map);
135template <
int DisplacementDim>
137 double const t,
double const dt, std::vector<GlobalVector*>
const& x,
138 std::vector<GlobalVector*>
const& x_prev,
int const process_id,
141 DBUG(
"Assemble SmallDeformationProcess.");
143 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
144 _local_to_global_index_map.get()};
148 getActiveElementIDs(), dof_table, t, dt, x, x_prev, process_id, &M, &K,
151 _global_output(t, process_id, M, K, b);
154template <
int DisplacementDim>
157 double const t,
double const dt, std::vector<GlobalVector*>
const& x,
158 std::vector<GlobalVector*>
const& x_prev,
int const process_id,
161 DBUG(
"AssembleWithJacobian SmallDeformationProcess.");
163 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
164 _local_to_global_index_map.get()};
170 _local_assemblers, getActiveElementIDs(), dof_table, t, dt, x,
171 x_prev, process_id, &b, &Jac);
175 transformVariableFromGlobalVector(b, 0, *_local_to_global_index_map,
177 std::negate<double>());
180 transformVariableFromGlobalVector(b, 0, *_local_to_global_index_map,
181 *_nodal_forces, std::negate<double>());
183 _global_output(t, process_id, b, Jac);
186template <
int DisplacementDim>
188 std::vector<GlobalVector*>
const& x,
189 std::vector<GlobalVector*>
const& x_prev,
double const t,
double const dt,
190 int const process_id)
192 DBUG(
"PostTimestep SmallDeformationProcess.");
193 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
194 dof_tables.reserve(x.size());
195 std::generate_n(std::back_inserter(dof_tables), x.size(),
196 [&]() { return _local_to_global_index_map.get(); });
200 getActiveElementIDs(), dof_tables, x, x_prev, t, dt, process_id);
202 std::unique_ptr<GlobalVector> material_forces;
204 material_forces, _local_assemblers, *_local_to_global_index_map,
207 material_forces->copyValues(*_material_forces);
210template <
int DisplacementDim>
212 double const t,
double const dt, std::vector<GlobalVector*>
const& x,
215 DBUG(
"Compute the secondary variables for SmallDeformationProcess.");
216 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
217 dof_tables.reserve(x.size());
218 std::generate_n(std::back_inserter(dof_tables), x.size(),
219 [&]() { return _local_to_global_index_map.get(); });
223 getActiveElementIDs(), dof_tables, t, dt, x, x_prev, process_id);
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)
PropertyVector< T > * getOrCreateMeshProperty(Mesh &mesh, std::string const &property_name, MeshItemType const item_type, int const number_of_components)
void addReflectedSecondaryVariables(ReflData const &reflection_data, SecondaryVariableCollection &secondary_variables, NumLib::Extrapolator &extrapolator, std::vector< std::unique_ptr< LocAsmIF > > const &local_assemblers)
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)
void computeCellAverages(CellAverageData &cell_average_data, std::vector< std::unique_ptr< LAIntf > > 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)