diff --git a/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp b/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp index faac0d75f305cebeb855379d1a03a4abf257f72d..259d83a1830f50947b59ddb53f7826d48cc3920f 100644 --- a/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp +++ b/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp @@ -309,7 +309,7 @@ void NodeWiseMeshPartitioner::processPartition(std::size_t const part_id) std::back_inserter(partition.nodes)); // Set the node numbers of base and all mesh nodes. - partition.number_of_mesh_base_nodes = _mesh->getNumberOfBaseNodes(); + partition.number_of_mesh_base_nodes = _mesh->computeNumberOfBaseNodes(); partition.number_of_mesh_all_nodes = _mesh->getNumberOfNodes(); } @@ -819,7 +819,7 @@ std::vector<Partition> NodeWiseMeshPartitioner::partitionOtherMesh( auto& partition = partitions[part_id]; INFO("Processing partition: {:d}", part_id); // Set the node numbers of base and all mesh nodes. - partition.number_of_mesh_base_nodes = mesh.getNumberOfBaseNodes(); + partition.number_of_mesh_base_nodes = mesh.computeNumberOfBaseNodes(); partition.number_of_mesh_all_nodes = mesh.getNumberOfNodes(); std::vector<MeshLib::Node*> higher_order_regular_nodes; diff --git a/ChemistryLib/CreateChemicalSolverInterface.cpp b/ChemistryLib/CreateChemicalSolverInterface.cpp index 87058f69db360e52bd5b843481ef9de60fc87240..05f787275f4bd80a80f1cac6c27fa2d38809fc49 100644 --- a/ChemistryLib/CreateChemicalSolverInterface.cpp +++ b/ChemistryLib/CreateChemicalSolverInterface.cpp @@ -188,7 +188,7 @@ createChemicalSolverInterface<ChemicalSolver::PhreeqcKernel>( config.getConfigSubtreeOptional("equilibrium_reactants"), mesh); return std::make_unique<PhreeqcKernelData::PhreeqcKernel>( - mesh, *linear_solver, mesh.getNumberOfBaseNodes(), + mesh, *linear_solver, mesh.computeNumberOfBaseNodes(), process_id_to_component_name_map, std::move(path_to_database), std::move(aqueous_solution), std::move(equilibrium_reactants), std::move(kinetic_reactants), std::move(reaction_rates)); diff --git a/MeshGeoToolsLib/MeshNodesAlongPolyline.cpp b/MeshGeoToolsLib/MeshNodesAlongPolyline.cpp index b10178d0a5d3c9333e3779ce4c46273b57ce4c8c..8f3c86d2128bae7937f59d478e83246ba8417813 100644 --- a/MeshGeoToolsLib/MeshNodesAlongPolyline.cpp +++ b/MeshGeoToolsLib/MeshNodesAlongPolyline.cpp @@ -30,7 +30,7 @@ MeshNodesAlongPolyline::MeshNodesAlongPolyline(MeshLib::Mesh const& mesh, assert(epsilon_radius > 0); const std::size_t n_nodes(search_all_nodes == SearchAllNodes::Yes ? _mesh.getNumberOfNodes() - : _mesh.getNumberOfBaseNodes()); + : _mesh.computeNumberOfBaseNodes()); auto& mesh_nodes = _mesh.getNodes(); // loop over all nodes for (std::size_t i = 0; i < n_nodes; i++) diff --git a/MeshGeoToolsLib/MeshNodesAlongSurface.cpp b/MeshGeoToolsLib/MeshNodesAlongSurface.cpp index 85b393fa075ad7c72b82553f1f7cb98b12e27107..f37d783e182c8c752a7bac153bc594bcd370213b 100644 --- a/MeshGeoToolsLib/MeshNodesAlongSurface.cpp +++ b/MeshGeoToolsLib/MeshNodesAlongSurface.cpp @@ -31,7 +31,7 @@ MeshNodesAlongSurface::MeshNodesAlongSurface(MeshLib::Mesh const& mesh, auto const& mesh_nodes = _mesh.getNodes(); const std::size_t n_nodes(search_all_nodes == SearchAllNodes::Yes ? _mesh.getNumberOfNodes() - : _mesh.getNumberOfBaseNodes()); + : _mesh.computeNumberOfBaseNodes()); // loop over all nodes for (std::size_t i = 0; i < n_nodes; i++) { diff --git a/MeshLib/Mesh.cpp b/MeshLib/Mesh.cpp index ded58063da9d2ead1e431c0cbbcd37dbca5a250a..a4c7438d03a4891a233d00097a2a63b61bcc3cc9 100644 --- a/MeshLib/Mesh.cpp +++ b/MeshLib/Mesh.cpp @@ -222,7 +222,7 @@ void Mesh::setElementNeighbors() } } -std::size_t Mesh::getNumberOfBaseNodes() const +std::size_t Mesh::computeNumberOfBaseNodes() const { return std::count_if(begin(_nodes), end(_nodes), [this](auto const* const node) { diff --git a/MeshLib/Mesh.h b/MeshLib/Mesh.h index df5c71b46d0d98b7c8f186dca61c214b7553ac38..571eaabf7d8f83a1e5b4b4602d321b208dac00f8 100644 --- a/MeshLib/Mesh.h +++ b/MeshLib/Mesh.h @@ -116,7 +116,7 @@ public: std::size_t getID() const {return _id; } /// Get the number of base nodes - std::size_t getNumberOfBaseNodes() const; + std::size_t computeNumberOfBaseNodes() const; /// Check if the mesh contains any nonlinear element. bool hasNonlinearElement() const; diff --git a/MeshLib/MeshEditing/ConvertToLinearMesh.cpp b/MeshLib/MeshEditing/ConvertToLinearMesh.cpp index 82c9ffddc05a160ede55cfbc4e5c9799b68c285f..0fc8199fe4a0b60848d324993c0bceb3f75e9787 100644 --- a/MeshLib/MeshEditing/ConvertToLinearMesh.cpp +++ b/MeshLib/MeshEditing/ConvertToLinearMesh.cpp @@ -120,7 +120,7 @@ std::unique_ptr<MeshLib::Mesh> convertToLinearMesh( MeshLib::MeshItemType::Node))); // copy property vectors for nodes - auto const number_of_base_nodes = org_mesh.getNumberOfBaseNodes(); + auto const number_of_base_nodes = org_mesh.computeNumberOfBaseNodes(); for (auto [name, property] : org_mesh.getProperties()) { if (property->getMeshItemType() != MeshLib::MeshItemType::Node) diff --git a/MeshLib/NodePartitionedMesh.h b/MeshLib/NodePartitionedMesh.h index c7ffef7c790471b4f3cd462f1cc2574c940f78ff..68ec1c1e534a68a0acc4d5c05814d859cd0fedc0 100644 --- a/MeshLib/NodePartitionedMesh.h +++ b/MeshLib/NodePartitionedMesh.h @@ -34,7 +34,7 @@ public: explicit NodePartitionedMesh(const Mesh& mesh) : Mesh(mesh), _global_node_ids(mesh.getNumberOfNodes()), - _n_global_base_nodes(mesh.getNumberOfBaseNodes()), + _n_global_base_nodes(mesh.computeNumberOfBaseNodes()), _n_global_nodes(mesh.getNumberOfNodes()), _n_active_nodes(mesh.getNumberOfNodes()), _is_single_thread(true) diff --git a/Tests/MeshLib/TestRasterToMesh.cpp b/Tests/MeshLib/TestRasterToMesh.cpp index caac1c794e4e04c1c0ce1d1593d349e16ac7b07a..d82abfb0752093b32770fa002ae4df1b125fd981 100644 --- a/Tests/MeshLib/TestRasterToMesh.cpp +++ b/Tests/MeshLib/TestRasterToMesh.cpp @@ -77,7 +77,7 @@ TEST_F(RasterToMeshTest, convertRasterToQuadMeshElevation) MeshLib::UseIntensityAs::ELEVATION, "test"); ASSERT_TRUE(mesh != nullptr); - ASSERT_EQ(_n_nodes, mesh->getNumberOfBaseNodes()); + ASSERT_EQ(_n_nodes, mesh->computeNumberOfBaseNodes()); ASSERT_EQ(0, mesh->getProperties().size()); @@ -112,7 +112,7 @@ TEST_F(RasterToMeshTest, convertRasterToTriMeshValue) MeshLib::UseIntensityAs::DATAVECTOR, "test"); ASSERT_TRUE(mesh != nullptr); - ASSERT_EQ(_n_nodes, mesh->getNumberOfBaseNodes()); + ASSERT_EQ(_n_nodes, mesh->computeNumberOfBaseNodes()); ASSERT_EQ(1, mesh->getProperties().size()); @@ -143,7 +143,7 @@ TEST_F(RasterToMeshTest, convertRasterToQuadMeshValue) MeshLib::UseIntensityAs::DATAVECTOR, "test"); ASSERT_TRUE(mesh != nullptr); - ASSERT_EQ(_n_nodes, mesh->getNumberOfBaseNodes()); + ASSERT_EQ(_n_nodes, mesh->computeNumberOfBaseNodes()); ASSERT_EQ(1, mesh->getProperties().size()); @@ -174,7 +174,7 @@ TEST_F(RasterToMeshTest, convertRasterToPrismMeshValue) MeshLib::UseIntensityAs::DATAVECTOR, "test"); ASSERT_TRUE(mesh != nullptr); - ASSERT_EQ(2 * _n_nodes, mesh->getNumberOfBaseNodes()); + ASSERT_EQ(2 * _n_nodes, mesh->computeNumberOfBaseNodes()); ASSERT_EQ(1, mesh->getProperties().size()); @@ -205,7 +205,7 @@ TEST_F(RasterToMeshTest, convertRasterToHexMeshValue) MeshLib::UseIntensityAs::MATERIALS, "MaterialIDs"); ASSERT_TRUE(mesh != nullptr); - ASSERT_EQ(2 * _n_nodes, mesh->getNumberOfBaseNodes()); + ASSERT_EQ(2 * _n_nodes, mesh->computeNumberOfBaseNodes()); ASSERT_EQ(1, mesh->getProperties().size()); @@ -236,7 +236,7 @@ TEST_F(RasterToMeshTest, convertRasterToQuadMeshNone) MeshLib::UseIntensityAs::NONE, "test"); ASSERT_TRUE(mesh != nullptr); - ASSERT_EQ(_n_nodes, mesh->getNumberOfBaseNodes()); + ASSERT_EQ(_n_nodes, mesh->computeNumberOfBaseNodes()); ASSERT_EQ(0, mesh->getProperties().size()); @@ -263,7 +263,7 @@ TEST_F(RasterToMeshTest, vtkImage) MeshLib::UseIntensityAs::DATAVECTOR, "test"); ASSERT_TRUE(mesh != nullptr); - ASSERT_EQ(_n_nodes, mesh->getNumberOfBaseNodes()); + ASSERT_EQ(_n_nodes, mesh->computeNumberOfBaseNodes()); ASSERT_EQ(1, mesh->getProperties().size()); diff --git a/Tests/MeshLib/TestRemove.cpp b/Tests/MeshLib/TestRemove.cpp index 220ecab82ebadeac05d4c1ea8f8efb0f2003c216..80e8164173dcb2decc4b280db1f2f10a7f746a16 100644 --- a/Tests/MeshLib/TestRemove.cpp +++ b/Tests/MeshLib/TestRemove.cpp @@ -37,7 +37,7 @@ TEST(MeshLib, RemoveNodes) MeshLib::removeNodes(*mesh, removed_node_ids, "")}; ASSERT_EQ(5u, new_mesh->getNumberOfNodes()); - ASSERT_EQ(5u, new_mesh->getNumberOfBaseNodes()); + ASSERT_EQ(5u, new_mesh->computeNumberOfBaseNodes()); ASSERT_EQ(4u, new_mesh->getNumberOfElements()); for (std::size_t i = 0; i < new_mesh->getNumberOfNodes(); i++) { @@ -60,7 +60,7 @@ TEST(MeshLib, RemoveElements) MeshLib::removeElements(*mesh, removed_ele_ids, "")}; ASSERT_EQ(5u, new_mesh->getNumberOfNodes()); - ASSERT_EQ(5u, new_mesh->getNumberOfBaseNodes()); + ASSERT_EQ(5u, new_mesh->computeNumberOfBaseNodes()); ASSERT_EQ(4u, new_mesh->getNumberOfElements()); for (std::size_t i = 0; i < new_mesh->getNumberOfNodes(); i++) {