Skip to content

Commit

Permalink
added missing include limits header in morphmesh
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslg committed May 7, 2024
1 parent dc3bad8 commit f7d884e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 2 additions & 0 deletions morphMesh/inc/gmds/morphMesh/EllipticMorph.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class LIB_GMDS_MORPHMESH_API EllipticMorph
*/
void finalize();

void writeMesh(std::string AFilename) const;

private:

/* Mesh mark for locked nodes */
Expand Down
20 changes: 16 additions & 4 deletions morphMesh/src/EllipticMorph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "gmds/morphMesh/FastLocalize.h"
#include <fstream>
#include <regex>

#include <limits>

#ifdef WITH_LIMA
#include "gmds/io/LimaReader.h"
Expand All @@ -22,7 +22,7 @@
/*----------------------------------------------------------------------------*/

using namespace gmds;
using namespace morphmesh;
using namespace morphmesh;

/*----------------------------------------------------------------------------*/
EllipticMorph::EllipticMorph(const std::string& AFilename, Mesh* AMesh):
Expand Down Expand Up @@ -130,7 +130,7 @@ EllipticMorph::EllipticMorph(const std::string& AFilename, Mesh* AMesh):
m_morphRegions = m_mesh->newMark<Region>();
m_lockRegions = m_mesh->newMark<Region>();

m_minEdgeLength = MAXFLOAT;
m_minEdgeLength = std::numeric_limits<double>::max();
for(const auto& e : m_mesh->edges()){
Edge edge = m_mesh->get<Edge>(e);
if(edge.length() < m_minEdgeLength){
Expand Down Expand Up @@ -738,7 +738,7 @@ std::vector<TCellID> EllipticMorph::noExteriorLock(){
}

if (!intersectedFaces.empty()) {
double distance = MAXFLOAT;
double distance = std::numeric_limits<double>::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);
Expand Down Expand Up @@ -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 ------------- "<<AFilename<<std::endl;

gmds::IGMeshIOService ioService(m_mesh);
gmds::VTKWriter w(&ioService);
w.setCellOptions(gmds::N | gmds::R);
w.setDataOptions(gmds::N | gmds::R);
w.write(AFilename);
}
/*----------------------------------------------------------------------------*/

0 comments on commit f7d884e

Please sign in to comment.