OGS
ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim > Class Template Referencefinal

Detailed Description

template<int DisplacementDim>
class ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >

Linear kinematics poro-mechanical/biphasic (fluid-solid mixture) model.

The mixture momentum balance and the mixture mass balance are solved under fully saturated conditions.

Definition at line 26 of file RichardsMechanicsProcess.h.

#include <RichardsMechanicsProcess.h>

Inheritance diagram for ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >:
[legend]
Collaboration diagram for ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >:
[legend]

Public Member Functions

 RichardsMechanicsProcess (std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, 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)
 
MathLib::MatrixSpecifications getMatrixSpecifications (const int process_id) const override
 
ODESystem interface
bool isLinear () const override
 
- Public Member Functions inherited from ProcessLib::Process
 Process (std::string name_, MeshLib::Mesh &mesh, std::unique_ptr< AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > &&process_variables, SecondaryVariableCollection &&secondary_variables, const bool use_monolithic_scheme=true)
 
void preTimestep (std::vector< GlobalVector * > const &x, const double t, const double delta_t, const int process_id)
 Preprocessing before starting assembly for new timestep.
 
void postTimestep (std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, const double t, const double delta_t, int const process_id)
 Postprocessing after a complete timestep.
 
void postNonLinearSolver (std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, const double t, double const dt, int const process_id)
 
void preIteration (const unsigned iter, GlobalVector const &x) final
 
void computeSecondaryVariable (double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id)
 compute secondary variables for the coupled equations or for output.
 
NumLib::IterationResult postIteration (GlobalVector const &x) final
 
void initialize (std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
 
void setInitialConditions (std::vector< GlobalVector * > &process_solutions, std::vector< GlobalVector * > const &process_solutions_prev, double const t, int const process_id)
 
MathLib::MatrixSpecifications getMatrixSpecifications (const int process_id) const override
 
void updateDeactivatedSubdomains (double const time, const int process_id)
 
virtual bool isMonolithicSchemeUsed () const
 
virtual void extrapolateIntegrationPointValuesToNodes (const double, std::vector< GlobalVector * > const &, std::vector< GlobalVector * > &)
 
void preAssemble (const double t, double const dt, GlobalVector const &x) final
 
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
 
void assembleWithJacobian (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, GlobalMatrix &Jac) final
 
void preOutput (const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id)
 
std::vector< NumLib::IndexValueVector< GlobalIndexType > > const * getKnownSolutions (double const t, GlobalVector const &x, int const process_id) const final
 
MeshLib::MeshgetMesh () const
 
std::vector< std::reference_wrapper< ProcessVariable > > const & getProcessVariables (const int process_id) const
 
std::vector< std::size_t > const & getActiveElementIDs () const
 
SecondaryVariableCollection const & getSecondaryVariables () const
 
std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > const & getIntegrationPointWriters () const
 
virtual Eigen::Vector3d getFlux (std::size_t, MathLib::Point3d const &, double const, std::vector< GlobalVector * > const &) const
 
virtual void solveReactionEquation (std::vector< GlobalVector * > &, std::vector< GlobalVector * > const &, double const, double const, NumLib::EquationSystem &, int const)
 
- Public Member Functions inherited from ProcessLib::SubmeshAssemblySupport
virtual std::vector< std::string > initializeAssemblyOnSubmeshes (std::vector< std::reference_wrapper< MeshLib::Mesh > > const &meshes)
 
virtual ~SubmeshAssemblySupport ()=default
 

Private Types

using LocalAssemblerIF = LocalAssemblerInterface<DisplacementDim>
 

Private Member Functions

void constructDofTable () override
 
void initializeConcreteProcess (NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order) override
 Process specific initialization called by initialize().
 
void initializeBoundaryConditions (std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media) override
 
void setInitialConditionsConcreteProcess (std::vector< GlobalVector * > &x, double const t, int const process_id) override
 
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 assembleWithJacobianConcreteProcess (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, GlobalMatrix &Jac) 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
 
NumLib::LocalToGlobalIndexMap const & getDOFTable (const int process_id) const override
 
void computeSecondaryVariableConcrete (double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id) override
 
std::tuple< NumLib::LocalToGlobalIndexMap *, bool > getDOFTableForExtrapolatorData () const override
 
bool hasMechanicalProcess (int const process_id) const
 

Private Attributes

std::vector< MeshLib::Node * > _base_nodes
 
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_base_nodes
 
RichardsMechanicsProcessData< DisplacementDim > _process_data
 
std::vector< std::unique_ptr< LocalAssemblerIF > > _local_assemblers
 
std::unique_ptr< NumLib::LocalToGlobalIndexMap_local_to_global_index_map_single_component
 
std::unique_ptr< NumLib::LocalToGlobalIndexMap_local_to_global_index_map_with_base_nodes
 
GlobalSparsityPattern _sparsity_pattern_with_linear_element
 
MeshLib::PropertyVector< double > * _nodal_forces = nullptr
 
MeshLib::PropertyVector< double > * _hydraulic_flow = nullptr
 

Additional Inherited Members

- Public Attributes inherited from ProcessLib::Process
std::string const name
 
- Static Public Attributes inherited from ProcessLib::Process
static PROCESSLIB_EXPORT const std::string constant_one_parameter_name = "constant_one"
 
- Protected Member Functions inherited from ProcessLib::Process
NumLib::ExtrapolatorgetExtrapolator () const
 
NumLib::LocalToGlobalIndexMap const & getSingleComponentDOFTable () const
 
void initializeProcessBoundaryConditionsAndSourceTerms (const NumLib::LocalToGlobalIndexMap &dof_table, const int process_id, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
 
void constructMonolithicProcessDofTable ()
 
void constructDofTableOfSpecifiedProcessStaggeredScheme (const int specified_process_id)
 
std::vector< GlobalIndexTypegetIndicesOfResiduumWithoutInitialCompensation () const override
 
- Protected Attributes inherited from ProcessLib::Process
MeshLib::Mesh_mesh
 
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_all_nodes
 
std::unique_ptr< NumLib::LocalToGlobalIndexMap_local_to_global_index_map
 
SecondaryVariableCollection _secondary_variables
 
std::unique_ptr< ProcessLib::AbstractJacobianAssembler_jacobian_assembler
 
VectorMatrixAssembler _global_assembler
 
const bool _use_monolithic_scheme
 
unsigned const _integration_order
 
std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > _integration_point_writer
 
GlobalSparsityPattern _sparsity_pattern
 
std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > _process_variables
 
std::vector< BoundaryConditionCollection_boundary_conditions
 

Member Typedef Documentation

◆ LocalAssemblerIF

template<int DisplacementDim>
using ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::LocalAssemblerIF = LocalAssemblerInterface<DisplacementDim>
private

Definition at line 65 of file RichardsMechanicsProcess.h.

Constructor & Destructor Documentation

◆ RichardsMechanicsProcess()

template<int DisplacementDim>
ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::RichardsMechanicsProcess ( std::string name,
MeshLib::Mesh & mesh,
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > && jacobian_assembler,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
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 )

Definition at line 30 of file RichardsMechanicsProcess.cpp.

41 : Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
42 integration_order, std::move(process_variables),
43 std::move(secondary_variables), use_monolithic_scheme),
44 _process_data(std::move(process_data))
45{
46 _nodal_forces = MeshLib::getOrCreateMeshProperty<double>(
47 mesh, "NodalForces", MeshLib::MeshItemType::Node, DisplacementDim);
48
49 _hydraulic_flow = MeshLib::getOrCreateMeshProperty<double>(
50 mesh, "MassFlowRate", MeshLib::MeshItemType::Node, 1);
51
52 // TODO (naumov) remove ip suffix. Probably needs modification of the mesh
53 // properties, s.t. there is no "overlapping" with cell/point data.
54 // See getOrCreateMeshProperty.
55 _integration_point_writer.emplace_back(
56 std::make_unique<MeshLib::IntegrationPointWriter>(
57 "sigma_ip",
58 static_cast<int>(mesh.getDimension() == 2 ? 4 : 6) /*n components*/,
59 integration_order, _local_assemblers, &LocalAssemblerIF::getSigma));
60
61 _integration_point_writer.emplace_back(
62 std::make_unique<MeshLib::IntegrationPointWriter>(
63 "saturation_ip", 1 /*n components*/, integration_order,
65
66 _integration_point_writer.emplace_back(
67 std::make_unique<MeshLib::IntegrationPointWriter>(
68 "porosity_ip", 1 /*n components*/, integration_order,
70
71 _integration_point_writer.emplace_back(
72 std::make_unique<MeshLib::IntegrationPointWriter>(
73 "transport_porosity_ip", 1 /*n components*/, integration_order,
75
76 _integration_point_writer.emplace_back(
77 std::make_unique<MeshLib::IntegrationPointWriter>(
78 "swelling_stress_ip",
79 static_cast<int>(mesh.getDimension() == 2 ? 4 : 6) /*n components*/,
80 integration_order, _local_assemblers,
81 &LocalAssemblerIF::getSwellingStress));
82
83 _integration_point_writer.emplace_back(
84 std::make_unique<MeshLib::IntegrationPointWriter>(
85 "epsilon_ip",
86 static_cast<int>(mesh.getDimension() == 2 ? 4 : 6) /*n components*/,
87 integration_order, _local_assemblers,
88 &LocalAssemblerIF::getEpsilon));
89}
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition Mesh.h:88
std::string const name
Definition Process.h:351
std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > _integration_point_writer
Definition Process.h:377
Process(std::string name_, MeshLib::Mesh &mesh, std::unique_ptr< AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > &&process_variables, SecondaryVariableCollection &&secondary_variables, const bool use_monolithic_scheme=true)
Definition Process.cpp:28
std::vector< std::unique_ptr< LocalAssemblerIF > > _local_assemblers
RichardsMechanicsProcessData< DisplacementDim > _process_data
LocalAssemblerInterface< DisplacementDim > LocalAssemblerIF
virtual std::vector< double > getSaturation() const =0
virtual std::vector< double > getPorosity() const =0
virtual std::vector< double > getTransportPorosity() const =0

References ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::_hydraulic_flow, ProcessLib::Process::_integration_point_writer, ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::_local_assemblers, ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::_nodal_forces, MeshLib::Mesh::getDimension(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::getEpsilon(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::getPorosity(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::getSaturation(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::getSigma(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::getSwellingStress(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::getTransportPorosity(), and MeshLib::Node.

Member Function Documentation

◆ assembleConcreteProcess()

template<int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::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 )
overrideprivatevirtual

Implements ProcessLib::Process.

Definition at line 343 of file RichardsMechanicsProcess.cpp.

347{
348 DBUG("Assemble the equations for RichardsMechanics");
349
350 std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>>
351 dof_table = {std::ref(*_local_to_global_index_map)};
352 ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
353
354 // Call global assembler for each local assembly item.
357 pv.getActiveElementIDs(), dof_table, t, dt, x, x_prev, process_id, M, K,
358 b);
359}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
std::vector< std::size_t > const & getActiveElementIDs() const
std::vector< std::reference_wrapper< ProcessVariable > > const & getProcessVariables(const int process_id) const
Definition Process.h:155
VectorMatrixAssembler _global_assembler
Definition Process.h:364
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map
Definition Process.h:357
void assemble(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< std::reference_wrapper< NumLib::LocalToGlobalIndexMap > > 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)
static void executeSelectedMemberDereferenced(Object &object, Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)

References ProcessLib::VectorMatrixAssembler::assemble(), DBUG(), NumLib::SerialExecutor::executeSelectedMemberDereferenced(), and ProcessLib::ProcessVariable::getActiveElementIDs().

◆ assembleWithJacobianConcreteProcess()

template<int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::assembleWithJacobianConcreteProcess ( 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,
GlobalMatrix & Jac )
overrideprivatevirtual

Implements ProcessLib::Process.

Definition at line 362 of file RichardsMechanicsProcess.cpp.

367{
368 std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>>
369 dof_tables;
370 // For the monolithic scheme
372 {
373 DBUG(
374 "Assemble the Jacobian of RichardsMechanics for the monolithic"
375 " scheme.");
376 dof_tables.emplace_back(*_local_to_global_index_map);
377 }
378 else
379 {
380 // For the staggered scheme
381 if (process_id == 0)
382 {
383 DBUG(
384 "Assemble the Jacobian equations of liquid fluid process in "
385 "RichardsMechanics for the staggered scheme.");
386 }
387 else
388 {
389 DBUG(
390 "Assemble the Jacobian equations of mechanical process in "
391 "RichardsMechanics for the staggered scheme.");
392 }
393 dof_tables.emplace_back(*_local_to_global_index_map_with_base_nodes);
394 dof_tables.emplace_back(*_local_to_global_index_map);
395 }
396
397 ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
398
401 _local_assemblers, pv.getActiveElementIDs(), dof_tables, t, dt, x,
402 x_prev, process_id, M, K, b, Jac);
403
404 auto copyRhs = [&](int const variable_id, auto& output_vector)
405 {
407 {
408 transformVariableFromGlobalVector(b, variable_id, dof_tables[0],
409 output_vector,
410 std::negate<double>());
411 }
412 else
413 {
414 transformVariableFromGlobalVector(b, 0, dof_tables[process_id],
415 output_vector,
416 std::negate<double>());
417 }
418 };
419 if (_use_monolithic_scheme || process_id == 0)
420 {
421 copyRhs(0, *_hydraulic_flow);
422 }
423 if (_use_monolithic_scheme || process_id == 1)
424 {
425 copyRhs(1, *_nodal_forces);
426 }
427}
const bool _use_monolithic_scheme
Definition Process.h:366
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map_with_base_nodes
void assembleWithJacobian(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< std::reference_wrapper< NumLib::LocalToGlobalIndexMap > > const &dof_tables, 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, GlobalMatrix &Jac)
void transformVariableFromGlobalVector(GlobalVector const &input_vector, int const variable_id, NumLib::LocalToGlobalIndexMap const &local_to_global_index_map, MeshLib::PropertyVector< double > &output_vector, Functor map_function)

References ProcessLib::VectorMatrixAssembler::assembleWithJacobian(), DBUG(), NumLib::SerialExecutor::executeSelectedMemberDereferenced(), and ProcessLib::ProcessVariable::getActiveElementIDs().

◆ computeSecondaryVariableConcrete()

template<int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::computeSecondaryVariableConcrete ( double const t,
double const dt,
std::vector< GlobalVector * > const & x,
GlobalVector const & x_prev,
int const process_id )
overrideprivatevirtual

Reimplemented from ProcessLib::Process.

Definition at line 454 of file RichardsMechanicsProcess.cpp.

459{
460 if (process_id != 0)
461 {
462 return;
463 }
464
465 DBUG("Compute the secondary variables for RichardsMechanicsProcess.");
466
467 auto get_a_dof_table_func = [this](const int processe_id) -> auto&
468 {
469 return getDOFTable(processe_id);
470 };
471 ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
475 NumLib::getDOFTables(x.size(), get_a_dof_table_func), t, dt, x, x_prev,
476 process_id);
477}
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)
NumLib::LocalToGlobalIndexMap const & getDOFTable(const int process_id) const override
std::vector< NumLib::LocalToGlobalIndexMap const * > getDOFTables(int const number_of_processes, std::function< NumLib::LocalToGlobalIndexMap const &(const int)> get_single_dof_table)
static void executeSelectedMemberOnDereferenced(Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)

References DBUG(), NumLib::SerialExecutor::executeSelectedMemberOnDereferenced(), ProcessLib::ProcessVariable::getActiveElementIDs(), and NumLib::getDOFTables().

◆ constructDofTable()

template<int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::constructDofTable ( )
overrideprivatevirtual

This function is for general cases, in which all equations of the coupled processes have the same number of unknowns. For the general cases with the staggered scheme, all equations of the coupled processes share one DOF table hold by _local_to_global_index_map. Other cases can be considered by overloading this member function in the derived class.

Reimplemented from ProcessLib::Process.

Definition at line 118 of file RichardsMechanicsProcess.cpp.

119{
120 // Create single component dof in every of the mesh's nodes.
122 std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh.getNodes());
123 // Create single component dof in the mesh's base nodes.
126 std::make_unique<MeshLib::MeshSubset>(_mesh, _base_nodes);
127
128 // TODO move the two data members somewhere else.
129 // for extrapolation of secondary variables of stress or strain
130 std::vector<MeshLib::MeshSubset> all_mesh_subsets_single_component{
133 std::make_unique<NumLib::LocalToGlobalIndexMap>(
134 std::move(all_mesh_subsets_single_component),
135 // by location order is needed for output
137
139 {
140 // For pressure, which is the first
141 std::vector<MeshLib::MeshSubset> all_mesh_subsets{
143
144 // For displacement.
145 const int monolithic_process_id = 0;
146 std::generate_n(std::back_inserter(all_mesh_subsets),
147 getProcessVariables(monolithic_process_id)[1]
148 .get()
149 .getNumberOfGlobalComponents(),
150 [&]() { return *_mesh_subset_all_nodes; });
151
152 std::vector<int> const vec_n_components{1, DisplacementDim};
154 std::make_unique<NumLib::LocalToGlobalIndexMap>(
155 std::move(all_mesh_subsets), vec_n_components,
158 }
159 else
160 {
161 // For displacement equation.
162 const int process_id = 1;
163 std::vector<MeshLib::MeshSubset> all_mesh_subsets;
164 std::generate_n(std::back_inserter(all_mesh_subsets),
165 getProcessVariables(process_id)[0]
166 .get()
167 .getNumberOfGlobalComponents(),
168 [&]() { return *_mesh_subset_all_nodes; });
169
170 std::vector<int> const vec_n_components{DisplacementDim};
172 std::make_unique<NumLib::LocalToGlobalIndexMap>(
173 std::move(all_mesh_subsets), vec_n_components,
175
176 // For pressure equation.
177 // Collect the mesh subsets with base nodes in a vector.
178 std::vector<MeshLib::MeshSubset> all_mesh_subsets_base_nodes{
181 std::make_unique<NumLib::LocalToGlobalIndexMap>(
182 std::move(all_mesh_subsets_base_nodes),
183 // by location order is needed for output
185
188
191 }
192}
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
Definition Mesh.h:106
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition Mesh.h:109
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_all_nodes
Definition Process.h:355
MeshLib::Mesh & _mesh
Definition Process.h:354
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_base_nodes
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map_single_component
std::vector< Node * > getBaseNodes(std::vector< Element * > const &elements)
Definition Utils.h:26
@ 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.
auto & get(Tuples &... ts)
Definition Get.h:67

References NumLib::BY_LOCATION, NumLib::computeSparsityPattern(), and MeshLib::getBaseNodes().

◆ getDOFTable()

template<int DisplacementDim>
NumLib::LocalToGlobalIndexMap const & ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::getDOFTable ( const int process_id) const
overrideprivatevirtual

Reimplemented from ProcessLib::Process.

Definition at line 490 of file RichardsMechanicsProcess.cpp.

492{
493 if (hasMechanicalProcess(process_id))
494 {
496 }
497
498 // For the equation of pressure
500}

◆ getDOFTableForExtrapolatorData()

template<int DisplacementDim>
std::tuple< NumLib::LocalToGlobalIndexMap *, bool > ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::getDOFTableForExtrapolatorData ( ) const
overrideprivatevirtual

Get the address of a LocalToGlobalIndexMap, and the status of its memory. If the LocalToGlobalIndexMap is created as new in this function, the function also returns a true boolean value to let Extrapolator manage the memory by the address returned by this function.

Returns
Address of a LocalToGlobalIndexMap and its memory status.

Reimplemented from ProcessLib::Process.

Definition at line 481 of file RichardsMechanicsProcess.cpp.

482{
483 const bool manage_storage = false;
484 return std::make_tuple(_local_to_global_index_map_single_component.get(),
485 manage_storage);
486}

◆ getMatrixSpecifications()

template<int DisplacementDim>
MathLib::MatrixSpecifications ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::getMatrixSpecifications ( const int process_id) const
override

Get the size and the sparse pattern of the global matrix in order to create the global matrices and vectors for the system equations of this process.

Parameters
process_idProcess ID. If the monolithic scheme is applied, process_id = 0. For the staggered scheme, process_id = 0 represents the hydraulic (H) process, while process_id = 1 represents the mechanical (M) process.
Returns
Matrix specifications including size and sparse pattern.

Definition at line 99 of file RichardsMechanicsProcess.cpp.

101{
102 // For the monolithic scheme or the M process (deformation) in the staggered
103 // scheme.
104 if (_use_monolithic_scheme || process_id == 1)
105 {
106 auto const& l = *_local_to_global_index_map;
107 return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(),
108 &l.getGhostIndices(), &this->_sparsity_pattern};
109 }
110
111 // For staggered scheme and H process (pressure).
113 return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(),
114 &l.getGhostIndices(), &_sparsity_pattern_with_linear_element};
115}
GlobalSparsityPattern _sparsity_pattern
Definition Process.h:379

◆ hasMechanicalProcess()

template<int DisplacementDim>
bool ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::hasMechanicalProcess ( int const process_id) const
inlineprivate

Check whether the process represented by process_id is/has mechanical process. In the present implementation, the mechanical process has process_id == 1 in the staggered scheme.

Definition at line 134 of file RichardsMechanicsProcess.h.

135 {
136 return _use_monolithic_scheme || process_id == 1;
137 }

References ProcessLib::Process::_use_monolithic_scheme.

◆ initializeBoundaryConditions()

template<int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::initializeBoundaryConditions ( std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media)
overrideprivatevirtual

Member function to initialize the boundary conditions for all coupled processes. It is called by initialize().

Reimplemented from ProcessLib::Process.

Definition at line 293 of file RichardsMechanicsProcess.cpp.

295{
297 {
298 const int monolithic_process_id = 0;
300 *_local_to_global_index_map, monolithic_process_id, media);
301 return;
302 }
303
304 // Staggered scheme:
305 // for the equations of pressure
306 const int hydraulic_process_id = 0;
308 *_local_to_global_index_map_with_base_nodes, hydraulic_process_id,
309 media);
310
311 // for the equations of deformation.
312 const int mechanical_process_id = 1;
314 *_local_to_global_index_map, mechanical_process_id, media);
315}
void initializeProcessBoundaryConditionsAndSourceTerms(const NumLib::LocalToGlobalIndexMap &dof_table, const int process_id, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
Definition Process.cpp:73

◆ initializeConcreteProcess()

template<int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::initializeConcreteProcess ( NumLib::LocalToGlobalIndexMap const & dof_table,
MeshLib::Mesh const & mesh,
unsigned const integration_order )
overrideprivatevirtual

Process specific initialization called by initialize().

Implements ProcessLib::Process.

Definition at line 195 of file RichardsMechanicsProcess.cpp.

199{
201 RichardsMechanicsLocalAssembler>(
202 mesh.getElements(), dof_table, _local_assemblers,
203 NumLib::IntegrationOrder{integration_order}, mesh.isAxiallySymmetric(),
205
206 auto add_secondary_variable = [&](std::string const& name,
207 int const num_components,
208 auto get_ip_values_function)
209 {
211 name,
212 makeExtrapolator(num_components, getExtrapolator(),
214 std::move(get_ip_values_function)));
215 };
216
217 add_secondary_variable("sigma",
219 DisplacementDim>::RowsAtCompileTime,
221
222 add_secondary_variable("swelling_stress",
224 DisplacementDim>::RowsAtCompileTime,
226
227 add_secondary_variable("epsilon",
229 DisplacementDim>::RowsAtCompileTime,
231
232 add_secondary_variable("velocity", DisplacementDim,
234
235 add_secondary_variable("saturation", 1,
237
238 add_secondary_variable("micro_saturation", 1,
240
241 add_secondary_variable("micro_pressure", 1,
243
244 add_secondary_variable("porosity", 1, &LocalAssemblerIF::getIntPtPorosity);
245
246 add_secondary_variable("transport_porosity", 1,
248
249 add_secondary_variable("dry_density_solid", 1,
251
252 //
253 // enable output of internal variables defined by material models
254 //
256 LocalAssemblerIF>(_process_data.solid_materials,
257 add_secondary_variable);
258
261 _process_data.solid_materials, _local_assemblers,
262 _integration_point_writer, integration_order);
263
264 _process_data.element_saturation = MeshLib::getOrCreateMeshProperty<double>(
265 const_cast<MeshLib::Mesh&>(mesh), "saturation_avg",
267
268 _process_data.element_porosity = MeshLib::getOrCreateMeshProperty<double>(
269 const_cast<MeshLib::Mesh&>(mesh), "porosity_avg",
271
272 _process_data.element_stresses = MeshLib::getOrCreateMeshProperty<double>(
273 const_cast<MeshLib::Mesh&>(mesh), "stress_avg",
276 DisplacementDim>::RowsAtCompileTime);
277
278 _process_data.pressure_interpolated =
279 MeshLib::getOrCreateMeshProperty<double>(
280 const_cast<MeshLib::Mesh&>(mesh), "pressure_interpolated",
282
285
286 // Initialize local assemblers after all variables have been set.
290}
virtual void initialize(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
SecondaryVariableCollection _secondary_variables
Definition Process.h:359
NumLib::Extrapolator & getExtrapolator() const
Definition Process.h:196
void addSecondaryVariable(std::string const &internal_name, SecondaryVariableFunctions &&fcts)
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
void solidMaterialInternalVariablesToIntegrationPointWriter(std::map< int, std::unique_ptr< SolidMaterial > > const &solid_materials, std::vector< std::unique_ptr< LocalAssemblerInterface > > const &local_assemblers, std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > &integration_point_writer, int const integration_order)
void solidMaterialInternalToSecondaryVariables(std::map< int, std::unique_ptr< SolidMaterial > > const &solid_materials, AddSecondaryVariableCallback const &add_secondary_variable)
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 executeMemberOnDereferenced(Method method, Container const &container, Args &&... args)
virtual std::vector< double > const & getIntPtSaturation(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtDarcyVelocity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtSigma(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtDryDensitySolid(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtSwellingStress(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtTransportPorosity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtPorosity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtMicroSaturation(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtEpsilon(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtMicroPressure(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0

References MeshLib::Cell, ProcessLib::createLocalAssemblersHM(), NumLib::SerialExecutor::executeMemberOnDereferenced(), MeshLib::Mesh::getElements(), MeshLib::Mesh::getProperties(), MeshLib::Mesh::isAxiallySymmetric(), ProcessLib::makeExtrapolator(), MeshLib::Node, ProcessLib::setIPDataInitialConditions(), ProcessLib::Deformation::solidMaterialInternalToSecondaryVariables(), and ProcessLib::Deformation::solidMaterialInternalVariablesToIntegrationPointWriter().

◆ isLinear()

template<int DisplacementDim>
bool ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::isLinear ( ) const
override

Definition at line 92 of file RichardsMechanicsProcess.cpp.

93{
94 return false;
95}

◆ postTimestepConcreteProcess()

template<int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::postTimestepConcreteProcess ( std::vector< GlobalVector * > const & x,
std::vector< GlobalVector * > const & x_prev,
double const t,
double const dt,
const int process_id )
overrideprivatevirtual

Reimplemented from ProcessLib::Process.

Definition at line 430 of file RichardsMechanicsProcess.cpp.

434{
435 if (hasMechanicalProcess(process_id))
436 {
437 DBUG("PostTimestep RichardsMechanicsProcess.");
438
439 auto get_a_dof_table_func = [this](const int processe_id) -> auto&
440 {
441 return getDOFTable(processe_id);
442 };
444 getProcessVariables(process_id)[0];
448 NumLib::getDOFTables(x.size(), get_a_dof_table_func), x, x_prev, t,
449 dt, process_id);
450 }
451}
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)

References DBUG(), NumLib::SerialExecutor::executeSelectedMemberOnDereferenced(), ProcessLib::ProcessVariable::getActiveElementIDs(), and NumLib::getDOFTables().

◆ setInitialConditionsConcreteProcess()

template<int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::setInitialConditionsConcreteProcess ( std::vector< GlobalVector * > & x,
double const t,
int const process_id )
overrideprivatevirtual

Reimplemented from ProcessLib::Process.

Definition at line 318 of file RichardsMechanicsProcess.cpp.

322{
323 if (process_id != 0)
324 {
325 return;
326 }
327
328 DBUG("SetInitialConditions RichardsMechanicsProcess.");
329
330 ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
331
332 auto get_a_dof_table_func = [this](const int process_id) -> auto&
333 {
334 return getDOFTable(process_id);
335 };
339 NumLib::getDOFTables(x.size(), get_a_dof_table_func), x, t, process_id);
340}
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)

References DBUG(), NumLib::SerialExecutor::executeSelectedMemberOnDereferenced(), ProcessLib::ProcessVariable::getActiveElementIDs(), and NumLib::getDOFTables().

Member Data Documentation

◆ _base_nodes

template<int DisplacementDim>
std::vector<MeshLib::Node*> ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::_base_nodes
private

Definition at line 103 of file RichardsMechanicsProcess.h.

◆ _hydraulic_flow

template<int DisplacementDim>
MeshLib::PropertyVector<double>* ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::_hydraulic_flow = nullptr
private

◆ _local_assemblers

template<int DisplacementDim>
std::vector<std::unique_ptr<LocalAssemblerIF> > ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::_local_assemblers
private

◆ _local_to_global_index_map_single_component

template<int DisplacementDim>
std::unique_ptr<NumLib::LocalToGlobalIndexMap> ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::_local_to_global_index_map_single_component
private

Definition at line 110 of file RichardsMechanicsProcess.h.

◆ _local_to_global_index_map_with_base_nodes

template<int DisplacementDim>
std::unique_ptr<NumLib::LocalToGlobalIndexMap> ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::_local_to_global_index_map_with_base_nodes
private

Local to global index mapping for base nodes, which is used for linear interpolation for pressure in the staggered scheme.

Definition at line 115 of file RichardsMechanicsProcess.h.

◆ _mesh_subset_base_nodes

template<int DisplacementDim>
std::unique_ptr<MeshLib::MeshSubset const> ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::_mesh_subset_base_nodes
private

Definition at line 104 of file RichardsMechanicsProcess.h.

◆ _nodal_forces

template<int DisplacementDim>
MeshLib::PropertyVector<double>* ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::_nodal_forces = nullptr
private

◆ _process_data

template<int DisplacementDim>
RichardsMechanicsProcessData<DisplacementDim> ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::_process_data
private

Definition at line 105 of file RichardsMechanicsProcess.h.

◆ _sparsity_pattern_with_linear_element

template<int DisplacementDim>
GlobalSparsityPattern ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::_sparsity_pattern_with_linear_element
private

Sparsity pattern for the flow equation, and it is initialized only if the staggered scheme is used.

Definition at line 119 of file RichardsMechanicsProcess.h.


The documentation for this class was generated from the following files: