OGS
TH2MProcess.h
Go to the documentation of this file.
1
11#pragma once
12
15#include "ProcessLib/Process.h"
16#include "TH2MProcessData.h"
17
18namespace ProcessLib
19{
20namespace TH2M
21{
22template <int DisplacementDim>
23struct LocalAssemblerInterface;
24
27template <int DisplacementDim>
28class TH2MProcess final : public Process,
29 private AssemblyMixin<TH2MProcess<DisplacementDim>>
30{
31 friend class AssemblyMixin<TH2MProcess<DisplacementDim>>;
32
33public:
35 std::string name,
36 MeshLib::Mesh& mesh,
37 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&&
38 jacobian_assembler,
39 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const&
40 parameters,
41 unsigned const integration_order,
42 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
43 process_variables,
45 SecondaryVariableCollection&& secondary_variables,
46 bool const use_monolithic_scheme);
47
50
51 bool isLinear() const override;
53
67 const int process_id) const override;
68
69private:
70 void constructDofTable() override;
71
73 NumLib::LocalToGlobalIndexMap const& dof_table,
74 MeshLib::Mesh const& mesh,
75 unsigned const integration_order) override;
76
78 std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const&
79 media) override;
80
81 void setInitialConditionsConcreteProcess(std::vector<GlobalVector*>& x,
82 double const t,
83 int const process_id) override;
84
85 void assembleConcreteProcess(const double t, double const dt,
86 std::vector<GlobalVector*> const& x,
87 std::vector<GlobalVector*> const& x_prev,
88 int const process_id, GlobalMatrix& M,
89 GlobalMatrix& K, GlobalVector& b) override;
90
92 const double t, double const dt, std::vector<GlobalVector*> const& x,
93 std::vector<GlobalVector*> const& x_prev, int const process_id,
95 GlobalMatrix& Jac) override;
96
97 void preTimestepConcreteProcess(std::vector<GlobalVector*> const& x,
98 double const t, double const dt,
99 const int process_id) override;
100
101 void postTimestepConcreteProcess(std::vector<GlobalVector*> const& x,
102 std::vector<GlobalVector*> const& x_prev,
103 const double t, const double dt,
104 int const /*process_id*/) override;
105
107 const int process_id) const override;
108
109 std::vector<std::string> initializeAssemblyOnSubmeshes(
110 std::vector<std::reference_wrapper<MeshLib::Mesh>> const& meshes)
111 override;
112
113private:
114 std::vector<MeshLib::Node*> _base_nodes;
115 std::unique_ptr<MeshLib::MeshSubset const> _mesh_subset_base_nodes;
117
118 std::vector<std::unique_ptr<LocalAssemblerInterface<DisplacementDim>>>
120
121 std::unique_ptr<NumLib::LocalToGlobalIndexMap>
123
126 std::unique_ptr<NumLib::LocalToGlobalIndexMap>
128
132
133 void computeSecondaryVariableConcrete(double const t, double const dt,
134 std::vector<GlobalVector*> const& x,
135 GlobalVector const& x_prev,
136 const int process_id) override;
140 std::tuple<NumLib::LocalToGlobalIndexMap*, bool>
141 getDOFTableForExtrapolatorData() const override;
142
146 bool hasMechanicalProcess(int const process_id) const
147 {
148 return _use_monolithic_scheme || process_id == deformation_process_id;
149 }
150
151 static constexpr int monolithic_process_id = 0;
152 static constexpr int deformation_process_id = 3;
153
154 // number of per_process_variable_components
155 static constexpr int n_gas_pressure_components = 1;
156 static constexpr int n_capillary_pressure_components = 1;
157 static constexpr int n_temperature_components = 1;
158 static constexpr int n_displacement_components = DisplacementDim;
159};
160
161extern template class TH2MProcess<2>;
162extern template class TH2MProcess<3>;
163
164} // namespace TH2M
165} // namespace ProcessLib
MathLib::SparsityPattern< GlobalIndexType > GlobalSparsityPattern
Global vector based on Eigen vector.
Definition EigenVector.h:25
std::string const name
Definition Process.h:355
const bool _use_monolithic_scheme
Definition Process.h:372
Handles configuration of several secondary variables from the project file.
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map_single_component
static constexpr int monolithic_process_id
void postTimestepConcreteProcess(std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, const double t, const double dt, int const) override
bool isLinear() const override
std::tuple< NumLib::LocalToGlobalIndexMap *, bool > getDOFTableForExtrapolatorData() const override
void setInitialConditionsConcreteProcess(std::vector< GlobalVector * > &x, double const t, int const process_id) override
bool hasMechanicalProcess(int const process_id) const
TH2MProcess(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, TH2MProcessData< DisplacementDim > &&process_data, SecondaryVariableCollection &&secondary_variables, bool const use_monolithic_scheme)
std::vector< std::string > initializeAssemblyOnSubmeshes(std::vector< std::reference_wrapper< MeshLib::Mesh > > const &meshes) override
static constexpr int n_temperature_components
void preTimestepConcreteProcess(std::vector< GlobalVector * > const &x, double const t, double const dt, const int process_id) override
MathLib::MatrixSpecifications getMatrixSpecifications(const int process_id) const override
void initializeBoundaryConditions(std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media) override
static constexpr int n_displacement_components
TH2MProcessData< DisplacementDim > _process_data
GlobalSparsityPattern _sparsity_pattern_with_linear_element
std::vector< MeshLib::Node * > _base_nodes
void computeSecondaryVariableConcrete(double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, const int 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
static constexpr int n_gas_pressure_components
void constructDofTable() override
NumLib::LocalToGlobalIndexMap const & getDOFTable(const int process_id) const override
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map_with_base_nodes
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_base_nodes
static constexpr int n_capillary_pressure_components
void initializeConcreteProcess(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order) override
Process specific initialization called by initialize().
static constexpr int deformation_process_id
std::vector< std::unique_ptr< LocalAssemblerInterface< DisplacementDim > > > local_assemblers_