Loading [MathJax]/extensions/tex2jax.js
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 27 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, 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::vector< std::reference_wrapper< ProcessVariable > > > const & getProcessVariables () 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)
 
bool requiresNormalization () const override
 
- Public Member Functions inherited from ProcessLib::SubmeshAssemblySupport
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, GlobalVector &b, GlobalMatrix &Jac) override
 
void preTimestepConcreteProcess (std::vector< GlobalVector * > const &x, double const t, double const dt, const int process_id) 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
 
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 Member Functions inherited from ProcessLib::AssemblyMixin< RichardsMechanicsProcess< DisplacementDim > >
void initializeAssemblyOnSubmeshes (std::vector< std::reference_wrapper< MeshLib::Mesh > > const &submeshes, std::vector< std::vector< std::string > > const &residuum_names)
 
void updateActiveElements ()
 
void assemble (double const t, double const dt, std::vector< GlobalVector * > const &, std::vector< GlobalVector * > const &, int const process_id, GlobalMatrix &, GlobalMatrix &, GlobalVector &)
 
void assembleWithJacobian (double const t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalVector &b, GlobalMatrix &Jac)
 

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::LocalToGlobalIndexMaplocal_to_global_index_map_single_component_
 
std::unique_ptr< NumLib::LocalToGlobalIndexMaplocal_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
 

Friends

class AssemblyMixin< RichardsMechanicsProcess< DisplacementDim > >
 

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
std::vector< NumLib::LocalToGlobalIndexMap const * > getDOFTables (int const number_of_processes) const
 
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
 
CellAverageData cell_average_data_
 
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 71 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 31 of file RichardsMechanicsProcess.cpp.

42 : Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
43 integration_order, std::move(process_variables),
44 std::move(secondary_variables), use_monolithic_scheme),
45 AssemblyMixin<RichardsMechanicsProcess<DisplacementDim>>{
47 process_data_(std::move(process_data))
48{
50 mesh, "NodalForces", MeshLib::MeshItemType::Node, DisplacementDim);
51
53 mesh, "MassFlowRate", MeshLib::MeshItemType::Node, 1);
54
57 _integration_point_writer, integration_order,
59}
std::string const name
Definition Process.h:362
std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > _integration_point_writer
Definition Process.h:390
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > _jacobian_assembler
Definition Process.h:376
RichardsMechanicsProcessData< DisplacementDim > process_data_
std::vector< std::unique_ptr< LocalAssemblerIF > > local_assemblers_
PropertyVector< T > * getOrCreateMeshProperty(Mesh &mesh, std::string const &property_name, MeshItemType const item_type, int const number_of_components)
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)

References ProcessLib::Process::_jacobian_assembler.

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 275 of file RichardsMechanicsProcess.cpp.

279{
280 DBUG("Assemble the equations for RichardsMechanics");
281
282 AssemblyMixin<RichardsMechanicsProcess<DisplacementDim>>::assemble(
283 t, dt, x, x_prev, process_id, M, K, b);
284}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
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
Definition Process.cpp:265

References DBUG().

◆ 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,
GlobalVector & b,
GlobalMatrix & Jac )
overrideprivatevirtual

Implements ProcessLib::Process.

Definition at line 287 of file RichardsMechanicsProcess.cpp.

292{
293 // For the monolithic scheme
295 {
296 DBUG(
297 "Assemble the Jacobian of RichardsMechanics for the monolithic"
298 " scheme.");
299 }
300 else
301 {
302 // For the staggered scheme
303 if (process_id == 0)
304 {
305 DBUG(
306 "Assemble the Jacobian equations of liquid fluid process in "
307 "RichardsMechanics for the staggered scheme.");
308 }
309 else
310 {
311 DBUG(
312 "Assemble the Jacobian equations of mechanical process in "
313 "RichardsMechanics for the staggered scheme.");
314 }
315 }
316
317 auto const dof_tables = getDOFTables(x.size());
318 AssemblyMixin<RichardsMechanicsProcess<DisplacementDim>>::
319 assembleWithJacobian(t, dt, x, x_prev, process_id, b, Jac);
320
321 auto copyRhs = [&](int const variable_id, auto& output_vector)
322 {
324 {
325 transformVariableFromGlobalVector(b, variable_id, *dof_tables[0],
326 output_vector,
327 std::negate<double>());
328 }
329 else
330 {
331 transformVariableFromGlobalVector(b, 0, *dof_tables[process_id],
332 output_vector,
333 std::negate<double>());
334 }
335 };
336 if (_use_monolithic_scheme || process_id == 0)
337 {
338 copyRhs(0, *hydraulic_flow_);
339 }
340 if (_use_monolithic_scheme || process_id == 1)
341 {
342 copyRhs(1, *nodal_forces_);
343 }
344}
std::vector< NumLib::LocalToGlobalIndexMap const * > getDOFTables(int const number_of_processes) const
Definition Process.cpp:384
void assembleWithJacobian(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) final
Definition Process.cpp:286
const bool _use_monolithic_scheme
Definition Process.h:379
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 DBUG().

◆ 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 395 of file RichardsMechanicsProcess.cpp.

400{
401 if (process_id != 0)
402 {
403 return;
404 }
405
406 DBUG("Compute the secondary variables for RichardsMechanicsProcess.");
407
410 getActiveElementIDs(), getDOFTables(x.size()), t, dt, x, x_prev,
411 process_id);
412}
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)
std::vector< std::size_t > const & getActiveElementIDs() const
Definition Process.h:167
static void executeSelectedMemberOnDereferenced(Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)

References DBUG(), and NumLib::SerialExecutor::executeSelectedMemberOnDereferenced().

◆ 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 88 of file RichardsMechanicsProcess.cpp.

89{
90 // Create single component dof in every of the mesh's nodes.
92 std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh.getNodes());
93 // Create single component dof in the mesh's base nodes.
96 std::make_unique<MeshLib::MeshSubset>(_mesh, base_nodes_);
97
98 // TODO move the two data members somewhere else.
99 // for extrapolation of secondary variables of stress or strain
100 std::vector<MeshLib::MeshSubset> all_mesh_subsets_single_component{
103 std::make_unique<NumLib::LocalToGlobalIndexMap>(
104 std::move(all_mesh_subsets_single_component),
105 // by location order is needed for output
107
109 {
110 // For pressure, which is the first
111 std::vector<MeshLib::MeshSubset> all_mesh_subsets{
113
114 // For displacement.
115 const int monolithic_process_id = 0;
116 std::generate_n(std::back_inserter(all_mesh_subsets),
117 getProcessVariables(monolithic_process_id)[1]
118 .get()
119 .getNumberOfGlobalComponents(),
120 [&]() { return *_mesh_subset_all_nodes; });
121
122 std::vector<int> const vec_n_components{1, DisplacementDim};
124 std::make_unique<NumLib::LocalToGlobalIndexMap>(
125 std::move(all_mesh_subsets), vec_n_components,
128 }
129 else
130 {
131 // For displacement equation.
132 const int process_id = 1;
133 std::vector<MeshLib::MeshSubset> all_mesh_subsets;
134 std::generate_n(std::back_inserter(all_mesh_subsets),
135 getProcessVariables(process_id)[0]
136 .get()
137 .getNumberOfGlobalComponents(),
138 [&]() { return *_mesh_subset_all_nodes; });
139
140 std::vector<int> const vec_n_components{DisplacementDim};
142 std::make_unique<NumLib::LocalToGlobalIndexMap>(
143 std::move(all_mesh_subsets), vec_n_components,
145
146 // For pressure equation.
147 // Collect the mesh subsets with base nodes in a vector.
148 std::vector<MeshLib::MeshSubset> all_mesh_subsets_base_nodes{
151 std::make_unique<NumLib::LocalToGlobalIndexMap>(
152 std::move(all_mesh_subsets_base_nodes),
153 // by location order is needed for output
155
158
161 }
162}
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
Definition Mesh.h:108
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition Mesh.h:111
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_all_nodes
Definition Process.h:366
MeshLib::Mesh & _mesh
Definition Process.h:365
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map
Definition Process.h:368
std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > const & getProcessVariables() const
Definition Process.h:156
std::unique_ptr< NumLib::LocalToGlobalIndexMap > local_to_global_index_map_with_base_nodes_
std::unique_ptr< NumLib::LocalToGlobalIndexMap > local_to_global_index_map_single_component_
std::unique_ptr< MeshLib::MeshSubset const > mesh_subset_base_nodes_
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:59

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 425 of file RichardsMechanicsProcess.cpp.

427{
428 if (hasMechanicalProcess(process_id))
429 {
431 }
432
433 // For the equation of pressure
435}

◆ 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 416 of file RichardsMechanicsProcess.cpp.

417{
418 const bool manage_storage = false;
419 return std::make_tuple(local_to_global_index_map_single_component_.get(),
420 manage_storage);
421}

◆ 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 69 of file RichardsMechanicsProcess.cpp.

71{
72 // For the monolithic scheme or the M process (deformation) in the staggered
73 // scheme.
74 if (_use_monolithic_scheme || process_id == 1)
75 {
76 auto const& l = *_local_to_global_index_map;
77 return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(),
78 &l.getGhostIndices(), &this->_sparsity_pattern};
79 }
80
81 // For staggered scheme and H process (pressure).
83 return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(),
84 &l.getGhostIndices(), &sparsity_pattern_with_linear_element_};
85}
GlobalSparsityPattern _sparsity_pattern
Definition Process.h:392

◆ 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 147 of file RichardsMechanicsProcess.h.

148 {
149 return _use_monolithic_scheme || process_id == 1;
150 }

References ProcessLib::Process::_use_monolithic_scheme.

◆ initializeAssemblyOnSubmeshes()

template<int DisplacementDim>
std::vector< std::vector< std::string > > ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::initializeAssemblyOnSubmeshes ( std::vector< std::reference_wrapper< MeshLib::Mesh > > const & meshes)
overrideprivatevirtual

Initializes the assembly on submeshes

Parameters
meshesthe submeshes on whom the assembly shall proceed.
Attention
meshes must be a must be a non-overlapping cover of the entire simulation domain (bulk mesh)!
Returns
The names of the residuum vectors that will be assembled for each process: outer vector of size 1 for monolithic schemes and greater for staggered schemes.

Reimplemented from ProcessLib::SubmeshAssemblySupport.

Definition at line 381 of file RichardsMechanicsProcess.cpp.

383{
384 INFO("RichardsMechanics process initializeSubmeshOutput().");
385 std::vector<std::vector<std::string>> residuum_names{
386 {"MassFlowRate", "NodalForces"}};
387
388 AssemblyMixin<RichardsMechanicsProcess<DisplacementDim>>::
389 initializeAssemblyOnSubmeshes(meshes, residuum_names);
390
391 return residuum_names;
392}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:35
std::vector< std::vector< std::string > > initializeAssemblyOnSubmeshes(std::vector< std::reference_wrapper< MeshLib::Mesh > > const &meshes) override

References INFO().

◆ 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 232 of file RichardsMechanicsProcess.cpp.

234{
236 {
237 const int monolithic_process_id = 0;
239 *_local_to_global_index_map, monolithic_process_id, media);
240 return;
241 }
242
243 // Staggered scheme:
244 // for the equations of pressure
245 const int hydraulic_process_id = 0;
247 *local_to_global_index_map_with_base_nodes_, hydraulic_process_id,
248 media);
249
250 // for the equations of deformation.
251 const int mechanical_process_id = 1;
253 *_local_to_global_index_map, mechanical_process_id, media);
254}
void initializeProcessBoundaryConditionsAndSourceTerms(const NumLib::LocalToGlobalIndexMap &dof_table, const int process_id, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
Definition Process.cpp:90

◆ 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 165 of file RichardsMechanicsProcess.cpp.

169{
171 RichardsMechanicsLocalAssembler>(
172 mesh.getElements(), dof_table, local_assemblers_,
173 NumLib::IntegrationOrder{integration_order}, mesh.isAxiallySymmetric(),
175
179
180 auto add_secondary_variable = [&](std::string const& name,
181 int const num_components,
182 auto get_ip_values_function)
183 {
185 name,
186 makeExtrapolator(num_components, getExtrapolator(),
188 std::move(get_ip_values_function)));
189 };
190
191 //
192 // enable output of internal variables defined by material models
193 //
195 LocalAssemblerIF>(process_data_.solid_materials,
196 add_secondary_variable);
197
200 process_data_.solid_materials, local_assemblers_,
201 _integration_point_writer, integration_order);
202
204 const_cast<MeshLib::Mesh&>(mesh), "saturation_avg",
206
208 const_cast<MeshLib::Mesh&>(mesh), "porosity_avg",
210
212 const_cast<MeshLib::Mesh&>(mesh), "stress_avg",
215 DisplacementDim>::RowsAtCompileTime);
216
217 process_data_.pressure_interpolated =
219 const_cast<MeshLib::Mesh&>(mesh), "pressure_interpolated",
221
224
225 // Initialize local assemblers after all variables have been set.
229}
virtual void initialize(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
SecondaryVariableCollection _secondary_variables
Definition Process.h:370
NumLib::Extrapolator & getExtrapolator() const
Definition Process.h:208
LocalAssemblerInterface< DisplacementDim > LocalAssemblerIF
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::shared_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::shared_ptr< SolidMaterial > > const &solid_materials, AddSecondaryVariableCallback const &add_secondary_variable)
void addReflectedSecondaryVariables(ReflData const &reflection_data, SecondaryVariableCollection &secondary_variables, NumLib::Extrapolator &extrapolator, 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 executeMemberOnDereferenced(Method method, Container const &container, Args &&... args)

References ProcessLib::Reflection::addReflectedSecondaryVariables(), MeshLib::Cell, ProcessLib::createLocalAssemblersHM(), NumLib::SerialExecutor::executeMemberOnDereferenced(), MeshLib::Mesh::getElements(), MeshLib::getOrCreateMeshProperty(), 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 62 of file RichardsMechanicsProcess.cpp.

63{
64 return false;
65}

◆ 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 363 of file RichardsMechanicsProcess.cpp.

367{
368 if (hasMechanicalProcess(process_id))
369 {
370 DBUG("PostTimestep RichardsMechanicsProcess.");
371
374 getActiveElementIDs(), getDOFTables(x.size()), x, x_prev, t, dt,
375 process_id);
376 }
377}
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(), and NumLib::SerialExecutor::executeSelectedMemberOnDereferenced().

◆ preTimestepConcreteProcess()

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

Reimplemented from ProcessLib::Process.

Definition at line 347 of file RichardsMechanicsProcess.cpp.

350{
351 DBUG("PreTimestep RichardsMechanicsProcess.");
352
355 getActiveElementIDs(), *_local_to_global_index_map, *x[process_id], t,
356 dt);
357
358 AssemblyMixin<
360}
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)
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)

References DBUG(), and NumLib::SerialExecutor::executeSelectedMemberOnDereferenced().

◆ 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 257 of file RichardsMechanicsProcess.cpp.

261{
262 if (process_id != 0)
263 {
264 return;
265 }
266
267 DBUG("SetInitialConditions RichardsMechanicsProcess.");
268
271 getActiveElementIDs(), getDOFTables(x.size()), x, t, process_id);
272}
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(), and NumLib::SerialExecutor::executeSelectedMemberOnDereferenced().

Friends And Related Symbol Documentation

◆ AssemblyMixin< RichardsMechanicsProcess< DisplacementDim > >

template<int DisplacementDim>
friend class AssemblyMixin< RichardsMechanicsProcess< DisplacementDim > >
friend

Definition at line 157 of file RichardsMechanicsProcess.h.

Member Data Documentation

◆ base_nodes_

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

Definition at line 116 of file RichardsMechanicsProcess.h.

◆ hydraulic_flow_

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

Definition at line 153 of file RichardsMechanicsProcess.h.

◆ local_assemblers_

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

Definition at line 120 of file RichardsMechanicsProcess.h.

◆ 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 123 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 128 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 117 of file RichardsMechanicsProcess.h.

◆ nodal_forces_

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

Definition at line 152 of file RichardsMechanicsProcess.h.

◆ process_data_

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

Definition at line 118 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 132 of file RichardsMechanicsProcess.h.


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