Skip to content
Snippets Groups Projects
Commit a3358ad4 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[PL] RM; Add MaterialID based solid materials.

parent 8c48fa3c
No related branches found
No related tags found
No related merge requests found
......@@ -101,9 +101,8 @@ std::unique_ptr<Process> createRichardsMechanicsProcess(
variable_p->getNumberOfComponents());
}
// Constitutive relation.
auto solid_material =
MaterialLib::Solids::createConstitutiveRelation<DisplacementDim>(
auto solid_constitutive_relations =
MaterialLib::Solids::createConstitutiveRelations<DisplacementDim>(
parameters, config);
// Intrinsic permeability
......@@ -174,14 +173,15 @@ std::unique_ptr<Process> createRichardsMechanicsProcess(
//! \ogs_file_param{prj__processes__process__RICHARDS_MECHANICS__material_property}
config.getConfigSubtree("material_property");
boost::optional<MeshLib::PropertyVector<int> const&> material_ids;
if (mesh.getProperties().existsPropertyVector<int>("MaterialIDs"))
auto const material_ids =
mesh.getProperties().existsPropertyVector<int>("MaterialIDs")
? mesh.getProperties().getPropertyVector<int>("MaterialIDs")
: nullptr;
if (material_ids != nullptr)
{
INFO(
"MaterialIDs vector found; the Richards flow is in heterogeneous "
"porous media.");
material_ids =
*mesh.getProperties().getPropertyVector<int>("MaterialIDs");
}
else
{
......@@ -194,8 +194,9 @@ std::unique_ptr<Process> createRichardsMechanicsProcess(
flow_material_config, material_ids, parameters);
RichardsMechanicsProcessData<DisplacementDim> process_data{
material_ids,
std::move(flow_material),
std::move(solid_material),
std::move(solid_constitutive_relations),
intrinsic_permeability,
fluid_bulk_modulus,
biot_coefficient,
......
......@@ -54,10 +54,12 @@ RichardsMechanicsLocalAssembler<ShapeFunctionDisplacement,
IntegrationMethod, DisplacementDim>(
e, is_axially_symmetric, _integration_method);
auto const material_id = _process_data.material_ids == nullptr
? 0
: (*_process_data.material_ids)[e.getID()];
for (unsigned ip = 0; ip < n_integration_points; ip++)
{
// displacement (subscript u)
_ip_data.emplace_back(*_process_data.solid_material);
_ip_data.emplace_back(*_process_data.solid_materials[material_id]);
auto& ip_data = _ip_data[ip];
auto const& sm_u = shape_matrices_u[ip];
_ip_data[ip].integration_weight =
......
......@@ -34,11 +34,14 @@ template <int DisplacementDim>
struct RichardsMechanicsProcessData
{
RichardsMechanicsProcessData(
MeshLib::PropertyVector<int> const* const material_ids_,
std::unique_ptr<
ProcessLib::RichardsFlow::RichardsFlowMaterialProperties>&&
flow_material_,
std::unique_ptr<MaterialLib::Solids::MechanicsBase<DisplacementDim>>&&
solid_material_,
std::map<int,
std::unique_ptr<
MaterialLib::Solids::MechanicsBase<DisplacementDim>>>&&
solid_materials_,
Parameter<double> const& intrinsic_permeability_,
Parameter<double> const& fluid_bulk_modulus_,
Parameter<double> const& biot_coefficient_,
......@@ -47,8 +50,9 @@ struct RichardsMechanicsProcessData
Parameter<double> const& temperature_,
Eigen::Matrix<double, DisplacementDim, 1>
specific_body_force_)
: flow_material{std::move(flow_material_)},
solid_material{std::move(solid_material_)},
: material_ids(material_ids_),
flow_material{std::move(flow_material_)},
solid_materials{std::move(solid_materials_)},
intrinsic_permeability(intrinsic_permeability_),
fluid_bulk_modulus(fluid_bulk_modulus_),
biot_coefficient(biot_coefficient_),
......@@ -69,12 +73,16 @@ struct RichardsMechanicsProcessData
void operator=(RichardsMechanicsProcessData const&) = delete;
void operator=(RichardsMechanicsProcessData&&) = delete;
MeshLib::PropertyVector<int> const* const material_ids;
std::unique_ptr<ProcessLib::RichardsFlow::RichardsFlowMaterialProperties>
flow_material;
/// The constitutive relation for the mechanical part.
std::unique_ptr<MaterialLib::Solids::MechanicsBase<DisplacementDim>>
solid_material;
std::map<
int,
std::unique_ptr<MaterialLib::Solids::MechanicsBase<DisplacementDim>>>
solid_materials;
/// Permeability of the solid. A scalar quantity, Parameter<double>.
Parameter<double> const& intrinsic_permeability;
/// Fluid's bulk modulus. A scalar quantity, Parameter<double>.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment