From 2c7fb34cce917654636c34bab2c38c0bbd699e21 Mon Sep 17 00:00:00 2001 From: regislebrun Date: Wed, 13 Sep 2023 15:52:09 +0200 Subject: [PATCH] Fixed Mesh Now, a mesh can have repeated indices in its simplices. The conformity test was too strict. --- lib/src/Base/Geom/Mesh.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/Base/Geom/Mesh.cxx b/lib/src/Base/Geom/Mesh.cxx index e1b514a6dd..58bc4a1295 100644 --- a/lib/src/Base/Geom/Mesh.cxx +++ b/lib/src/Base/Geom/Mesh.cxx @@ -166,8 +166,8 @@ void Mesh::checkValidity() const if (simplex.getSize() != getDimension() + 1) throw InvalidArgumentException(HERE) << "Error: mesh has dimension " << getDimension() << " but simplex #" << i << " has size" << simplex.getSize(); - if (!simplex.check(getVerticesNumber())) - throw InvalidArgumentException(HERE) << "Error: mesh has " << getVerticesNumber() << " vertices but simplex #" << i << " refers to an unknown vertex"; + if (*std::max_element(simplex.begin(), simplex.end()) >= getVerticesNumber()) + throw InvalidArgumentException(HERE) << "Error: mesh has " << getVerticesNumber() << " vertices but simplex #" << i << " = " << simplex << " refers to an unknown vertex"; } // Check that no ball can be included into the intersection of two simplices // One it has been checked everything is ok