diff --git a/MeshGeoToolsLib/AppendLinesAlongPolyline.cpp b/MeshGeoToolsLib/AppendLinesAlongPolyline.cpp index 4e06ff99459db8d3f3b84cdfe519b0e9be843f70..c107c4d10896e4f90037229c9677bd25b273cd1b 100644 --- a/MeshGeoToolsLib/AppendLinesAlongPolyline.cpp +++ b/MeshGeoToolsLib/AppendLinesAlongPolyline.cpp @@ -33,14 +33,16 @@ std::unique_ptr<MeshLib::Mesh> appendLinesAlongPolylines( std::vector<MeshLib::Element*> vec_new_eles = MeshLib::copyElementVector(mesh.getElements(), vec_new_nodes); std::vector<int> new_mat_ids; + try { - if (mesh.getProperties().existsPropertyVector<int>("MaterialIDs")) { - auto ids = - mesh.getProperties().getPropertyVector<int>("MaterialIDs"); - new_mat_ids.reserve(ids->size()); - std::copy(ids->cbegin(), ids->cend(), - std::back_inserter(new_mat_ids)); - } + auto ids = mesh.getProperties().getPropertyVector<int>( + "MaterialIDs", MeshLib::MeshItemType::Cell, 1); + new_mat_ids.reserve(ids->size()); + std::copy(ids->cbegin(), ids->cend(), std::back_inserter(new_mat_ids)); + } + catch (std::runtime_error const& e) + { + WARN("%s", e.what()); } int max_matID(0); if (!new_mat_ids.empty()) diff --git a/MeshGeoToolsLib/IdentifySubdomainMesh.cpp b/MeshGeoToolsLib/IdentifySubdomainMesh.cpp index 5b69d073d90ad38f28af3c494ff5ccdda75bb40b..07c0313b0a7bec1eb8207b0bfe3130e55f27a13b 100644 --- a/MeshGeoToolsLib/IdentifySubdomainMesh.cpp +++ b/MeshGeoToolsLib/IdentifySubdomainMesh.cpp @@ -99,8 +99,8 @@ std::vector<std::vector<std::size_t>> identifySubdomainMeshElements( MeshLib::Mesh const& subdomain_mesh, MeshLib::Mesh const& bulk_mesh) { auto& properties = subdomain_mesh.getProperties(); - auto const& bulk_node_ids = - *properties.getPropertyVector<std::size_t>("bulk_node_ids"); + auto const& bulk_node_ids = *properties.getPropertyVector<std::size_t>( + "bulk_node_ids", MeshLib::MeshItemType::Node, 1); // Allocate space for all elements for random insertion. std::vector<std::vector<std::size_t>> bulk_element_ids_map(