From b9163d561fc1bc95315a9585ee5905957b167c15 Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 24 Nov 2021 16:18:30 +0100 Subject: [PATCH] Added function checkFastEquiv to compare meshes before setting input fields --- CDMATH/mesh/inc/Mesh.hxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CDMATH/mesh/inc/Mesh.hxx b/CDMATH/mesh/inc/Mesh.hxx index b5a69d8..a7ea9c9 100644 --- a/CDMATH/mesh/inc/Mesh.hxx +++ b/CDMATH/mesh/inc/Mesh.hxx @@ -344,6 +344,15 @@ public: //---------------------------------------------------------------- bool isQuadrangular() const ; bool isHexahedral() const ; bool isStructured() const ; + + // epsilon used in mesh comparisons + double getComparisonEpsilon() const {return _epsilon;}; + void setComparisonEpsilon(double epsilon){ _epsilon=epsilon;}; + // Quick comparison of two meshes to see if they are identical with high probability (three cells are compared) + void checkFastEquivalWith( Mesh m) const { return getMEDCouplingMesh()->checkFastEquivalWith(m.getMEDCouplingMesh(),1e-6);}; + // Deep comparison of two meshes to see if they are identical Except for their names and units + bool isEqualWithoutConsideringStr( Mesh m) const { return getMEDCouplingMesh()->isEqualWithoutConsideringStr(m.getMEDCouplingMesh(),1e-6);}; + std::vector< std::string > getElementTypesNames() const ; /** * \brief Compute the minimum value over all cells of the ratio cell perimeter/cell vaolume @@ -468,6 +477,8 @@ private: //---------------------------------------------------------------- std::vector< int > _boundaryNodeIds; /* Boundary mesh */ const MEDCoupling::MEDCouplingUMesh * _boundaryMesh; + + double _epsilon; }; #endif /* MESH_HXX_ */ -- 2.39.2