From dad59045e42e012c5b1470b3bbcb9dfae3d557ec Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <dmitri.naumov@ufz.de> Date: Wed, 16 Dec 2015 14:35:19 +0100 Subject: [PATCH] [MeL] Consistent mesh property types; signedness. --- MeshLib/ElementStatus.cpp | 2 +- MeshLib/ElementStatus.h | 3 ++- Tests/MeshLib/TestElementStatus.cpp | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/MeshLib/ElementStatus.cpp b/MeshLib/ElementStatus.cpp index a825faf7d57..bd10860e5d5 100644 --- a/MeshLib/ElementStatus.cpp +++ b/MeshLib/ElementStatus.cpp @@ -31,7 +31,7 @@ ElementStatus::ElementStatus(Mesh const* const mesh, bool hasAnyInactive) } ElementStatus::ElementStatus(Mesh const* const mesh, - std::vector<unsigned> const& vec_inactive_matIDs) + std::vector<int> const& vec_inactive_matIDs) : ElementStatus(mesh, !vec_inactive_matIDs.empty()) { auto materialIds = mesh->getProperties().getPropertyVector<int>("MaterialIDs"); diff --git a/MeshLib/ElementStatus.h b/MeshLib/ElementStatus.h index c3c196c5847..43567ffb2b7 100644 --- a/MeshLib/ElementStatus.h +++ b/MeshLib/ElementStatus.h @@ -31,7 +31,8 @@ public: bool hasAnyInactive = false); /// Constructor taking a vector of inactive material IDs - ElementStatus(MeshLib::Mesh const*const mesh, std::vector<unsigned> const& vec_inactive_matIDs); + ElementStatus(MeshLib::Mesh const* const mesh, + std::vector<int> const& vec_inactive_matIDs); /// Returns a vector of active element IDs std::vector<MeshLib::Element*> const& getActiveElements() const; diff --git a/Tests/MeshLib/TestElementStatus.cpp b/Tests/MeshLib/TestElementStatus.cpp index 06dbfc0cdc2..5987ec55b00 100644 --- a/Tests/MeshLib/TestElementStatus.cpp +++ b/Tests/MeshLib/TestElementStatus.cpp @@ -53,14 +53,14 @@ TEST(MeshLib, ElementStatus) { // set material 1 to false - std::vector<unsigned> inactiveMat{1}; + std::vector<int> inactiveMat{1}; MeshLib::ElementStatus status(mesh.get(), inactiveMat); ASSERT_EQ (elements.size()-elements_per_side, status.getNActiveElements()); } { // set material 0 and 1 to false - std::vector<unsigned> inactiveMat{0, 1}; + std::vector<int> inactiveMat{0, 1}; MeshLib::ElementStatus status(mesh.get(), inactiveMat); ASSERT_EQ (elements.size()-(2*elements_per_side), status.getNActiveElements()); -- GitLab