From 51171744872a54d24b4b2302dffe1510d8b652c7 Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <github@naumov.de>
Date: Sun, 17 Sep 2023 13:05:03 +0200
Subject: [PATCH] [PL/SD] Pass media map to process creation

---
 Applications/ApplicationsLib/ProjectData.cpp       |  4 ++--
 .../CreateSmallDeformationProcess.cpp              |  9 ++++++---
 .../CreateSmallDeformationProcess.h                | 14 +++++++++++---
 3 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/Applications/ApplicationsLib/ProjectData.cpp b/Applications/ApplicationsLib/ProjectData.cpp
index 36847be87a4..34f60eccf66 100644
--- a/Applications/ApplicationsLib/ProjectData.cpp
+++ b/Applications/ApplicationsLib/ProjectData.cpp
@@ -907,7 +907,7 @@ void ProjectData::parseProcesses(
                             name, *_mesh_vec[0], std::move(jacobian_assembler),
                             _process_variables, _parameters,
                             _local_coordinate_system, integration_order,
-                            process_config);
+                            process_config, _media);
                     break;
                 case 3:
                     process = ProcessLib::SmallDeformation::
@@ -915,7 +915,7 @@ void ProjectData::parseProcesses(
                             name, *_mesh_vec[0], std::move(jacobian_assembler),
                             _process_variables, _parameters,
                             _local_coordinate_system, integration_order,
-                            process_config);
+                            process_config, _media);
                     break;
                 default:
                     OGS_FATAL(
diff --git a/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp b/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp
index 0bab8b56a0f..de2d504d46a 100644
--- a/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp
+++ b/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp
@@ -33,7 +33,8 @@ std::unique_ptr<Process> createSmallDeformationProcess(
     std::optional<ParameterLib::CoordinateSystem> const&
         local_coordinate_system,
     unsigned const integration_order,
-    BaseLib::ConfigTree const& config)
+    BaseLib::ConfigTree const& config,
+    std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media)
 {
     //! \ogs_file_param{prj__processes__process__type}
     config.checkConfigParameter("type", "SMALL_DEFORMATION");
@@ -141,7 +142,8 @@ template std::unique_ptr<Process> createSmallDeformationProcess<2>(
     std::optional<ParameterLib::CoordinateSystem> const&
         local_coordinate_system,
     unsigned const integration_order,
-    BaseLib::ConfigTree const& config);
+    BaseLib::ConfigTree const& config,
+    std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media);
 
 template std::unique_ptr<Process> createSmallDeformationProcess<3>(
     std::string const& name,
@@ -152,7 +154,8 @@ template std::unique_ptr<Process> createSmallDeformationProcess<3>(
     std::optional<ParameterLib::CoordinateSystem> const&
         local_coordinate_system,
     unsigned const integration_order,
-    BaseLib::ConfigTree const& config);
+    BaseLib::ConfigTree const& config,
+    std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media);
 
 }  // namespace SmallDeformation
 }  // namespace ProcessLib
diff --git a/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.h b/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.h
index cd126daa323..05f7f37e05b 100644
--- a/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.h
+++ b/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.h
@@ -10,6 +10,7 @@
 
 #pragma once
 
+#include <map>
 #include <memory>
 #include <optional>
 #include <string>
@@ -19,6 +20,10 @@ namespace BaseLib
 {
 class ConfigTree;
 }
+namespace MaterialPropertyLib
+{
+class Medium;
+}
 namespace MeshLib
 {
 class Mesh;
@@ -49,7 +54,8 @@ std::unique_ptr<Process> createSmallDeformationProcess(
     std::optional<ParameterLib::CoordinateSystem> const&
         local_coordinate_system,
     unsigned const integration_order,
-    BaseLib::ConfigTree const& config);
+    BaseLib::ConfigTree const& config,
+    std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media);
 
 extern template std::unique_ptr<Process> createSmallDeformationProcess<2>(
     std::string const& name,
@@ -60,7 +66,8 @@ extern template std::unique_ptr<Process> createSmallDeformationProcess<2>(
     std::optional<ParameterLib::CoordinateSystem> const&
         local_coordinate_system,
     unsigned const integration_order,
-    BaseLib::ConfigTree const& config);
+    BaseLib::ConfigTree const& config,
+    std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media);
 
 extern template std::unique_ptr<Process> createSmallDeformationProcess<3>(
     std::string const& name,
@@ -71,7 +78,8 @@ extern template std::unique_ptr<Process> createSmallDeformationProcess<3>(
     std::optional<ParameterLib::CoordinateSystem> const&
         local_coordinate_system,
     unsigned const integration_order,
-    BaseLib::ConfigTree const& config);
+    BaseLib::ConfigTree const& config,
+    std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media);
 
 }  // namespace SmallDeformation
 }  // namespace ProcessLib
-- 
GitLab