From de5ab19d48dc9f8a5931cbec1a93a654891c330b Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Fri, 22 Jan 2021 06:48:06 +0100
Subject: [PATCH] [PL/T2PF] Activate checkMPLProperties.

---
 ...CreateThermalTwoPhaseFlowWithPPProcess.cpp | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/ProcessLib/ThermalTwoPhaseFlowWithPP/CreateThermalTwoPhaseFlowWithPPProcess.cpp b/ProcessLib/ThermalTwoPhaseFlowWithPP/CreateThermalTwoPhaseFlowWithPPProcess.cpp
index 167924cf33a..8c02fb29556 100644
--- a/ProcessLib/ThermalTwoPhaseFlowWithPP/CreateThermalTwoPhaseFlowWithPPProcess.cpp
+++ b/ProcessLib/ThermalTwoPhaseFlowWithPP/CreateThermalTwoPhaseFlowWithPPProcess.cpp
@@ -26,6 +26,24 @@ namespace ProcessLib
 {
 namespace ThermalTwoPhaseFlowWithPP
 {
+void checkMPLProperties(
+    MeshLib::Mesh const& mesh,
+    MaterialPropertyLib::MaterialSpatialDistributionMap const& media_map)
+{
+    std::array const required_property_medium = {
+        MaterialPropertyLib::PropertyType::porosity};
+
+    std::array const required_property_solid_phase = {
+        MaterialPropertyLib::PropertyType::density};
+
+    std::array const required_property_liquid_phase = {
+        MaterialPropertyLib::PropertyType::density};
+
+    MaterialPropertyLib::checkMaterialSpatialDistributionMap(
+        mesh, media_map, required_property_medium,
+        required_property_solid_phase, required_property_liquid_phase);
+}
+
 std::unique_ptr<Process> createThermalTwoPhaseFlowWithPPProcess(
     std::string name,
     MeshLib::Mesh& mesh,
@@ -108,6 +126,11 @@ std::unique_ptr<Process> createThermalTwoPhaseFlowWithPPProcess(
     auto media_map =
         MaterialPropertyLib::createMaterialSpatialDistributionMap(media, mesh);
 
+    DBUG(
+        "Check the media properties of ThermalTwoPhaseFlowWithPP  process ...");
+    checkMPLProperties(mesh, *media_map);
+    DBUG("Media properties verified.");
+
     ThermalTwoPhaseFlowWithPPProcessData process_data{std::move(media_map),
                                                       specific_body_force,
                                                       has_gravity,
-- 
GitLab