From f7d884e2be7240266b2c667c5eb5342a082dd3e6 Mon Sep 17 00:00:00 2001 From: nicolas le goff Date: Tue, 7 May 2024 00:10:10 +0200 Subject: [PATCH] added missing include limits header in morphmesh --- morphMesh/inc/gmds/morphMesh/EllipticMorph.h | 2 ++ morphMesh/src/EllipticMorph.cpp | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/morphMesh/inc/gmds/morphMesh/EllipticMorph.h b/morphMesh/inc/gmds/morphMesh/EllipticMorph.h index 5b294295f..66bea210b 100644 --- a/morphMesh/inc/gmds/morphMesh/EllipticMorph.h +++ b/morphMesh/inc/gmds/morphMesh/EllipticMorph.h @@ -75,6 +75,8 @@ class LIB_GMDS_MORPHMESH_API EllipticMorph */ void finalize(); + void writeMesh(std::string AFilename) const; + private: /* Mesh mark for locked nodes */ diff --git a/morphMesh/src/EllipticMorph.cpp b/morphMesh/src/EllipticMorph.cpp index e5fc1cc9e..cb81baa00 100644 --- a/morphMesh/src/EllipticMorph.cpp +++ b/morphMesh/src/EllipticMorph.cpp @@ -10,7 +10,7 @@ #include "gmds/morphMesh/FastLocalize.h" #include #include - +#include #ifdef WITH_LIMA #include "gmds/io/LimaReader.h" @@ -22,7 +22,7 @@ /*----------------------------------------------------------------------------*/ using namespace gmds; -using namespace morphmesh; +using namespace morphmesh; /*----------------------------------------------------------------------------*/ EllipticMorph::EllipticMorph(const std::string& AFilename, Mesh* AMesh): @@ -130,7 +130,7 @@ EllipticMorph::EllipticMorph(const std::string& AFilename, Mesh* AMesh): m_morphRegions = m_mesh->newMark(); m_lockRegions = m_mesh->newMark(); - m_minEdgeLength = MAXFLOAT; + m_minEdgeLength = std::numeric_limits::max(); for(const auto& e : m_mesh->edges()){ Edge edge = m_mesh->get(e); if(edge.length() < m_minEdgeLength){ @@ -738,7 +738,7 @@ std::vector EllipticMorph::noExteriorLock(){ } if (!intersectedFaces.empty()) { - double distance = MAXFLOAT; + double distance = std::numeric_limits::max(); for (int i_f = 0; i_f < intersectedFaces.size(); i_f++) { if (points[i_f].distance(p) < distance) { distance = points[i_f].distance(p); @@ -1012,3 +1012,15 @@ void EllipticMorph::finalize(){ throw GMDSException("File format not supported, only .vtk or .mli2 supported"); } } +/*----------------------------------------------------------------------------*/ +void EllipticMorph::writeMesh(std::string AFilename) const +{ + std::cout<<"------------- PRINT ------------- "<