From c12b94d5b172fa6badcba193bb874f5384bd9d4c Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Tue, 13 Nov 2018 14:51:00 +0100
Subject: [PATCH] [PL/BC] Use new getPropertyVector.

This versions check if the PropertyVector is
assigned to the requested mesh item type and has
the required number of components.
---
 .../ConstraintDirichletBoundaryCondition.cpp   | 18 ++----------------
 .../PythonBoundaryConditionLocalAssembler.h    |  3 ++-
 2 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/ProcessLib/BoundaryCondition/ConstraintDirichletBoundaryCondition.cpp b/ProcessLib/BoundaryCondition/ConstraintDirichletBoundaryCondition.cpp
index 21c3d379715..f4e6b041dcc 100644
--- a/ProcessLib/BoundaryCondition/ConstraintDirichletBoundaryCondition.cpp
+++ b/ProcessLib/BoundaryCondition/ConstraintDirichletBoundaryCondition.cpp
@@ -70,24 +70,10 @@ ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(
     // create _bulk_ids vector
     auto const* bulk_element_ids =
         _bc_mesh.getProperties().getPropertyVector<std::size_t>(
-            "bulk_element_ids");
-    if (!bulk_element_ids)
-    {
-        OGS_FATAL(
-            "The boundary mesh '%s' doesn't contain the needed property "
-            "'bulk_element_ids'.",
-            _bc_mesh.getName().c_str());
-    }
+            "bulk_element_ids", MeshLib::MeshItemType::Cell, 1);
     auto const* bulk_node_ids =
         _bc_mesh.getProperties().getPropertyVector<std::size_t>(
-            "bulk_node_ids");
-    if (!bulk_node_ids)
-    {
-        OGS_FATAL(
-            "The boundary mesh '%s' doesn't contain the needed property "
-            "'bulk_node_ids'.",
-            _bc_mesh.getName().c_str());
-    }
+            "bulk_node_ids", MeshLib::MeshItemType::Node, 1);
     auto const& bulk_nodes = bulk_mesh.getNodes();
 
     auto get_bulk_element_face_id =
diff --git a/ProcessLib/BoundaryCondition/Python/PythonBoundaryConditionLocalAssembler.h b/ProcessLib/BoundaryCondition/Python/PythonBoundaryConditionLocalAssembler.h
index 6018fa210f4..83fbc8f10fa 100644
--- a/ProcessLib/BoundaryCondition/Python/PythonBoundaryConditionLocalAssembler.h
+++ b/ProcessLib/BoundaryCondition/Python/PythonBoundaryConditionLocalAssembler.h
@@ -68,7 +68,8 @@ public:
 
         auto const& bulk_node_ids_map =
             *_data.boundary_mesh.getProperties()
-                 .template getPropertyVector<std::size_t>("bulk_node_ids");
+                 .template getPropertyVector<std::size_t>(
+                     "bulk_node_ids", MeshLib::MeshItemType::Node, 1);
 
         // gather primary variables
         Eigen::MatrixXd primary_variables_mat(num_nodes, num_comp_total);
-- 
GitLab