Skip to content
Snippets Groups Projects
Commit b75c1221 authored by Florian Zill's avatar Florian Zill Committed by Dmitri Naumov
Browse files

[HM] add check for required MPL properties

parent e2e27ff8
No related branches found
No related tags found
No related merge requests found
......@@ -65,4 +65,5 @@ std::string Phase::name() const
{
return std::get<std::string>(_properties[PropertyType::name]->value());
}
} // namespace MaterialPropertyLib
......@@ -52,6 +52,20 @@ public:
std::string name() const;
template <size_t N>
void checkRequiredProperties(
std::array<PropertyType, N> const& required_properties) const
{
for (auto const& p : required_properties)
{
if (!hasProperty(p))
{
OGS_FATAL("The property '%s' is missing in the %s phase.",
property_enum_to_string[p].c_str(), name().c_str());
}
}
}
private:
std::vector<std::unique_ptr<Component>> const _components;
......
......@@ -14,6 +14,7 @@
#include "MaterialLib/MPL/CreateMaterialSpatialDistributionMap.h"
#include "MaterialLib/MPL/MaterialSpatialDistributionMap.h"
#include "MaterialLib/MPL/Medium.h"
#include "MaterialLib/SolidModels/CreateConstitutiveRelation.h"
#include "MaterialLib/SolidModels/MechanicsBase.h"
......@@ -164,6 +165,15 @@ std::unique_ptr<Process> createHydroMechanicsProcess(
auto media_map =
MaterialPropertyLib::createMaterialSpatialDistributionMap(media, mesh);
std::array const requiredGasProperties = {MaterialPropertyLib::viscosity};
std::array const requiredSolidProperties = {MaterialPropertyLib::porosity};
for (auto const& m : media)
{
m.second->phase("Gas").checkRequiredProperties(requiredGasProperties);
m.second->phase("Solid").checkRequiredProperties(
requiredSolidProperties);
}
// Initial stress conditions
auto const initial_stress = ParameterLib::findOptionalTagParameter<double>(
//! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS__initial_stress}
......
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