From c06e8bad78aec64add12e98e7fb7cb0d70d0513c Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <dmitri.naumov@ufz.de>
Date: Mon, 28 May 2018 20:04:37 +0200
Subject: [PATCH] [App] Construct additional meshes from geometries.

All named geometries are converted to meshes (with
same names).

These meshes will be used by the boundary conditions
and source term constructors.
---
 Applications/ApplicationsLib/ProjectData.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Applications/ApplicationsLib/ProjectData.cpp b/Applications/ApplicationsLib/ProjectData.cpp
index ac0bc424546..147c4db819f 100644
--- a/Applications/ApplicationsLib/ProjectData.cpp
+++ b/Applications/ApplicationsLib/ProjectData.cpp
@@ -23,6 +23,7 @@
 
 #include "MathLib/Curve/CreatePiecewiseLinearCurve.h"
 #include "MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.h"
+#include "MeshGeoToolsLib/ConstructMeshesFromGeometries.h"
 #include "MeshLib/Mesh.h"
 
 #include "NumLib/ODESolver/ConvergenceCriterion.h"
@@ -133,6 +134,15 @@ ProjectData::ProjectData(BaseLib::ConfigTree const& project_config,
         _mesh_vec.push_back(mesh);
     }
 
+    auto additional_meshes =
+        MeshGeoToolsLib::constructAdditionalMeshesFromGeoObjects(*_geoObjects,
+                                                                 *_mesh_vec[0]);
+    // release the unique_ptr's while copying to the raw pointers storage.
+    // TODO (naumov) Store unique_ptr's in _mesh_vec.
+    std::transform(begin(additional_meshes), end(additional_meshes),
+                   std::back_inserter(_mesh_vec),
+                   [](auto&& mesh) { return mesh.release(); });
+
     //! \ogs_file_param{prj__curves}
     parseCurves(project_config.getConfigSubtreeOptional("curves"));
 
-- 
GitLab