25std::unique_ptr<ConstitutiveRelations::PhaseTransitionModel>
27 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
36 const bool phase_transition =
39 .numberOfComponents() > 1) &&
42 .numberOfComponents() > 1);
47 return std::make_unique<ConstitutiveRelations::PhaseTransition>(media);
49 return std::make_unique<ConstitutiveRelations::NoPhaseTransition>(media);
52template <
int DisplacementDim>
55 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
56 std::vector<ProcessVariable>
const& variables,
57 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
58 std::optional<ParameterLib::CoordinateSystem>
const&
59 local_coordinate_system,
61 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
65 DBUG(
"Create TH2M Process.");
68 auto const coupling_scheme =
71 const bool use_monolithic_scheme =
72 !(coupling_scheme && (*coupling_scheme ==
"staggered"));
83 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
85 if (use_monolithic_scheme)
99 variable_pGR = &per_process_variables[0].get();
100 variable_pCap = &per_process_variables[1].get();
101 variable_T = &per_process_variables[2].get();
102 variable_u = &per_process_variables[3].get();
103 process_variables.push_back(std::move(per_process_variables));
107 OGS_FATAL(
"A Staggered version of TH2M is not implemented.");
109 using namespace std::string_literals;
110 for (
auto const& variable_name :
111 {
"gas_pressure"s,
"capillary_pressure"s,
"temperature"s,
114 auto per_process_variables =
116 process_variables.push_back(std::move(per_process_variables));
118 variable_pGR = &process_variables[0][0].get();
119 variable_pCap = &process_variables[1][0].get();
120 variable_T = &process_variables[2][0].get();
121 variable_u = &process_variables[3][0].get();
124 DBUG(
"Associate displacement with process variable '{:s}'.",
130 "Number of components of the process variable '{:s}' is different "
131 "from the displacement dimension: got {:d}, expected {:d}",
137 DBUG(
"Associate gas pressure with process variable '{:s}'.",
142 "Gas pressure process variable '{:s}' is not a scalar variable but "
149 DBUG(
"Associate capillary pressure with process variable '{:s}'.",
154 "Capillary pressure process variable '{:s}' is not a scalar "
161 DBUG(
"Associate temperature with process variable '{:s}'.",
166 "temperature process variable '{:s}' is not a scalar variable but "
167 "has {:d} components.",
173 auto solid_constitutive_relations =
175 parameters, local_coordinate_system, materialIDs(mesh), config);
181 "reference_temperature", parameters, 1, &mesh);
182 DBUG(
"Use '{:s}' as reference temperature parameter.",
183 reference_temperature.name);
186 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
188 std::vector<double>
const b =
191 "specific_body_force");
192 if (b.size() != DisplacementDim)
195 "The size of the specific body force vector does not match the "
196 "displacement dimension. Vector size is {:d}, displacement "
198 b.size(), DisplacementDim);
201 std::copy_n(b.data(), b.size(), specific_body_force.data());
206 config, parameters, mesh);
208 auto const mass_lumping =
211 auto const is_linear =
220 const bool use_TaylorHood_elements =
225 bool const initialize_porosity_from_medium_property =
232 std::move(media_map),
233 std::move(solid_constitutive_relations),
234 std::move(phase_transition_model),
235 reference_temperature,
236 std::move(initial_stress),
239 use_TaylorHood_elements,
241 initialize_porosity_from_medium_property}};
247 return std::make_unique<TH2MProcess<DisplacementDim>>(
248 std::move(name), mesh, std::move(jacobian_assembler), parameters,
249 integration_order, std::move(process_variables),
250 std::move(process_data), std::move(secondary_variables),
251 use_monolithic_scheme, is_linear);
255 std::string
const& name,
257 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
258 std::vector<ProcessVariable>
const& variables,
259 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
260 std::optional<ParameterLib::CoordinateSystem>
const&
261 local_coordinate_system,
262 unsigned const integration_order,
264 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media);
267 std::string
const& name,
269 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
270 std::vector<ProcessVariable>
const& variables,
271 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
272 std::optional<ParameterLib::CoordinateSystem>
const&
273 local_coordinate_system,
274 unsigned const integration_order,
276 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media);
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
std::optional< T > getConfigParameterOptional(std::string const ¶m) const
T getConfigParameter(std::string const ¶m) const
ConfigTree getConfigSubtree(std::string const &root) const
void checkConfigParameter(std::string const ¶m, std::string_view const value) const
unsigned getShapeFunctionOrder() const
std::string const & getName() const
int getNumberOfGlobalComponents() const
Returns the number of components of the process variable.
Handles configuration of several secondary variables from the project file.
std::map< int, std::shared_ptr< MaterialLib::Solids::MechanicsBase< DisplacementDim > > > createConstitutiveRelations(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, MeshLib::PropertyVector< int > const *const material_ids, BaseLib::ConfigTree const &config)
MaterialSpatialDistributionMap createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium > > const &media, MeshLib::Mesh const &mesh)
OGS_NO_DANGLING Parameter< ParameterDataType > & findParameter(std::string const ¶meter_name, std::vector< std::unique_ptr< ParameterBase > > const ¶meters, int const num_components, MeshLib::Mesh const *const mesh=nullptr)
template std::unique_ptr< Process > createTH2MProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createTH2MProcess< 2 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< ConstitutiveRelations::PhaseTransitionModel > createPhaseTransitionModel(std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
BaseLib::StrongType< bool, struct InitializePorosityFromMediumPropertyTag > InitializePorosityFromMediumProperty
A type helping to avoid confusion of different boolean values.
std::unique_ptr< Process > createTH2MProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::vector< std::reference_wrapper< ProcessVariable > > findProcessVariables(std::vector< ProcessVariable > const &variables, BaseLib::ConfigTree const &pv_config, std::initializer_list< std::string > tags)
InitialStress createInitialStress(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, MeshLib::Mesh const &mesh, bool const mandatory_stress_type)
void createSecondaryVariables(BaseLib::ConfigTree const &config, SecondaryVariableCollection &secondary_variables)