30namespace RichardsMechanics
33 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
35 std::array
const required_medium_properties = {
42 std::array
const required_liquid_properties = {
46 for (
auto const& m : media)
48 checkRequiredProperties(*m.second, required_medium_properties);
49 checkRequiredProperties(m.second->phase(
"AqueousLiquid"),
50 required_liquid_properties);
51 checkRequiredProperties(m.second->phase(
"Solid"),
52 required_solid_properties);
56template <
int DisplacementDim>
58 std::string
const& name,
60 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
61 std::vector<ProcessVariable>
const& variables,
62 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
63 std::optional<ParameterLib::CoordinateSystem>
const&
64 local_coordinate_system,
65 unsigned const integration_order,
67 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
71 DBUG(
"Create RichardsMechanicsProcess.");
73 auto const coupling_scheme =
76 const bool use_monolithic_scheme =
77 !(coupling_scheme && (*coupling_scheme ==
"staggered"));
86 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
88 if (use_monolithic_scheme)
98 variable_p = &per_process_variables[0].get();
99 variable_u = &per_process_variables[1].get();
100 process_variables.push_back(std::move(per_process_variables));
104 using namespace std::string_literals;
105 for (
auto const& variable_name : {
"pressure"s,
"displacement"s})
107 auto per_process_variables =
109 process_variables.push_back(std::move(per_process_variables));
111 variable_p = &process_variables[0][0].get();
112 variable_u = &process_variables[1][0].get();
115 DBUG(
"Associate displacement with process variable '{:s}'.",
121 "Number of components of the process variable '{:s}' is different "
122 "from the displacement dimension: got {:d}, expected {:d}",
128 DBUG(
"Associate pressure with process variable '{:s}'.",
133 "Pressure process variable '{:s}' is not a scalar variable but has "
139 auto solid_constitutive_relations =
141 parameters, local_coordinate_system, materialIDs(mesh), config);
145 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
147 std::vector<double>
const b =
150 "specific_body_force");
151 if (b.size() != DisplacementDim)
154 "The size of the specific body force vector does not match the "
155 "displacement dimension. Vector size is {:d}, displacement "
157 b.size(), DisplacementDim);
160 std::copy_n(b.data(), b.size(), specific_body_force.data());
165 DBUG(
"Check the media properties of RichardsMechanics process ...");
167 DBUG(
"Media properties verified.");
170 auto const initial_stress =
174 std::optional<MicroPorosityParameters> micro_porosity_parameters;
175 if (
auto const micro_porosity_config =
182 micro_porosity_config->getConfigSubtree(
"nonlinear_solver")),
184 micro_porosity_config->getConfigParameter<
double>(
185 "mass_exchange_coefficient")};
188 auto const mass_lumping =
192 auto const explicit_hm_coupling_in_unsaturated_zone =
195 "explicit_hm_coupling_in_unsaturated_zone",
false);
199 std::move(media_map),
200 std::move(solid_constitutive_relations),
203 micro_porosity_parameters,
205 explicit_hm_coupling_in_unsaturated_zone};
211 return std::make_unique<RichardsMechanicsProcess<DisplacementDim>>(
212 std::move(name), mesh, std::move(jacobian_assembler), parameters,
213 integration_order, std::move(process_variables),
214 std::move(process_data), std::move(secondary_variables),
215 use_monolithic_scheme);
219 std::string
const& name,
221 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
222 std::vector<ProcessVariable>
const& variables,
223 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
224 std::optional<ParameterLib::CoordinateSystem>
const&
225 local_coordinate_system,
226 unsigned const integration_order,
228 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media);
231 std::string
const& name,
233 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
234 std::vector<ProcessVariable>
const& variables,
235 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
236 std::optional<ParameterLib::CoordinateSystem>
const&
237 local_coordinate_system,
238 unsigned const integration_order,
240 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media);
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
std::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) const
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
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)
@ bishops_effective_stress
NewtonRaphsonSolverParameters createNewtonRaphsonSolverParameters(BaseLib::ConfigTree const &config)
void checkMPLProperties(std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createRichardsMechanicsProcess< 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)
std::unique_ptr< Process > createRichardsMechanicsProcess(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 > createRichardsMechanicsProcess< 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::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)