OGS
ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim > Class Template Referencefinal

Detailed Description

template<int DisplacementDim>
class ProcessLib::HydroMechanics::HydroMechanicsProcess< 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 HydroMechanicsProcess.h.

#include <HydroMechanicsProcess.h>

Inheritance diagram for ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >:
[legend]
Collaboration diagram for ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >:
[legend]

Public Member Functions

 HydroMechanicsProcess (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, HydroMechanicsProcessData< 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 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 assembleConcreteProcess (const double t, double const, 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, 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 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, const double t, const double dt, int const process_id) override
 
void postNonLinearSolverConcreteProcess (std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, const double t, double const dt, int const process_id) override
 
void setInitialConditionsConcreteProcess (std::vector< GlobalVector * > &x, double const t, int const process_id) override
 
NumLib::LocalToGlobalIndexMap const & getDOFTable (const int process_id) const override
 
bool isMonolithicSchemeUsed () const override
 
void computeSecondaryVariableConcrete (double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, const int 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
 
HydroMechanicsProcessData< 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
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::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::LocalAssemblerIF = LocalAssemblerInterface<DisplacementDim>
private

Definition at line 65 of file HydroMechanicsProcess.h.

Constructor & Destructor Documentation

◆ HydroMechanicsProcess()

template<int DisplacementDim>
ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::HydroMechanicsProcess ( 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,
HydroMechanicsProcessData< DisplacementDim > && process_data,
SecondaryVariableCollection && secondary_variables,
bool const use_monolithic_scheme )

Definition at line 30 of file HydroMechanicsProcess.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 _integration_point_writer.emplace_back(
53 std::make_unique<MeshLib::IntegrationPointWriter>(
54 "sigma_ip",
55 static_cast<int>(mesh.getDimension() == 2 ? 4 : 6) /*n components*/,
56 integration_order, _local_assemblers, &LocalAssemblerIF::getSigma));
57
58 _integration_point_writer.emplace_back(
59 std::make_unique<MeshLib::IntegrationPointWriter>(
60 "epsilon_ip",
61 static_cast<int>(mesh.getDimension() == 2 ? 4 : 6) /*n components*/,
62 integration_order, _local_assemblers,
63 &LocalAssemblerIF::getEpsilon));
64
66 {
67 _integration_point_writer.emplace_back(
68 std::make_unique<MeshLib::IntegrationPointWriter>(
69 "strain_rate_variable_ip", 1, integration_order,
71 }
72}
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition Mesh.h:88
HydroMechanicsProcessData< DisplacementDim > _process_data
std::vector< std::unique_ptr< LocalAssemblerIF > > _local_assemblers
LocalAssemblerInterface< DisplacementDim > LocalAssemblerIF
MeshLib::PropertyVector< double > * _hydraulic_flow
std::string const name
Definition Process.h:355
std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > _integration_point_writer
Definition Process.h:383
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:44
const bool _use_monolithic_scheme
Definition Process.h:372
virtual std::vector< double > getStrainRateVariable() const =0

References ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::_hydraulic_flow, ProcessLib::Process::_integration_point_writer, ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::_local_assemblers, ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::_nodal_forces, ProcessLib::Process::_use_monolithic_scheme, MeshLib::Mesh::getDimension(), ProcessLib::HydroMechanics::LocalAssemblerInterface< DisplacementDim >::getEpsilon(), ProcessLib::HydroMechanics::LocalAssemblerInterface< DisplacementDim >::getSigma(), ProcessLib::HydroMechanics::LocalAssemblerInterface< DisplacementDim >::getStrainRateVariable(), and MeshLib::Node.

Member Function Documentation

◆ assembleConcreteProcess()

template<int DisplacementDim>
void ProcessLib::HydroMechanics::HydroMechanicsProcess< 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 286 of file HydroMechanicsProcess.cpp.

290{
291 DBUG("Assemble the equations for HydroMechanics");
292
293 // Note: This assembly function is for the Picard nonlinear solver. Since
294 // only the Newton-Raphson method is employed to simulate coupled HM
295 // processes in this class, this function is actually not used so far.
296
297 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
299
302 getActiveElementIDs(), dof_table, t, dt, x, x_prev, process_id, M, K,
303 b);
304}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
std::vector< std::size_t > const & getActiveElementIDs() const
Definition Process.h:161
VectorMatrixAssembler _global_assembler
Definition Process.h:370
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map
Definition Process.h:361
void assemble(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b)
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(), and NumLib::SerialExecutor::executeSelectedMemberDereferenced().

◆ assembleWithJacobianConcreteProcess()

template<int DisplacementDim>
void ProcessLib::HydroMechanics::HydroMechanicsProcess< 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 307 of file HydroMechanicsProcess.cpp.

312{
313 // For the monolithic scheme
314 bool const use_monolithic_scheme = _process_data.isMonolithicSchemeUsed();
315 if (use_monolithic_scheme)
316 {
317 DBUG(
318 "Assemble the Jacobian of HydroMechanics for the monolithic "
319 "scheme.");
320 }
321 else
322 {
323 // For the staggered scheme
324 if (process_id == _process_data.hydraulic_process_id)
325 {
326 DBUG(
327 "Assemble the Jacobian equations of liquid fluid process in "
328 "HydroMechanics for the staggered scheme.");
329 }
330 else
331 {
332 DBUG(
333 "Assemble the Jacobian equations of mechanical process in "
334 "HydroMechanics for the staggered scheme.");
335 }
336 }
337
338 auto const dof_tables = getDOFTables(x.size());
341 _local_assemblers, getActiveElementIDs(), dof_tables, t, dt, x, x_prev,
342 process_id, M, K, b, Jac);
343
344 auto copyRhs = [&](int const variable_id, auto& output_vector)
345 {
346 if (use_monolithic_scheme)
347 {
348 transformVariableFromGlobalVector(b, variable_id, *dof_tables[0],
349 output_vector,
350 std::negate<double>());
351 }
352 else
353 {
354 transformVariableFromGlobalVector(b, 0, *dof_tables[process_id],
355 output_vector,
356 std::negate<double>());
357 }
358 };
359 if (process_id == _process_data.hydraulic_process_id)
360 {
361 copyRhs(0, *_hydraulic_flow);
362 }
363 if (process_id == _process_data.mechanics_related_process_id)
364 {
365 copyRhs(1, *_nodal_forces);
366 }
367}
std::vector< NumLib::LocalToGlobalIndexMap const * > getDOFTables(int const number_of_processes) const
Definition Process.cpp:387
void assembleWithJacobian(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, 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(), and NumLib::SerialExecutor::executeSelectedMemberDereferenced().

◆ computeSecondaryVariableConcrete()

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

Reimplemented from ProcessLib::Process.

Definition at line 439 of file HydroMechanicsProcess.cpp.

442{
443 if (process_id != _process_data.hydraulic_process_id)
444 {
445 return;
446 }
447
448 DBUG("Compute the secondary variables for HydroMechanicsProcess.");
449
452 getActiveElementIDs(), getDOFTables(x.size()), t, dt, x, x_prev,
453 process_id);
454}
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)
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::HydroMechanics::HydroMechanicsProcess< 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 101 of file HydroMechanicsProcess.cpp.

102{
103 // Create single component dof in every of the mesh's nodes.
104 _mesh_subset_all_nodes = std::make_unique<MeshLib::MeshSubset>(
105 _mesh, _mesh.getNodes(), _process_data.use_taylor_hood_elements);
106
107 // Create single component dof in the mesh's base nodes.
109 _mesh_subset_base_nodes = std::make_unique<MeshLib::MeshSubset>(
110 _mesh, _base_nodes, _process_data.use_taylor_hood_elements);
111
112 // TODO move the two data members somewhere else.
113 // for extrapolation of secondary variables of stress or strain
114 std::vector<MeshLib::MeshSubset> all_mesh_subsets_single_component{
117 std::make_unique<NumLib::LocalToGlobalIndexMap>(
118 std::move(all_mesh_subsets_single_component),
119 // by location order is needed for output
121
122 if (_process_data.isMonolithicSchemeUsed())
123 {
124 // For pressure, which is the first
125 std::vector<MeshLib::MeshSubset> all_mesh_subsets{
127
128 // For displacement.
129 const int monolithic_process_id = 0;
130 std::generate_n(std::back_inserter(all_mesh_subsets),
131 getProcessVariables(monolithic_process_id)[1]
132 .get()
133 .getNumberOfGlobalComponents(),
134 [&]() { return *_mesh_subset_all_nodes; });
135
136 std::vector<int> const vec_n_components{1, DisplacementDim};
138 std::make_unique<NumLib::LocalToGlobalIndexMap>(
139 std::move(all_mesh_subsets), vec_n_components,
142 }
143 else
144 {
145 // For displacement equation.
146 const int process_id = 1;
147 std::vector<MeshLib::MeshSubset> all_mesh_subsets;
148 std::generate_n(std::back_inserter(all_mesh_subsets),
149 getProcessVariables(process_id)[0]
150 .get()
151 .getNumberOfGlobalComponents(),
152 [&]() { return *_mesh_subset_all_nodes; });
153
154 std::vector<int> const vec_n_components{DisplacementDim};
156 std::make_unique<NumLib::LocalToGlobalIndexMap>(
157 std::move(all_mesh_subsets), vec_n_components,
159
160 // For pressure equation.
161 // Collect the mesh subsets with base nodes in a vector.
162 std::vector<MeshLib::MeshSubset> all_mesh_subsets_base_nodes{
165 std::make_unique<NumLib::LocalToGlobalIndexMap>(
166 std::move(all_mesh_subsets_base_nodes),
167 // by location order is needed for output
169
172
175 }
176}
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_base_nodes
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
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_all_nodes
Definition Process.h:359
MeshLib::Mesh & _mesh
Definition Process.h:358
std::vector< std::reference_wrapper< ProcessVariable > > const & getProcessVariables(const int process_id) const
Definition Process.h:156
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::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::getDOFTable ( const int process_id) const
overrideprivatevirtual

Reimplemented from ProcessLib::Process.

Definition at line 467 of file HydroMechanicsProcess.cpp.

468{
469 if (hasMechanicalProcess(process_id))
470 {
472 }
473
474 // For the equation of pressure
476}

◆ getDOFTableForExtrapolatorData()

template<int DisplacementDim>
std::tuple< NumLib::LocalToGlobalIndexMap *, bool > ProcessLib::HydroMechanics::HydroMechanicsProcess< 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 458 of file HydroMechanicsProcess.cpp.

459{
460 const bool manage_storage = false;
461 return std::make_tuple(_local_to_global_index_map_single_component.get(),
462 manage_storage);
463}

◆ getMatrixSpecifications()

template<int DisplacementDim>
MathLib::MatrixSpecifications ProcessLib::HydroMechanics::HydroMechanicsProcess< 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 82 of file HydroMechanicsProcess.cpp.

84{
85 // For the monolithic scheme or the M process (deformation) in the staggered
86 // scheme.
87 if (process_id == _process_data.mechanics_related_process_id)
88 {
89 auto const& l = *_local_to_global_index_map;
90 return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(),
91 &l.getGhostIndices(), &this->_sparsity_pattern};
92 }
93
94 // For staggered scheme and H process (pressure).
96 return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(),
97 &l.getGhostIndices(), &_sparsity_pattern_with_linear_element};
98}
GlobalSparsityPattern _sparsity_pattern
Definition Process.h:385

◆ hasMechanicalProcess()

template<int DisplacementDim>
bool ProcessLib::HydroMechanics::HydroMechanicsProcess< 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 149 of file HydroMechanicsProcess.h.

150 {
151 return process_id == _process_data.mechanics_related_process_id;
152 }

References ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::_process_data.

◆ initializeBoundaryConditions()

template<int DisplacementDim>
void ProcessLib::HydroMechanics::HydroMechanicsProcess< 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 261 of file HydroMechanicsProcess.cpp.

263{
264 if (_process_data.isMonolithicSchemeUsed())
265 {
266 const int process_id_of_hydromechanics = 0;
268 *_local_to_global_index_map, process_id_of_hydromechanics, media);
269 return;
270 }
271
272 // Staggered scheme:
273 // for the equations of pressure
274 const int hydraulic_process_id = 0;
276 *_local_to_global_index_map_with_base_nodes, hydraulic_process_id,
277 media);
278
279 // for the equations of deformation.
280 const int mechanical_process_id = 1;
282 *_local_to_global_index_map, mechanical_process_id, media);
283}
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::HydroMechanics::HydroMechanicsProcess< 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 179 of file HydroMechanicsProcess.cpp.

183{
185 HydroMechanicsLocalAssembler>(
186 mesh.getElements(), dof_table, _local_assemblers,
187 NumLib::IntegrationOrder{integration_order}, mesh.isAxiallySymmetric(),
189
190 auto add_secondary_variable = [&](std::string const& name,
191 int const num_components,
192 auto get_ip_values_function)
193 {
195 name,
196 makeExtrapolator(num_components, getExtrapolator(),
198 std::move(get_ip_values_function)));
199 };
200
201 add_secondary_variable("sigma",
203 DisplacementDim>::RowsAtCompileTime,
205
206 add_secondary_variable("epsilon",
208 DisplacementDim>::RowsAtCompileTime,
210
211 add_secondary_variable("velocity", DisplacementDim,
213
214 //
215 // enable output of internal variables defined by material models
216 //
218 LocalAssemblerIF>(_process_data.solid_materials,
219 add_secondary_variable);
220
221 _process_data.pressure_interpolated =
222 MeshLib::getOrCreateMeshProperty<double>(
223 const_cast<MeshLib::Mesh&>(mesh), "pressure_interpolated",
225
226 _process_data.principal_stress_vector[0] =
227 MeshLib::getOrCreateMeshProperty<double>(
228 const_cast<MeshLib::Mesh&>(mesh), "principal_stress_vector_1",
230
231 _process_data.principal_stress_vector[1] =
232 MeshLib::getOrCreateMeshProperty<double>(
233 const_cast<MeshLib::Mesh&>(mesh), "principal_stress_vector_2",
235
236 _process_data.principal_stress_vector[2] =
237 MeshLib::getOrCreateMeshProperty<double>(
238 const_cast<MeshLib::Mesh&>(mesh), "principal_stress_vector_3",
240
241 _process_data.principal_stress_values =
242 MeshLib::getOrCreateMeshProperty<double>(
243 const_cast<MeshLib::Mesh&>(mesh), "principal_stress_values",
245
246 _process_data.permeability = MeshLib::getOrCreateMeshProperty<double>(
247 const_cast<MeshLib::Mesh&>(mesh), "permeability",
250
253
254 // Initialize local assemblers after all variables have been set.
258}
virtual void initialize(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
SecondaryVariableCollection _secondary_variables
Definition Process.h:363
NumLib::Extrapolator & getExtrapolator() const
Definition Process.h:200
void addSecondaryVariable(std::string const &internal_name, SecondaryVariableFunctions &&fcts)
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
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 & 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 & 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 & getIntPtEpsilon(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(), MathLib::KelvinVector::kelvin_vector_dimensions(), ProcessLib::makeExtrapolator(), MeshLib::Node, ProcessLib::setIPDataInitialConditions(), and ProcessLib::Deformation::solidMaterialInternalToSecondaryVariables().

◆ isLinear()

template<int DisplacementDim>
bool ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::isLinear ( ) const
override

Definition at line 75 of file HydroMechanicsProcess.cpp.

76{
77 return false;
78}

◆ isMonolithicSchemeUsed()

template<int DisplacementDim>
bool ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::isMonolithicSchemeUsed ( ) const
inlineoverrideprivatevirtual

Reimplemented from ProcessLib::Process.

Definition at line 112 of file HydroMechanicsProcess.h.

113 {
114 return _process_data.isMonolithicSchemeUsed();
115 }

References ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::_process_data.

◆ postNonLinearSolverConcreteProcess()

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

Reimplemented from ProcessLib::Process.

Definition at line 405 of file HydroMechanicsProcess.cpp.

409{
410 DBUG("PostNonLinearSolver HydroMechanicsProcess.");
411
412 // Calculate strain, stress or other internal variables of mechanics.
415 getActiveElementIDs(), getDOFTables(x.size()), x, x_prev, t, dt,
416 process_id);
417}
void postNonLinearSolver(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().

◆ postTimestepConcreteProcess()

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

Reimplemented from ProcessLib::Process.

Definition at line 386 of file HydroMechanicsProcess.cpp.

390{
391 if (process_id != _process_data.hydraulic_process_id)
392 {
393 return;
394 }
395
396 DBUG("PostTimestep HydroMechanicsProcess.");
397
400 getActiveElementIDs(), getDOFTables(x.size()), x, x_prev, t, dt,
401 process_id);
402}
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::HydroMechanics::HydroMechanicsProcess< 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 370 of file HydroMechanicsProcess.cpp.

373{
374 DBUG("PreTimestep HydroMechanicsProcess.");
375
376 if (hasMechanicalProcess(process_id))
377 {
381 t, dt);
382 }
383}
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)

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

◆ setInitialConditionsConcreteProcess()

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

Reimplemented from ProcessLib::Process.

Definition at line 420 of file HydroMechanicsProcess.cpp.

424{
425 // So far, this function only sets the initial stress using the input data.
426 if (process_id != _process_data.mechanics_related_process_id)
427 {
428 return;
429 }
430
431 DBUG("Set initial conditions of HydroMechanicsProcess.");
432
435 getActiveElementIDs(), getDOFTables(x.size()), x, t, process_id);
436}
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().

Member Data Documentation

◆ _base_nodes

template<int DisplacementDim>
std::vector<MeshLib::Node*> ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::_base_nodes
private

Definition at line 118 of file HydroMechanicsProcess.h.

◆ _hydraulic_flow

template<int DisplacementDim>
MeshLib::PropertyVector<double>* ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::_hydraulic_flow = nullptr
private

◆ _local_assemblers

template<int DisplacementDim>
std::vector<std::unique_ptr<LocalAssemblerIF> > ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::_local_assemblers
private

◆ _local_to_global_index_map_single_component

template<int DisplacementDim>
std::unique_ptr<NumLib::LocalToGlobalIndexMap> ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::_local_to_global_index_map_single_component
private

Definition at line 125 of file HydroMechanicsProcess.h.

◆ _local_to_global_index_map_with_base_nodes

template<int DisplacementDim>
std::unique_ptr<NumLib::LocalToGlobalIndexMap> ProcessLib::HydroMechanics::HydroMechanicsProcess< 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 130 of file HydroMechanicsProcess.h.

◆ _mesh_subset_base_nodes

template<int DisplacementDim>
std::unique_ptr<MeshLib::MeshSubset const> ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::_mesh_subset_base_nodes
private

Definition at line 119 of file HydroMechanicsProcess.h.

◆ _nodal_forces

template<int DisplacementDim>
MeshLib::PropertyVector<double>* ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::_nodal_forces = nullptr
private

◆ _process_data

◆ _sparsity_pattern_with_linear_element

template<int DisplacementDim>
GlobalSparsityPattern ProcessLib::HydroMechanics::HydroMechanicsProcess< 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 134 of file HydroMechanicsProcess.h.


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