23template <
int DisplacementDim>
26 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
27 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
28 unsigned const integration_order,
29 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
33 bool const use_monolithic_scheme,
bool const is_linear)
34 :
Process(std::move(
name), mesh, std::move(jacobian_assembler), parameters,
35 integration_order, std::move(process_variables),
36 std::move(secondary_variables), use_monolithic_scheme),
39 process_data_(std::move(process_data))
42 this->_jacobian_assembler->setNonDeformationComponentIDs(
46 DisplacementDim>(LocalAssemblerIF::getReflectionDataForOutput(),
47 _integration_point_writer, integration_order,
51template <
int DisplacementDim>
57template <
int DisplacementDim>
60 const int process_id)
const
67 return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(),
73 return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(),
77template <
int DisplacementDim>
82 std::make_unique<MeshLib::MeshSubset>(
_mesh,
_mesh.getNodes());
90 std::vector<MeshLib::MeshSubset> all_mesh_subsets_single_component{
93 std::make_unique<NumLib::LocalToGlobalIndexMap>(
94 std::move(all_mesh_subsets_single_component),
101 std::vector<MeshLib::MeshSubset> all_mesh_subsets{
105 const int monolithic_process_id = 0;
106 std::generate_n(std::back_inserter(all_mesh_subsets),
109 .getNumberOfGlobalComponents(),
112 std::vector<int>
const vec_n_components{1, DisplacementDim};
114 std::make_unique<NumLib::LocalToGlobalIndexMap>(
115 std::move(all_mesh_subsets), vec_n_components,
122 const int process_id = 1;
123 std::vector<MeshLib::MeshSubset> all_mesh_subsets;
124 std::generate_n(std::back_inserter(all_mesh_subsets),
127 .getNumberOfGlobalComponents(),
130 std::vector<int>
const vec_n_components{DisplacementDim};
132 std::make_unique<NumLib::LocalToGlobalIndexMap>(
133 std::move(all_mesh_subsets), vec_n_components,
138 std::vector<MeshLib::MeshSubset> all_mesh_subsets_base_nodes{
141 std::make_unique<NumLib::LocalToGlobalIndexMap>(
142 std::move(all_mesh_subsets_base_nodes),
154template <
int DisplacementDim>
158 unsigned const integration_order)
170 auto add_secondary_variable = [&](std::string
const&
name,
171 int const num_components,
172 auto get_ip_values_function)
178 std::move(get_ip_values_function)));
186 add_secondary_variable);
205 DisplacementDim>::RowsAtCompileTime);
221template <
int DisplacementDim>
223 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
227 const int monolithic_process_id = 0;
235 const int hydraulic_process_id = 0;
241 const int mechanical_process_id = 1;
246template <
int DisplacementDim>
250 int const process_id)
257 DBUG(
"SetInitialConditions RichardsMechanicsProcess.");
264template <
int DisplacementDim>
266 const double t,
double const dt, std::vector<GlobalVector*>
const& x,
267 std::vector<GlobalVector*>
const& x_prev,
int const process_id,
270 DBUG(
"Assemble the equations for RichardsMechanics");
273 t, dt, x, x_prev, process_id, M, K, b);
276template <
int DisplacementDim>
279 const double t,
double const dt, std::vector<GlobalVector*>
const& x,
280 std::vector<GlobalVector*>
const& x_prev,
int const process_id,
287 "Assemble the Jacobian of RichardsMechanics for the monolithic"
296 "Assemble the Jacobian equations of liquid fluid process in "
297 "RichardsMechanics for the staggered scheme.");
302 "Assemble the Jacobian equations of mechanical process in "
303 "RichardsMechanics for the staggered scheme.");
308 assembleWithJacobian(t, dt, x, x_prev, process_id, b, Jac);
311template <
int DisplacementDim>
313 std::vector<GlobalVector*>
const& x,
double const t,
double const dt,
314 const int process_id)
316 DBUG(
"PreTimestep RichardsMechanicsProcess.");
327template <
int DisplacementDim>
329 std::vector<GlobalVector*>
const& x,
330 std::vector<GlobalVector*>
const& x_prev,
double const t,
double const dt,
331 const int process_id)
335 DBUG(
"PostTimestep RichardsMechanicsProcess.");
344template <
int DisplacementDim>
345std::vector<std::vector<std::string>>
347 std::vector<std::reference_wrapper<MeshLib::Mesh>>
const& meshes)
349 INFO(
"RichardsMechanics process initializeSubmeshOutput().");
350 std::vector<std::vector<std::string>> residuum_names{
351 {
"MassFlowRate",
"NodalForces"}};
354 initializeAssemblyOnSubmeshes(meshes, residuum_names);
356 return residuum_names;
359template <
int DisplacementDim>
362 std::vector<GlobalVector*>
const& x,
364 int const process_id)
371 DBUG(
"Compute the secondary variables for RichardsMechanicsProcess.");
379template <
int DisplacementDim>
383 const bool manage_storage =
false;
388template <
int DisplacementDim>
391 const int process_id)
const
MathLib::EigenMatrix GlobalMatrix
MathLib::EigenVector GlobalVector
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
bool isAxiallySymmetric() const
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Properties & getProperties()
void updateActiveElements()
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 preTimestep(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t, double const delta_t)
virtual void initialize(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
virtual void setInitialConditions(std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, double const t, int const process_id)
std::vector< NumLib::LocalToGlobalIndexMap const * > getDOFTables(int const number_of_processes) const
std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > _integration_point_writer
void initializeProcessBoundaryConditionsAndSourceTerms(const NumLib::LocalToGlobalIndexMap &dof_table, const int process_id, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
void assemble(const double 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) final
Process(std::string name_, MeshLib::Mesh &mesh, std::unique_ptr< AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > &&process_variables, SecondaryVariableCollection &&secondary_variables, const bool use_monolithic_scheme=true)
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_all_nodes
std::vector< std::size_t > const & getActiveElementIDs() const
SecondaryVariableCollection _secondary_variables
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > _jacobian_assembler
std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > const & getProcessVariables() const
NumLib::Extrapolator & getExtrapolator() const
GlobalSparsityPattern _sparsity_pattern
const bool _use_monolithic_scheme
GlobalSparsityPattern sparsity_pattern_with_linear_element_
void assembleConcreteProcess(const double 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) override
void preTimestepConcreteProcess(std::vector< GlobalVector * > const &x, double const t, double const dt, const int process_id) override
MathLib::MatrixSpecifications getMatrixSpecifications(const int process_id) const override
void constructDofTable() override
RichardsMechanicsProcessData< DisplacementDim > process_data_
void initializeConcreteProcess(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order) override
Process specific initialization called by initialize().
std::vector< MeshLib::Node * > base_nodes_
std::unique_ptr< NumLib::LocalToGlobalIndexMap > local_to_global_index_map_with_base_nodes_
void computeSecondaryVariableConcrete(double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id) override
bool hasMechanicalProcess(int const process_id) const
std::unique_ptr< NumLib::LocalToGlobalIndexMap > local_to_global_index_map_single_component_
bool isLinear() const override
void setInitialConditionsConcreteProcess(std::vector< GlobalVector * > &x, double const t, int const process_id) override
void assembleWithJacobianConcreteProcess(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) override
void initializeBoundaryConditions(std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media) override
void postTimestepConcreteProcess(std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, const int process_id) override
std::vector< std::vector< std::string > > initializeAssemblyOnSubmeshes(std::vector< std::reference_wrapper< MeshLib::Mesh > > const &meshes) override
LocalAssemblerInterface< DisplacementDim > LocalAssemblerIF
std::vector< std::unique_ptr< LocalAssemblerIF > > local_assemblers_
NumLib::LocalToGlobalIndexMap const & getDOFTable(const int process_id) const override
std::tuple< NumLib::LocalToGlobalIndexMap *, bool > getDOFTableForExtrapolatorData() const override
RichardsMechanicsProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > &&process_variables, RichardsMechanicsProcessData< DisplacementDim > &&process_data, SecondaryVariableCollection &&secondary_variables, bool const use_monolithic_scheme, bool const is_linear)
std::unique_ptr< MeshLib::MeshSubset const > mesh_subset_base_nodes_
Handles configuration of several secondary variables from the project file.
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
PropertyVector< T > * getOrCreateMeshProperty(Mesh &mesh, std::string const &property_name, MeshItemType const item_type, int const number_of_components)
std::vector< Node * > getBaseNodes(std::vector< Element * > const &elements)
@ BY_LOCATION
Ordering data by spatial location.
GlobalSparsityPattern computeSparsityPattern(LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)
Computes a sparsity pattern for the given inputs.
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)
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)
void createLocalAssemblersHM(std::vector< MeshLib::Element * > const &mesh_elements, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< std::unique_ptr< LocalAssemblerInterface > > &local_assemblers, ProviderOrOrder const &provider_or_order, ExtraCtorArgs &&... extra_ctor_args)
static void executeSelectedMemberOnDereferenced(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)
static auto getReflectionDataForOutput()