#include <algorithm>
#include <iostream>
-#include <math.h> // for HUGE constant
+#include <limits>
const int MIN_NB_ELEMS =15;
const int MAX_LEVEL=20;
new_elems_left.reserve(nbelems/2+1);
new_elems_right.reserve(nbelems/2+1);
- double max_left=-HUGE;
- double min_right=HUGE;
+ double max_left = -std::numeric_limits<double>::max();
+ double min_right= std::numeric_limits<double>::max();
for (int i=0; i<nbelems;i++)
{
int elem;
Node.cxx \
QuadraticPolygon.cxx
+salomeinclude_HEADERS = \
+AbstractEdge.hxx \
+Bounds.hxx \
+Precision.hxx \
+ComposedEdge.hxx \
+EdgeArcCircle.hxx \
+Edge.hxx \
+EdgeInfLin.hxx \
+EdgeLin.hxx \
+ElementaryEdge.hxx \
+Node.hxx \
+QuadraticPolygon.hxx \
+ComposedEdgeWithIt.hxx \
+Edge.txx
+
libInterpGeometric2DAlg_la_CPPFLAGS = -I$(srcdir)/..
double N=P1_P2*P1_P2+P3_P1*P3_P1-P2_P3*P2_P3;
double D=2.0*P1_P2*P3_P1;
double COS=N/D;
+ if (COS>1.0) COS=1.0;
+ if (COS<-1.0) COS=-1.0;
Vect.push_back(COS);
double V=mon_determinant(P_2,P_3,P_1);
double D_1=P1_P2*P3_P1;
double SIN=V/D_1;
+ if (SIN>1.0) SIN=1.0;
+ if (SIN<-1.0) SIN=-1.0;
Vect.push_back(SIN);
return Vect;
template<int DIM, NumberingPolicy numPol, class MyMeshType>
inline void getElemBB(double* bb, const double *coordsOfMesh, int iP, int nb_nodes)
{
- bb[0]=HUGE;bb[1]=-HUGE;
- bb[2]=HUGE;bb[3]=-HUGE;
- bb[4]=HUGE;bb[5]=-HUGE;
-
+ bb[0]=std::numeric_limits<double>::max();
+ bb[1]=-std::numeric_limits<double>::max();
+ bb[2]=std::numeric_limits<double>::max();
+ bb[3]=-std::numeric_limits<double>::max();
+ bb[4]=std::numeric_limits<double>::max();
+ bb[5]=-std::numeric_limits<double>::max();
+
for (int i=0; i<nb_nodes; i++)
{
double x = coordsOfMesh[3*(iP+i)];
salomeinclude_HEADERS = \
-Interpolation.hxx\
-Interpolation3D.hxx\
-Interpolation2D.hxx\
-Interpolation3DSurf.hxx\
-Remapper.hxx\
-PointLocator.hxx
+BoundingBox.hxx IntersectorTetra.hxx Remapper.hxx \
+ConvexIntersector.hxx Log.hxx TargetIntersector.hxx\
+Geometric2DIntersector.hxx MEDNormalizedUnstructuredMesh.hxx TetraAffineTransform.hxx\
+InterpKernelMatrix.hxx MeshElement.hxx TransformedTriangle.hxx\
+Interpolation2D.hxx MeshRegion.hxx TransformedTriangle_inline.hxx\
+Interpolation3D.hxx MeshUtils.hxx TranslationRotationMatrix.hxx\
+Interpolation3DSurf.hxx NormalizedUnstructuredMesh.hxx TriangulationIntersector.hxx\
+Interpolation.hxx PlanarIntersector.hxx VectorUtils.hxx\
+InterpolationPlanar.hxx PointLocator.hxx VTKNormalizedUnstructuredMesh.hxx\
+InterpolationUtils.hxx PolygonAlgorithms.hxx\
+IntersectorHexa.hxx RegionNode.hxx\
+BBTree.txx InterpolationPlanar.txx PlanarIntersector.txx\
+ConvexIntersector.txx IntersectorHexa.txx PointLocatorAlgos.txx\
+Geometric2DIntersector.txx IntersectorTetra.txx PolygonAlgorithms.txx\
+Interpolation2D.txx MEDNormalizedUnstructuredMesh.txx TriangulationIntersector.txx\
+Interpolation3DSurf.txx MeshElement.txx VTKNormalizedUnstructuredMesh.txx\
+Interpolation3D.txx MeshRegion.txx
# Libraries targets
#include "TranslationRotationMatrix.hxx"
#include <iostream>
+#include <limits>
namespace INTERP_KERNEL
{
//initializing bounding box limits
for(int idim=0; idim<SPACEDIM; idim++)
{
- bbox[2*SPACEDIM*ibox+2*idim] = HUGE;
- bbox[2*SPACEDIM*ibox+2*idim+1] = -HUGE;
+ bbox[2*SPACEDIM*ibox+2*idim] = std::numeric_limits<double>::max();
+ bbox[2*SPACEDIM*ibox+2*idim+1] = -std::numeric_limits<double>::max();
}
//updating the bounding box with each node of the element
for (int j=0; j<nb_nodes_per_elem; j++)
//initializing bounding box limits
for(int idim=0; idim<SPACEDIM; idim++)
{
- bb[2*idim ] = HUGE;
- bb[2*idim+1] = -HUGE;
+ bb[2*idim ] = std::numeric_limits<double>::max();
+ bb[2*idim+1] = -std::numeric_limits<double>::max();
}
for (ConnType i=0; i<nb_nodes; i++)
long size = bbox.size()/(2*SPACEDIM);
for (int i=0; i<size; i++)
{
- double max=-HUGE;
+ double max=- std::numeric_limits<double>::max();
for(int idim=0; idim<SPACEDIM; idim++)
{
double Dx=bbox[i*2*SPACEDIM+1+2*idim]-bbox[i*2*SPACEDIM+2*idim];
delete _point_locator;
}
- std::list<int> PointLocator::locate(const double* x)
+std::list<int> PointLocator::locate(const double* x)
{
return _point_locator->locates(x);
}
#include "CellModel.hxx"
#include "BBTree.txx"
#include <list>
+#include <limits>
namespace INTERP_KERNEL{
{
for (int idim=0; idim<SPACEDIM; idim++)
{
- _bb[2*(i*SPACEDIM+idim)]=HUGE;
- _bb[2*(i*SPACEDIM+idim)+1]=-HUGE;
+ _bb[2*(i*SPACEDIM+idim)]=std::numeric_limits<double>::max();
+ _bb[2*(i*SPACEDIM+idim)+1]=-std::numeric_limits<double>::max();
}
for (int index= conn_index[i]; index < conn_index[i+1];index++)
{
MultiElementTetraTests.hxx \
HexaTests.hxx \
MeshTestToolkit.hxx \
+ MeshTestToolkit.txx \
BBTreeTest.hxx \
RemapperTest.hxx \
SingleElementPlanarTests.hxx \
MultiElement2DTests.hxx \
- InterpolationPlanarTestSuite.hxx \
+ InterpolationPlanarTestSuite.hxx \
+ PointLocatorTest.hxx \
+ MEDMeshMaker.hxx \
QuadraticPlanarInterpTest.hxx
+
EXTRA_DIST += BasicMainTest.hxx
dist_libInterpKernelTest_la_SOURCES= \
#include "MEDMEM_Meshing.hxx"
#include <set>
+#include <limits>
using namespace std;
-//const double HUGE=1e200;
+
namespace ParaMEDMEM
{
{
for (int i=0; i<dim; i++)
{
- elem_bb[i*2]=HUGE;
- elem_bb[i*2+1]=-HUGE;
+ elem_bb[i*2]=std::numeric_limits<double>::max();
+ elem_bb[i*2+1]=-std::numeric_limits<double>::max();
}
for (int inode=conn_index[ielem]; inode<conn_index[ielem+1]; inode++)
{
double * minmax=new double [2*dim];
for (int idim=0; idim<dim; idim++)
{
- minmax[idim*2]=HUGE;
- minmax[idim*2+1]=-HUGE;
+ minmax[idim*2]=std::numeric_limits<double>::max();
+ minmax[idim*2+1]=-std::numeric_limits<double>::max();
}
for (int i=0; i<nbnodes; i++)
for (int idim=0; idim<dim;idim++)
default:
throw MEDMEM::MEDEXCEPTION("incompatible Trio field - wrong nb of nodes per elem");
}
+ break;
default:
throw MEDMEM::MEDEXCEPTION("incompatible Trio field - wrong mesh dimension");
}