From: Anthony Geay Date: Mon, 18 Jan 2016 12:27:25 +0000 (+0100) Subject: Remove checkCoherency2. X-Git-Tag: V8_0_0b1~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d7e08453a58c589f0979f7596fe62e4a7e4d9cc3;p=tools%2Fmedcoupling.git Remove checkCoherency2. --- diff --git a/doc/user/doxygen/fakesources/MEDCouplingMesh.C b/doc/user/doxygen/fakesources/MEDCouplingMesh.C index 4809eec6b..b5742182d 100644 --- a/doc/user/doxygen/fakesources/MEDCouplingMesh.C +++ b/doc/user/doxygen/fakesources/MEDCouplingMesh.C @@ -114,7 +114,6 @@ namespace ParaMEDMEM MEDCouplingMesh::buildUnstructured() const; MEDCouplingMesh::checkCoherency() const; MEDCouplingMesh::checkCoherency1(double eps=1e-12) const; - MEDCouplingMesh::checkCoherency2(double eps=1e-12) const; MEDCouplingMesh::checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const; MEDCouplingMesh::checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec,DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const; MEDCouplingMesh::checkTypeConsistencyAndContig(const std::vector& code, const std::vector& idsPerType) const; diff --git a/doc/user/doxygen/fakesources/MEDCouplingUMesh.C b/doc/user/doxygen/fakesources/MEDCouplingUMesh.C index e99a55189..6917da030 100644 --- a/doc/user/doxygen/fakesources/MEDCouplingUMesh.C +++ b/doc/user/doxygen/fakesources/MEDCouplingUMesh.C @@ -105,7 +105,6 @@ MEDCouplingUMesh::buildSlice3D(const double *origin, const double *vec, double e MEDCouplingUMesh::buildSlice3DSurf(const double *origin, const double *vec, double eps, DataArrayInt *&cellIds) const; MEDCouplingUMesh::checkCoherency() const; MEDCouplingUMesh::checkCoherency1(double eps=1e-12) const; -MEDCouplingUMesh::checkCoherency2(double eps=1e-12) const; //MEDCouplingUMesh::checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,DataArrayInt *&cellCor) const; //MEDCouplingUMesh::checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec,DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const; MEDCouplingUMesh::checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const; diff --git a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx index c59a09a1f..24a02d598 100644 --- a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx +++ b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx @@ -690,11 +690,6 @@ void MEDCoupling1SGTUMesh::checkCoherency1(double eps) const } } -void MEDCoupling1SGTUMesh::checkCoherency2(double eps) const -{ - checkCoherency1(eps); -} - int MEDCoupling1SGTUMesh::getNumberOfCells() const { int nbOfTuples=getNodalConnectivityLength(); @@ -2420,11 +2415,6 @@ void MEDCoupling1DGTUMesh::checkCoherency1(double eps) const } } -void MEDCoupling1DGTUMesh::checkCoherency2(double eps) const -{ - checkCoherency1(eps); -} - int MEDCoupling1DGTUMesh::getNumberOfCells() const { checkCoherencyOfConnectivity();//do not remove @@ -2862,7 +2852,7 @@ MEDCouplingPointSet *MEDCoupling1DGTUMesh::buildPartOfMySelfKeepCoords2(int star void MEDCoupling1DGTUMesh::computeNodeIdsAlg(std::vector& nodeIdsInUse) const { - checkCoherency2(); + checkCoherency1(); int sz((int)nodeIdsInUse.size()); for(const int *conn=_conn->begin();conn!=_conn->end();conn++) { @@ -3071,7 +3061,7 @@ void MEDCoupling1DGTUMesh::unserialization(const std::vector& tinyInfoD, */ DataArrayInt *MEDCoupling1DGTUMesh::computeFetchedNodeIds() const { - checkCoherency2(); + checkCoherency1(); int nbNodes(getNumberOfNodes()); std::vector fetchedNodes(nbNodes,false); computeNodeIdsAlg(fetchedNodes); diff --git a/src/MEDCoupling/MEDCoupling1GTUMesh.hxx b/src/MEDCoupling/MEDCoupling1GTUMesh.hxx index 106a0c6bd..ab90d1c8f 100644 --- a/src/MEDCoupling/MEDCoupling1GTUMesh.hxx +++ b/src/MEDCoupling/MEDCoupling1GTUMesh.hxx @@ -107,7 +107,6 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const; MEDCOUPLING_EXPORT void checkCoherency() const; MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const; - MEDCOUPLING_EXPORT void checkCoherency2(double eps=1e-12) const; MEDCOUPLING_EXPORT int getNumberOfCells() const; MEDCOUPLING_EXPORT DataArrayInt *computeNbOfNodesPerCell() const; MEDCOUPLING_EXPORT DataArrayInt *computeNbOfFacesPerCell() const; @@ -203,7 +202,6 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const; MEDCOUPLING_EXPORT void checkCoherency() const; MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const; - MEDCOUPLING_EXPORT void checkCoherency2(double eps=1e-12) const; MEDCOUPLING_EXPORT int getNumberOfCells() const; MEDCOUPLING_EXPORT DataArrayInt *computeNbOfNodesPerCell() const; MEDCOUPLING_EXPORT DataArrayInt *computeNbOfFacesPerCell() const; diff --git a/src/MEDCoupling/MEDCouplingCMesh.cxx b/src/MEDCoupling/MEDCouplingCMesh.cxx index 0e7d7f66e..44825579a 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCMesh.cxx @@ -283,11 +283,6 @@ void MEDCouplingCMesh::checkCoherency1(double eps) const _z_array->checkMonotonic(true, eps); } -void MEDCouplingCMesh::checkCoherency2(double eps) const -{ - checkCoherency1(eps); -} - void MEDCouplingCMesh::getNodeGridStructure(int *res) const { std::vector ret(getNodeGridStructure()); diff --git a/src/MEDCoupling/MEDCouplingCMesh.hxx b/src/MEDCoupling/MEDCouplingCMesh.hxx index ec77efdd0..27c9a1b58 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.hxx +++ b/src/MEDCoupling/MEDCouplingCMesh.hxx @@ -49,7 +49,6 @@ namespace ParaMEDMEM DataArrayInt *&cellCor) const; MEDCOUPLING_EXPORT void checkCoherency() const; MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const; - MEDCOUPLING_EXPORT void checkCoherency2(double eps=1e-12) const; MEDCOUPLING_EXPORT int getSpaceDimension() const; MEDCOUPLING_EXPORT void getCoordinatesOfNode(int nodeId, std::vector& coo) const; MEDCOUPLING_EXPORT std::string simpleRepr() const; diff --git a/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx b/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx index abdd6fedd..fa1266409 100644 --- a/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx @@ -205,11 +205,6 @@ void MEDCouplingCurveLinearMesh::checkCoherency1(double eps) const checkCoherency(); } -void MEDCouplingCurveLinearMesh::checkCoherency2(double eps) const -{ - checkCoherency1(eps); -} - int MEDCouplingCurveLinearMesh::getNumberOfCells() const { checkCoherency(); diff --git a/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx b/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx index 9f7fbad51..dc99a81c8 100644 --- a/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx +++ b/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx @@ -47,7 +47,6 @@ namespace ParaMEDMEM DataArrayInt *&cellCor) const; MEDCOUPLING_EXPORT void checkCoherency() const; MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const; - MEDCOUPLING_EXPORT void checkCoherency2(double eps=1e-12) const; MEDCOUPLING_EXPORT int getNumberOfCells() const; MEDCOUPLING_EXPORT int getNumberOfNodes() const; MEDCOUPLING_EXPORT int getSpaceDimension() const; diff --git a/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx b/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx index 364fa8811..a1bbb90a0 100644 --- a/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx +++ b/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx @@ -396,11 +396,6 @@ void MEDCouplingExtrudedMesh::checkCoherency1(double eps) const checkCoherency(); } -void MEDCouplingExtrudedMesh::checkCoherency2(double eps) const -{ - checkCoherency1(eps); -} - void MEDCouplingExtrudedMesh::getBoundingBox(double *bbox) const { double bbox2D[6]; diff --git a/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx b/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx index f436e434d..8a441aaef 100644 --- a/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx +++ b/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx @@ -67,7 +67,6 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT std::string advancedRepr() const; MEDCOUPLING_EXPORT void checkCoherency() const; MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const; - MEDCOUPLING_EXPORT void checkCoherency2(double eps=1e-12) const; MEDCOUPLING_EXPORT void getBoundingBox(double *bbox) const; MEDCOUPLING_EXPORT void updateTime() const; MEDCOUPLING_EXPORT void renumberCells(const int *old2NewBg, bool check=true); diff --git a/src/MEDCoupling/MEDCouplingIMesh.cxx b/src/MEDCoupling/MEDCouplingIMesh.cxx index cd68a17da..745c6aa44 100644 --- a/src/MEDCoupling/MEDCouplingIMesh.cxx +++ b/src/MEDCoupling/MEDCouplingIMesh.cxx @@ -949,11 +949,6 @@ void MEDCouplingIMesh::checkCoherency1(double eps) const checkCoherency(); } -void MEDCouplingIMesh::checkCoherency2(double eps) const -{ - checkCoherency1(eps); -} - void MEDCouplingIMesh::getNodeGridStructure(int *res) const { checkSpaceDimension(); diff --git a/src/MEDCoupling/MEDCouplingIMesh.hxx b/src/MEDCoupling/MEDCouplingIMesh.hxx index a9a1eb5f1..7dd522467 100644 --- a/src/MEDCoupling/MEDCouplingIMesh.hxx +++ b/src/MEDCoupling/MEDCouplingIMesh.hxx @@ -70,7 +70,6 @@ namespace ParaMEDMEM DataArrayInt *&cellCor) const; MEDCOUPLING_EXPORT void checkCoherency() const; MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const; - MEDCOUPLING_EXPORT void checkCoherency2(double eps=1e-12) const; MEDCOUPLING_EXPORT int getSpaceDimension() const; MEDCOUPLING_EXPORT void getCoordinatesOfNode(int nodeId, std::vector& coo) const; MEDCOUPLING_EXPORT std::string simpleRepr() const; diff --git a/src/MEDCoupling/MEDCouplingMesh.hxx b/src/MEDCoupling/MEDCouplingMesh.hxx index 817b8d0cd..97cc7dea7 100644 --- a/src/MEDCoupling/MEDCouplingMesh.hxx +++ b/src/MEDCoupling/MEDCouplingMesh.hxx @@ -85,7 +85,6 @@ namespace ParaMEDMEM // MEDCOUPLING_EXPORT virtual void checkCoherency() const = 0; MEDCOUPLING_EXPORT virtual void checkCoherency1(double eps=1e-12) const = 0; - MEDCOUPLING_EXPORT virtual void checkCoherency2(double eps=1e-12) const = 0; MEDCOUPLING_EXPORT virtual int getNumberOfCells() const = 0; MEDCOUPLING_EXPORT virtual int getNumberOfNodes() const = 0; MEDCOUPLING_EXPORT virtual int getSpaceDimension() const = 0; diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index 7ba64d25a..66153a584 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -282,27 +282,6 @@ void MEDCouplingUMesh::checkCoherency1(double eps) const } } - -/*! - * Checks if \a this mesh is well defined. If no exception is thrown by this method, - * then \a this mesh is most probably is writable, exchangeable and available for all - * algorithms.
This method performs the same checks as checkCoherency1() does. - * \param [in] eps - a not used parameter. - * \throw If the mesh dimension is not set. - * \throw If the coordinates array is not set (if mesh dimension != -1 ). - * \throw If \a this mesh contains elements of dimension different from the mesh dimension. - * \throw If the connectivity data array has more than one component. - * \throw If the connectivity data array has a named component. - * \throw If the connectivity index data array has more than one component. - * \throw If the connectivity index data array has a named component. - * \throw If number of nodes defining an element does not correspond to the type of element. - * \throw If the nodal connectivity includes an invalid node id. - */ -void MEDCouplingUMesh::checkCoherency2(double eps) const -{ - checkCoherency1(eps); -} - /*! * Sets dimension of \a this mesh. The mesh dimension in general depends on types of * elements contained in the mesh. For more info on the mesh dimension see @@ -6275,7 +6254,7 @@ DataArrayInt *MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells() /*! * This method is a faster method to correct orientation of all 3D cells in \a this. * This method works only if \a this is a 3D mesh, that is to say a mesh with mesh dimension 3 and a space dimension 3. - * This method makes the hypothesis that \a this a coherent that is to say MEDCouplingUMesh::checkCoherency2 should throw no exception. + * This method makes the hypothesis that \a this a coherent that is to say MEDCouplingUMesh::checkCoherency1 should throw no exception. * * \return a newly allocated int array with one components containing cell ids renumbered to fit the convention of MED (MED file and MEDCoupling) * \sa MEDCouplingUMesh::orientCorrectlyPolyhedrons, @@ -7423,7 +7402,7 @@ DataArrayInt *MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh() co */ void MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh(DataArrayInt *&nodalConn, DataArrayInt *&nodalConnIndex) const { - static const char msg0[]="MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh : nodal connectivity in this are invalid ! Call checkCoherency2 !"; + static const char msg0[]="MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh : nodal connectivity in this are invalid ! Call checkCoherency1 !"; checkConnectivityFullyDefined(); if(_types.size()!=1) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh : current mesh does not contain exactly one geometric type !"); @@ -8415,7 +8394,7 @@ bool MEDCouplingUMesh::IsTetra4WellOriented(const int *begin, const int *end, co { std::size_t sz=std::distance(begin,end); if(sz!=4) - throw INTERP_KERNEL::Exception("MEDCouplingUMesh::IsTetra4WellOriented : Tetra4 cell with not 4 nodes ! Call checkCoherency2 !"); + throw INTERP_KERNEL::Exception("MEDCouplingUMesh::IsTetra4WellOriented : Tetra4 cell with not 4 nodes ! Call checkCoherency1 !"); double vec0[3],vec1[3]; const double *pt0=coords+3*begin[0],*pt1=coords+3*begin[1],*pt2=coords+3*begin[2],*pt3=coords+3*begin[3]; vec0[0]=pt1[0]-pt0[0]; vec0[1]=pt1[1]-pt0[1]; vec0[2]=pt1[2]-pt0[2]; vec1[0]=pt2[0]-pt0[0]; vec1[1]=pt2[1]-pt0[1]; vec1[2]=pt2[2]-pt0[2]; @@ -8426,7 +8405,7 @@ bool MEDCouplingUMesh::IsPyra5WellOriented(const int *begin, const int *end, con { std::size_t sz=std::distance(begin,end); if(sz!=5) - throw INTERP_KERNEL::Exception("MEDCouplingUMesh::IsPyra5WellOriented : Pyra5 cell with not 5 nodes ! Call checkCoherency2 !"); + throw INTERP_KERNEL::Exception("MEDCouplingUMesh::IsPyra5WellOriented : Pyra5 cell with not 5 nodes ! Call checkCoherency1 !"); double vec0[3]; INTERP_KERNEL::areaVectorOfPolygon(begin,4,coords,vec0); const double *pt0=coords+3*begin[0],*pt1=coords+3*begin[4]; diff --git a/src/MEDCoupling/MEDCouplingUMesh.hxx b/src/MEDCoupling/MEDCouplingUMesh.hxx index d1e94f506..ed8dd7f39 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.hxx +++ b/src/MEDCoupling/MEDCouplingUMesh.hxx @@ -57,7 +57,6 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const; MEDCOUPLING_EXPORT void checkCoherency() const; MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const; - MEDCOUPLING_EXPORT void checkCoherency2(double eps=1e-12) const; MEDCOUPLING_EXPORT void setMeshDimension(int meshDim); MEDCOUPLING_EXPORT void allocateCells(int nbOfCells=0); MEDCOUPLING_EXPORT void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, const int *nodalConnOfCell); diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx index 49d3ed779..6a7a1a48e 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx @@ -2400,7 +2400,7 @@ void MEDCouplingBasicsTest1::testCMesh1() CPPUNIT_ASSERT(!mesh1->isEqual(mesh2,1e-7)); CPPUNIT_ASSERT_THROW(mesh3->checkCoherency1(1e-12),INTERP_KERNEL::Exception); - mesh1->checkCoherency2(1e-12); + mesh1->checkCoherency1(1e-12); CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_HEXA8,mesh1->getTypeOfCell(1)); CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_HEXA8,*((mesh1->getAllGeoTypes()).begin())); diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx index b9c49c424..cd82d5fc8 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx @@ -1645,7 +1645,7 @@ void MEDCouplingBasicsTest4::testConvertExtrudedPolyhedra1() const int expected2[10]={0,5,14,19,42,49,86,95,108,159}; CPPUNIT_ASSERT(std::equal(expected1,expected1+159,da->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected2,expected2+10,dai->getConstPointer())); - m->checkCoherency2(); + m->checkCoherency1(); // m->decrRef(); } diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest5.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest5.cxx index cc222a024..0d2884094 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest5.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest5.cxx @@ -2002,11 +2002,11 @@ void MEDCouplingBasicsTest5::testSimplexize3() c->useArray(coords,false,CPP_DEALLOC,24,3); m->setCoords(c); c->decrRef(); - m->checkCoherency2(); + m->checkCoherency1(); // MEDCouplingUMesh *m1=static_cast(m->deepCpy()); DataArrayInt *d1=m1->simplexize(INTERP_KERNEL::PLANAR_FACE_5); - m1->checkCoherency2(); + m1->checkCoherency1(); MEDCouplingFieldDouble *f1=m1->getMeasureField(ON_CELLS); const double vol1Expected[12]={1./6, 1./6, 1./6,1./6, 1./6, 1./3,1./6, 1./6, 1./6, 1./6, 1./3, 1./6}; CPPUNIT_ASSERT_EQUAL(1,f1->getArray()->getNumberOfComponents()); @@ -2031,7 +2031,7 @@ void MEDCouplingBasicsTest5::testSimplexize3() // MEDCouplingUMesh *m2=static_cast(m->deepCpy()); DataArrayInt *d2=m2->simplexize(INTERP_KERNEL::PLANAR_FACE_6); - m2->checkCoherency2(); + m2->checkCoherency1(); MEDCouplingFieldDouble *f2=m2->getMeasureField(ON_CELLS); const double vol2Expected[14]={1./6, 1./6, 1./6,1./6, 1./6, 1./6,1./6,1./6, 1./6, 1./6, 1./6, 1./6,1./6,1./6}; CPPUNIT_ASSERT_EQUAL(1,f2->getArray()->getNumberOfComponents()); diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest1.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest1.py index ad43c4491..7c00c5653 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest1.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest1.py @@ -1846,7 +1846,7 @@ class MEDCouplingBasicsTest1(unittest.TestCase): self.assertTrue(not mesh1.isEqual(mesh2, 1e-7)); self.assertRaises(InterpKernelException, mesh3.checkCoherency1, 1e-12); - mesh1.checkCoherency2(1e-12); + mesh1.checkCoherency1(1e-12); self.assertEqual(NORM_HEXA8, mesh1.getTypeOfCell(1)); self.assertEqual(NORM_HEXA8, mesh1.getAllGeoTypes()[0]); diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest3.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest3.py index 4e015d958..f6c1c70a7 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest3.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest3.py @@ -2023,7 +2023,7 @@ class MEDCouplingBasicsTest3(unittest.TestCase): expected2=[0,5,14,19,42,49,86,95,108,159] self.assertEqual(expected1,da.getValues()); self.assertEqual(expected2,dai.getValues()); - m.checkCoherency2() + m.checkCoherency1() pass def testNonRegressionCopyTinyStrings(self): diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest4.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest4.py index ee374ac67..9dc1f9926 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest4.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest4.py @@ -2105,7 +2105,7 @@ class MEDCouplingBasicsTest4(unittest.TestCase): m.setCoords(coords) m.allocateCells(0) m.insertNextCell(NORM_QUAD4,[0,1,2,3]) - m.checkCoherency2() + m.checkCoherency1() self.assertEqual([4,0,1,2,3],m.getNodalConnectivity().getValues()) a,b=m.distanceToPoint([5.,2.,0.1]) self.assertAlmostEqual(0.1,a,14) ; self.assertEqual(0,b) @@ -2113,7 +2113,7 @@ class MEDCouplingBasicsTest4(unittest.TestCase): self.assertAlmostEqual(sqrt(2*2+4*4),a,14) ; self.assertEqual(0,b) m.allocateCells(0) m.insertNextCell(NORM_POLYGON,[0,1,2,3]) - m.checkCoherency2() + m.checkCoherency1() self.assertEqual([5,0,1,2,3],m.getNodalConnectivity().getValues()) a,b=m.distanceToPoint([11.,3.,4.]) self.assertAlmostEqual(sqrt(3*3+4*4),a,14) ; self.assertEqual(0,b) @@ -2224,11 +2224,11 @@ class MEDCouplingBasicsTest4(unittest.TestCase): c4=c1+[6.,0.,0.] c=DataArrayDouble.Aggregate([c1,c2,c3,c4]) m.setCoords(c) - m.checkCoherency2() + m.checkCoherency1() # m1=m.deepCpy() d1=m1.simplexize(PLANAR_FACE_5) - m1.checkCoherency2() + m1.checkCoherency1() vol1=m1.getMeasureField(ON_CELLS).getArray() self.assertTrue(vol1.isEqual(DataArrayDouble([1./6, 1./6, 1./6,1./6, 1./6, 1./3,1./6, 1./6, 1./6, 1./6, 1./3, 1./6]),1e-12)) self.assertEqual(m1.getNodalConnectivity().getValues(),[14,0,1,2,3,14,4,9,5,6,14,4,8,9,11,14,4,7,11,6,14,9,11,10,6,14,4,9,6,11,14,12,17,13,14,14,12,16,17,19,14,12,15,19,14,14,17,19,18,14,14,12,17,14,19,14,20,21,22,23]) @@ -2237,7 +2237,7 @@ class MEDCouplingBasicsTest4(unittest.TestCase): # m2=m.deepCpy() d2=m2.simplexize(PLANAR_FACE_6) - m2.checkCoherency2() + m2.checkCoherency1() vol2=m2.getMeasureField(ON_CELLS).getArray() self.assertTrue(vol2.isEqual(DataArrayDouble([1./6, 1./6, 1./6,1./6, 1./6, 1./6,1./6,1./6, 1./6, 1./6, 1./6, 1./6,1./6,1./6]),1e-12)) self.assertEqual(m2.getNodalConnectivity().getValues(),[14,0,1,2,3,14,4,9,5,10,14,4,5,6,10,14,4,8,9,10,14,4,11,8,10,14,4,6,7,10,14,4,7,11,10,14,12,17,13,18,14,12,13,14,18,14,12,16,17,18,14,12,19,16,18,14,12,14,15,18,14,12,15,19,18,14,20,21,22,23]) @@ -2256,7 +2256,7 @@ class MEDCouplingBasicsTest4(unittest.TestCase): cl=MEDCouplingCurveLinearMesh() cl.setCoords(coo) cl.setNodeGridStructure([4,3]) - cl.checkCoherency2() + cl.checkCoherency1() li1=[1.,2.,4.,0.5,1.,2.] self.assertTrue(cl.getMeasureField(False).getArray().isEqual(DataArrayDouble(li1),1e-14)) self.assertTrue(u.getMeasureField(False).getArray().isEqual(DataArrayDouble(li1),1e-14)) @@ -2270,7 +2270,7 @@ class MEDCouplingBasicsTest4(unittest.TestCase): cl=MEDCouplingCurveLinearMesh() cl.setCoords(coo) cl.setNodeGridStructure([4,3,3]) - cl.checkCoherency2() + cl.checkCoherency1() li2=[1.,2.,4.,0.5, 1.,2.,0.5,1.,2.,0.25,0.5,1.] li2_1=[0.5,0.5,0.5,2.,0.5,0.5,5.,0.5,0.5,0.5,1.25,0.5,2.,1.25,0.5,5.,1.25,0.5,0.5,0.5,1.25,2.,0.5,1.25,5.,0.5,1.25,0.5,1.25,1.25,2.,1.25,1.25,5.,1.25,1.25] self.assertTrue(cl.getMeasureField(False).getArray().isEqual(DataArrayDouble(li2),1e-14)) @@ -2282,7 +2282,7 @@ class MEDCouplingBasicsTest4(unittest.TestCase): coo=coo*coo cl.setCoords(coo) cl.setNodeGridStructure([5]) - cl.checkCoherency2() + cl.checkCoherency1() li3=[1.,3.,5.,7.] li3_1=[0.5,2.5,6.5,12.5] self.assertTrue(cl.getMeasureField(False).getArray().isEqual(DataArrayDouble(li3),1e-14)) @@ -2292,7 +2292,7 @@ class MEDCouplingBasicsTest4(unittest.TestCase): #1D spaceDim 2 coo=DataArrayDouble.Meld(coo,coo) cl.setCoords(coo) - cl.checkCoherency2() + cl.checkCoherency1() li4=[sqrt(2.)*elt for elt in [1.,3.,5.,7.]] li4_1=[0.5,0.5,2.5,2.5,6.5,6.5,12.5,12.5] self.assertEqual(2,cl.getSpaceDimension()) diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest5.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest5.py index 10f6d5a53..6175c30b5 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest5.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest5.py @@ -261,7 +261,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): for i in xrange(24): m.insertNextCell(NORM_QUAD4,conn[4*i:4*i+4]) pass - m.checkCoherency2() + m.checkCoherency1() m0=m[3] ; m0.zipCoords() expectedDist=0.8452994616207476 a,b=m0.distanceToPoint(pt) @@ -331,7 +331,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): # spaceDim=3 QPOLYG becomes POLYG ... for the moment m.setCoords(m.getCoords().changeNbOfComponents(3,0.)) m2=m.deepCpy() - m2.convertQuadraticCellsToLinear() ; m2.checkCoherency2() + m2.convertQuadraticCellsToLinear() ; m2.checkCoherency1() self.assertTrue(m2.getAllGeoTypes()==[NORM_POLYGON] and m2.getNodalConnectivity().getValues()==[5,0,1,2,3,4]) self.assertAlmostEqual(float(m.getMeasureField(False).getArray()),float(m2.getMeasureField(False).getArray()),12) self.assertTrue(m.getBarycenterAndOwner().isEqual(m2.getBarycenterAndOwner(),1e-13)) @@ -591,7 +591,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): self.assertTrue(DataArrayInt([5]).isEqual(m.computeNbOfFacesPerCell())) m.__repr__() ; m.__str__() m.checkCoherency() - m.checkCoherency2() + m.checkCoherency1() # cm=MEDCouplingCMesh() ; cm.setName("m") arr0=DataArrayDouble(6) ; arr0.iota() @@ -641,7 +641,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): m1c=m1.convertIntoSingleGeoTypeMesh() self.assertTrue(isinstance(m1c,MEDCoupling1SGTUMesh)) self.assertEqual(m1c.getCoords().getHiddenCppPointer(),m.getCoords().getHiddenCppPointer()) - m1c.checkCoherency2() + m1c.checkCoherency1() self.assertTrue(m1c.getNodalConnectivity().isEqual(DataArrayInt([1,0,6,7,2,1,7,8,3,2,8,9,4,3,9,10,5,4,10,11]))) self.assertEqual(20,m1c.getNodalConnectivityLength()) self.assertTrue(m.isEqual(m1c,1e-12)) @@ -662,7 +662,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): m.setName("m2") self.assertTrue(not m.isEqual(m1c,1e-12) and m.isEqualWithoutConsideringStr(m1c,1e-12)) # - m.checkCoherency() ; m.checkCoherency1() ; m.checkCoherency2() + m.checkCoherency() ; m.checkCoherency1() ; m.checkCoherency1() self.assertEqual(m.getMeshDimension(),2) self.assertTrue(m.giveCellsWithType(NORM_QUAD4).isEqual(DataArrayInt([0,1,2,3,4]))) self.assertTrue(m.giveCellsWithType(NORM_TRI3).isEqual(DataArrayInt([]))) @@ -736,7 +736,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): self.assertTrue(m2.getNodalConnectivity().isEqual(DataArrayInt([1,0,6,7,2,1,7,8,3,2,8,9,4,3,9,10,5,4,10,11,1,0,6,7,26,25,31,32,27,26,32,33,25,24,30,31,29,28,34,35,28,27,33,34]))) ## mu=m.buildUnstructured() - mu.checkCoherency2() + mu.checkCoherency1() self.assertEqual(mu.getCoords().getHiddenCppPointer(),m.getCoords().getHiddenCppPointer()) self.assertEqual(2,mu.getMeshDimension()) self.assertEqual([NORM_QUAD4],mu.getAllGeoTypes()) @@ -774,7 +774,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): mcpy.getNodalConnectivity().setIJ(int(c3.getIdsEqual(11)),0,24) c2=DataArrayDouble.Aggregate([mcpy.getCoords(),mcpy.getCoords()[11:]]) mcpy.setCoords(c2) - mcpy.checkCoherency2() + mcpy.checkCoherency1() a,b=mcpy.getNodeIdsInUse() self.assertEqual(12,b) self.assertTrue(a.isEqual(DataArrayInt([0,1,2,3,4,5,6,7,8,9,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]))) @@ -782,7 +782,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): self.assertTrue(ids.isEqual(DataArrayInt([0,1,2,3,4,5,6,7,8,9,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]))) self.assertTrue(mcpy.getCoords().isEqual(ref[:12],1e-12)) self.assertTrue(mcpy.getNodalConnectivity().isEqual(c3)) - mcpy.checkCoherency2() + mcpy.checkCoherency1() ## m4=mcpy[DataArrayInt([0,3,4])] m5=mcpy.buildPartOfMySelfKeepCoords(DataArrayInt([0,3,4])) @@ -794,7 +794,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): self.assertTrue(m6.getNodalConnectivity().isEqual(DataArrayInt([1,0,6,7,3,2,8,9,5,4,10,11]))) ## mcpy.setCoords(DataArrayDouble.Aggregate([mcpy.getCoords(),mcpy.getCoords()])) - mcpy.checkCoherency2() + mcpy.checkCoherency1() ## mcppy=mcpy.deepCpyConnectivityOnly() self.assertTrue(mcppy.isEqual(mcpy,1e-12)) @@ -860,7 +860,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): self.assertTrue(DataArrayInt([2]).isEqual(m.computeNbOfFacesPerCell())) m.__repr__() ; m.__str__() m.checkCoherency() - m.checkCoherency2() + m.checkCoherency1() # cm=MEDCouplingCMesh() ; cm.setName("m") arr0=DataArrayDouble(6) ; arr0.iota() @@ -887,7 +887,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): m.insertNextCell([4,3,9,10,-1,5,3,9]) m.insertNextCell([5,4,10,11,-1,11,10,-1,5]) m.checkCoherency() - m.checkCoherency2() + m.checkCoherency1() self.assertEqual(5,m.getNumberOfCells()) self.assertTrue(m.getNodalConnectivityIndex().isEqual(DataArrayInt([0,8,19,23,31,40]))) self.assertTrue(m.getNodalConnectivity().isEqual(DataArrayInt([1,0,6,7,-1,7,6,1,2,1,7,8,-1,2,1,-1,8,-1,7,3,2,8,9,4,3,9,10,-1,5,3,9,5,4,10,11,-1,11,10,-1,5]))) @@ -944,7 +944,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): self.assertTrue(mcpy0.getNodalConnectivityIndex().isEqual(DataArrayInt([0,5,14,26,36,45]))) self.assertEqual(mcpy0.getAllGeoTypes(),[NORM_POLYHED]) mcpy0.checkCoherency() - mcpy0.checkCoherency2() + mcpy0.checkCoherency1() mcpy1=mcpy0.convertIntoSingleGeoTypeMesh() self.assertTrue(mcpy1.isEqual(m,1e-12)) # @@ -963,11 +963,11 @@ class MEDCouplingBasicsTest5(unittest.TestCase): self.assertTrue(m_mrg2.isPacked()) self.assertEqual(120,m_mrg2.getNodalConnectivityIndex().popBackSilent()) self.assertEqual(m_mrg2.getNumberOfCells(),14) - m_mrg2.checkCoherency2() + m_mrg2.checkCoherency1() self.assertTrue(not m_mrg2.isPacked()) m_mrg4,b=m_mrg2.copyWithNodalConnectivityPacked() self.assertTrue(not b) - m_mrg4.checkCoherency2() + m_mrg4.checkCoherency1() self.assertEqual(m_mrg4.getNumberOfCells(),14) self.assertTrue(m_mrg4.getNodalConnectivityIndex().isEqual(m_mrg2.getNodalConnectivityIndex())) self.assertEqual(len(m_mrg4.getNodalConnectivity()),111) @@ -1231,7 +1231,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): m.insertNextCell(NORM_PENTA6,[1,2,0,4,5,3]) st=m.getCoords().getHiddenCppPointer() c,a,b=m.tetrahedrize(PLANAR_FACE_5) - c.checkCoherency2() + c.checkCoherency1() self.assertTrue(a.isEqual(DataArrayInt([0,0,0]))) self.assertEqual(0,b) self.assertEqual(m.getCoords().getHiddenCppPointer(),c.getCoords().getHiddenCppPointer()) @@ -1244,7 +1244,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): m2.allocateCells() m2.insertNextCell(NORM_HEXGP12,[3,2,1,0,5,4,9,8,7,6,11,10]) c,a,b=m2.tetrahedrize(PLANAR_FACE_5) - c.checkCoherency2() + c.checkCoherency1() self.assertTrue(a.isEqual(DataArrayInt([0,0,0,0,0,0,0,0,0,0,0,0]))) self.assertEqual(0,b) self.assertEqual(c.getCoords().getHiddenCppPointer(),coords.getHiddenCppPointer()) @@ -1258,7 +1258,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): m3.insertNextCell(NORM_HEXA8,[3,2,1,0,7,6,5,4]) st=m3.getCoords().getHiddenCppPointer() c,a,b=m3.tetrahedrize(PLANAR_FACE_5) - c.checkCoherency2() + c.checkCoherency1() a.isEqual(DataArrayInt([0,0,0,0,0])) self.assertEqual(0,b) self.assertEqual(m3.getCoords().getHiddenCppPointer(),coords.getHiddenCppPointer()) @@ -1269,7 +1269,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): m4.allocateCells(0) m4.insertNextCell(NORM_HEXA8,[3,2,1,0,7,6,5,4]) c,a,b=m4.tetrahedrize(PLANAR_FACE_6) - c.checkCoherency2() + c.checkCoherency1() a.isEqual(DataArrayInt([0,0,0,0,0,0])) self.assertEqual(0,b) self.assertEqual(c.getCoords().getHiddenCppPointer(),coords.getHiddenCppPointer()) @@ -1281,7 +1281,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): m4.insertNextCell(NORM_HEXA8,[3,2,1,0,7,6,5,4]) st=m4.getCoords().getHiddenCppPointer() c,a,b=m4.tetrahedrize(GENERAL_24) - c.checkCoherency2() + c.checkCoherency1() a.isEqual(DataArrayInt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])) self.assertEqual(7,b) self.assertTrue(c.getCoords().getHiddenCppPointer()!=coords.getHiddenCppPointer()) @@ -1298,7 +1298,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): m6.insertNextCell(NORM_HEXA8,[3,2,1,0,7,6,5,4]) st=m6.getCoords().getHiddenCppPointer() c,a,b=m6.tetrahedrize(GENERAL_48) - c.checkCoherency2() + c.checkCoherency1() a.isEqual(DataArrayInt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])) self.assertEqual(19,b) self.assertTrue(c.getCoords().getHiddenCppPointer()!=coords.getHiddenCppPointer()) @@ -1315,7 +1315,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): m7.allocateCells() m7.insertNextCell(NORM_POLYHED,[3,2,1,0,5,4,-1,9,10,11,6,7,8,-1,3,9,8,2,-1,2,8,7,1,-1,1,7,6,0,-1,0,6,11,5,-1,5,11,10,4,-1,4,10,9,3]) c,a,b=m7.tetrahedrize(PLANAR_FACE_5) - c.checkCoherency2() + c.checkCoherency1() self.assertTrue(a.isEqual(DataArrayInt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]))) self.assertEqual(9,b) self.assertTrue(c.getNodalConnectivity().isEqual(DataArrayInt([3,2,12,20,2,1,12,20,1,0,12,20,0,5,12,20,5,4,12,20,4,3,12,20,9,10,13,20,10,11,13,20,11,6,13,20,6,7,13,20,7,8,13,20,8,9,13,20,3,9,14,20,9,8,14,20,8,2,14,20,2,3,14,20,2,8,15,20,8,7,15,20,7,1,15,20,1,2,15,20,1,7,16,20,7,6,16,20,6,0,16,20,0,1,16,20,0,6,17,20,6,11,17,20,11,5,17,20,5,0,17,20,5,11,18,20,11,10,18,20,10,4,18,20,4,5,18,20,4,10,19,20,10,9,19,20,9,3,19,20,3,4,19,20]))) @@ -1333,7 +1333,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): st=m8.getCoords().getHiddenCppPointer() c,a,b=m8.tetrahedrize(PLANAR_FACE_5) self.assertEqual(m8.getCoords().getHiddenCppPointer(),coords.getHiddenCppPointer()) - c.checkCoherency2() + c.checkCoherency1() self.assertTrue(a.isEqual(DataArrayInt([0,0]))) self.assertEqual(0,b) self.assertTrue(c.getNodalConnectivity().isEqual(DataArrayInt([3,2,1,7,3,1,0,7]))) @@ -1535,7 +1535,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): src.insertNextCell(NORM_HEXA8,[4,5,7,6,12,13,15,14]) src.insertNextCell(NORM_HEXA8,[8,9,12,11,16,17,20,19]) src.insertNextCell(NORM_HEXA8,[9,10,13,12,17,18,21,20]) - src.checkCoherency2() + src.checkCoherency1() # trg is useless here but I keep it in case of MEDCouplingRemapper were expected to do something about warped NORM_HEXA8 trgCoo=DataArrayDouble([0.0960891897852753,0.105088620541845,6.8598,0.0599574480546212,0.118434267436059,6.8598,0.113514510609589,0.14874473653263,6.8598,0.0831322609794463,0.167319109733883,6.8598,0.0960891897852753,0.105088620541845,6.92146666666667,0.0599574480546212,0.118434267436059,6.92146666666667,0.113514510609589,0.14874473653263,6.92146666666667,0.0831322609794463,0.167319109733883,6.92146666666667],8,3) trg=MEDCouplingUMesh("MESH",3) ; trg.setCoords(trgCoo) @@ -1614,7 +1614,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): m=MEDCouplingUMesh("Intersect2D",2) ; m.setCoords(coo) ; m.allocateCells() m.insertNextCell(NORM_POLYGON,[6,3,4,5]) m.insertNextCell(NORM_POLYGON,[4,0,1,2,6,5]) - m.checkCoherency2() + m.checkCoherency1() # self.assertTrue(m.getCellsContainingPoint((0.4,-0.4),1e-12).isEqual(DataArrayInt([0]))) self.assertTrue(m.getCellsContainingPoint((-0.4,-0.4),1e-12).isEqual(DataArrayInt([1]))) @@ -1630,7 +1630,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): m.insertNextCell(NORM_QPOLYG,[15,1,2,3,16,20,6,7,19,17]) m.insertNextCell(NORM_QPOLYG,[15,5,8,16,22,10,21,18]) m.insertNextCell(NORM_QPOLYG,[16,3,0,1,15,19,11,12,20,18]) - m.checkCoherency2() + m.checkCoherency1() self.assertTrue(m.getCellsContainingPoint([0.,0.27],1e-12).isEqual(DataArrayInt([2]))) pass @@ -2228,11 +2228,11 @@ class MEDCouplingBasicsTest5(unittest.TestCase): coo=DataArrayDouble([(0,0),(0,0.5),(0,1),(1,1),(1,0),(0.5,0)]) m=MEDCouplingUMesh("mesh",2) ; m.setCoords(coo) m.allocateCells() ; m.insertNextCell(NORM_POLYGON,[0,1,2,3,4,5]) - m.checkCoherency2() + m.checkCoherency1() refPtr=m.getCoords().getHiddenCppPointer() # m.colinearize2D(1e-12) - m.checkCoherency2() + m.checkCoherency1() self.assertEqual(refPtr,m.getCoords().getHiddenCppPointer()) self.assertTrue(m.getNodalConnectivity().isEqual(DataArrayInt([NORM_POLYGON,0,2,3,4]))) self.assertTrue(m.getNodalConnectivityIndex().isEqual(DataArrayInt([0,5]))) @@ -2246,7 +2246,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): c, cI = [DataArrayInt(l) for l in [[NORM_POLYGON, 0,1,2], [0,4]] ] m.setCoords(coo); m.setConnectivity(c, cI) m.colinearize2D(1e-10) - m.checkCoherency2() + m.checkCoherency1() self.assertEqual(c.getValues(), m.getNodalConnectivity().getValues()) self.assertEqual(cI.getValues(), m.getNodalConnectivityIndex().getValues()) @@ -2255,7 +2255,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): c, cI = [DataArrayInt(l) for l in [[NORM_QPOLYG, 0,1, 2,3], [0,5]] ] m.setCoords(coo); m.setConnectivity(c, cI) m.colinearize2D(1e-10) - m.checkCoherency2() + m.checkCoherency1() self.assertEqual(c.getValues(), m.getNodalConnectivity().getValues()) self.assertEqual(cI.getValues(), m.getNodalConnectivityIndex().getValues()) @@ -2264,7 +2264,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): c, cI = [DataArrayInt(l) for l in [[NORM_POLYGON, 0,1,2,3], [0,5]] ] m.setCoords(coo); m.setConnectivity(c, cI) m.colinearize2D(1e-10) - m.checkCoherency2() + m.checkCoherency1() self.assertEqual([NORM_POLYGON, 3,1,2], m.getNodalConnectivity().getValues()) self.assertEqual([0,4], m.getNodalConnectivityIndex().getValues()) @@ -2273,7 +2273,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): c, cI = [DataArrayInt(l) for l in [[NORM_QPOLYG, 0,1,3, 3,2,4], [0,7]] ] m.setCoords(coo); m.setConnectivity(c, cI) m.colinearize2D(1e-10) - m.checkCoherency2() + m.checkCoherency1() self.assertEqual([NORM_QPOLYG, 3,1, 5,2], m.getNodalConnectivity().getValues()) self.assertTrue( m.getCoords()[5].isEqual( DataArrayDouble([(1.5,0.0)]), 1.0e-12 ) ) self.assertEqual([0,5], m.getNodalConnectivityIndex().getValues()) @@ -2282,7 +2282,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): m = MEDCouplingDataForTest.buildCircle2(0.0, 0.0, 1.0) c, cI = [DataArrayInt(l) for l in [[NORM_QPOLYG, 7,5,3,1, 6,4,2,0], [0,9]] ] m.colinearize2D(1e-10) - m.checkCoherency2() + m.checkCoherency1() self.assertEqual([NORM_QPOLYG, 3,5, 8,4], m.getNodalConnectivity().getValues()) self.assertTrue( m.getCoords()[8].isEqual( DataArrayDouble([(1.0,0.0)]), 1.0e-12 ) ) self.assertEqual([0,5], m.getNodalConnectivityIndex().getValues()) @@ -2428,7 +2428,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): self.assertEqual(3,m.getMeshDimension()) self.assertAlmostEqual(0.125,m.getMeasureOfAnyCell(),16); mu=MEDCoupling1SGTUMesh(m.buildUnstructured()) - mu.checkCoherency2() + mu.checkCoherency1() cooExp=DataArrayDouble([(1.5,3.5,2.5),(2,3.5,2.5),(2.5,3.5,2.5),(1.5,3.75,2.5),(2,3.75,2.5),(2.5,3.75,2.5),(1.5,3.5,3.5),(2,3.5,3.5),(2.5,3.5,3.5),(1.5,3.75,3.5),(2,3.75,3.5),(2.5,3.75,3.5),(1.5,3.5,4.5),(2,3.5,4.5),(2.5,3.5,4.5),(1.5,3.75,4.5),(2,3.75,4.5),(2.5,3.75,4.5),(1.5,3.5,5.5),(2,3.5,5.5),(2.5,3.5,5.5),(1.5,3.75,5.5),(2,3.75,5.5),(2.5,3.75,5.5)]) ; cooExp.setInfoOnComponents(["X [m]","Y [m]","Z [m]"]) self.assertTrue(isinstance(mu,MEDCoupling1SGTUMesh)) self.assertEqual(NORM_HEXA8,mu.getCellModelEnum()) @@ -2486,7 +2486,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): self.assertEqual(12,m4.getNumberOfNodes()) self.assertEqual(6,m4.getNumberOfCells()) mu=MEDCoupling1SGTUMesh(m4.buildUnstructured()) - mu.checkCoherency2() + mu.checkCoherency1() self.assertTrue(isinstance(mu,MEDCoupling1SGTUMesh)) self.assertEqual(NORM_QUAD4,mu.getCellModelEnum()) coordsExp=DataArrayDouble([(1.5,2.5,3.5),(2,2.5,3.5),(2.5,2.5,3.5),(1.5,2.5,3.75),(2,2.5,3.75),(2.5,2.5,3.75),(1.5,2.5,4),(2,2.5,4),(2.5,2.5,4),(1.5,2.5,4.25),(2,2.5,4.25),(2.5,2.5,4.25)]) ; coordsExp.setInfoOnComponents(["X [km]","Y [km]","Z [km]"]) @@ -3631,7 +3631,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): coords2 = DataArrayDouble([float(i) for i in range(32)], 16,2) m2.setCoords(coords2); m2.setConnectivity(c, cI); - m2.checkCoherency2(1.0e-8); + m2.checkCoherency1(1.0e-8); # Shuffle a bit :-) m2.renumberCells(DataArrayInt([0,3,6,8,1,4,7,5,2]), True); @@ -3649,7 +3649,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): m3.setCoords(coord3) m3.setConnectivity(conn3A, cI) - m3.checkCoherency2(1.0e-8) + m3.checkCoherency1(1.0e-8) res2 = m3.orderConsecutiveCells1D() expRes2 = [0,1,2] self.assertEqual(m3.getNumberOfCells(),res2.getNumberOfTuples()) diff --git a/src/MEDCoupling_Swig/MEDCouplingCommon.i b/src/MEDCoupling_Swig/MEDCouplingCommon.i index 41372aaec..74b79d79b 100644 --- a/src/MEDCoupling_Swig/MEDCouplingCommon.i +++ b/src/MEDCoupling_Swig/MEDCouplingCommon.i @@ -562,7 +562,6 @@ namespace ParaMEDMEM virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception); virtual void checkCoherency() const throw(INTERP_KERNEL::Exception); virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception); - virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception); virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception); virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception); virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception); diff --git a/src/MEDCoupling_Swig/MEDCouplingRemapperTest.py b/src/MEDCoupling_Swig/MEDCouplingRemapperTest.py index 50157d00b..2edf0257f 100644 --- a/src/MEDCoupling_Swig/MEDCouplingRemapperTest.py +++ b/src/MEDCoupling_Swig/MEDCouplingRemapperTest.py @@ -173,7 +173,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): src.allocateCells(2) ; src.insertNextCell(NORM_TETRA4,[0,1,2,5]) ; src.insertNextCell(NORM_TETRA4,[3,4,0,6]) ; src.finishInsertingCells() trg=MEDCouplingCMesh() ; arr=DataArrayDouble([-0.7,-0.1,0.2,0.7,2.,2.3]) ; arr2=DataArrayDouble([-0.7,0.2,0.6,1.2,2.]) trg.setCoordsAt(0,arr) ; trg.setCoordsAt(1,arr) ; trg.setCoordsAt(2,arr2) - src.checkCoherency2(1e-10) + src.checkCoherency1(1e-10) trg.checkCoherency() fieldSrc=MEDCouplingFieldDouble(ON_CELLS,NO_TIME) ; fieldSrc.setMesh(src) ; arrSrc=DataArrayDouble([10.,30.]) fieldSrc.setNature(Integral) ; fieldSrc.setArray(arrSrc) @@ -229,7 +229,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): trg.allocateCells(2) ; trg.insertNextCell(NORM_TETRA4,[0,1,2,5]) ; trg.insertNextCell(NORM_TETRA4,[3,4,0,6]) ; trg.finishInsertingCells() src=MEDCouplingCMesh() ; arr=DataArrayDouble([-0.7,-0.1,0.2,0.7,2.,2.3]) ; arr2=DataArrayDouble([-0.7,0.2,0.6,1.2,2.]) src.setCoordsAt(0,arr) ; src.setCoordsAt(1,arr) ; src.setCoordsAt(2,arr2) - trg.checkCoherency2(1e-10) + trg.checkCoherency1(1e-10) src.checkCoherency() fieldSrc=MEDCouplingFieldDouble(ON_CELLS,NO_TIME) ; fieldSrc.setMesh(src) ; arrSrc=DataArrayDouble(100) ; arrSrc.iota(7.7) fieldSrc.setNature(Integral) ; fieldSrc.setArray(arrSrc) diff --git a/src/MEDLoader/Swig/CaseReader.py b/src/MEDLoader/Swig/CaseReader.py index 7fc267180..663e54ac4 100644 --- a/src/MEDLoader/Swig/CaseReader.py +++ b/src/MEDLoader/Swig/CaseReader.py @@ -61,7 +61,7 @@ class CaseReader(CaseIO): pass c=DataArrayInt(len(cells),nbNodesPerCell+1) ; c[:,0]=ct ; c[:,1:]=c2-1 ; c.rearrange(1) m.setConnectivity(c,cI,True) - m.checkCoherency2() + m.checkCoherency1() return m def __traduceMeshForPolyhed(self,name,coords,arr0,arr1,arr2): @@ -88,7 +88,7 @@ class CaseReader(CaseIO): c[a]=DataArrayInt(arr2) # m.setConnectivity(c,arr1mc1,True) - m.checkCoherency2() + m.checkCoherency1() return m def __traduceMeshForPolygon(self,name,coords,arr0,arr1): @@ -105,7 +105,7 @@ class CaseReader(CaseIO): c[arr0_2]=DataArrayInt(arr1-1) # m.setConnectivity(c,arr0_0,True) - m.checkCoherency2() + m.checkCoherency1() return m def __convertGeo2MED(self,geoFileName): diff --git a/src/MEDLoader/Swig/MEDLoaderTest3.py b/src/MEDLoader/Swig/MEDLoaderTest3.py index d702be45c..66dd108a2 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest3.py +++ b/src/MEDLoader/Swig/MEDLoaderTest3.py @@ -3539,7 +3539,7 @@ class MEDLoaderTest(unittest.TestCase): for elt in [[0,1,2,3,4,5],[1,2,3,4,5,6],[2,3,4,5,6,7],[3,4,5,6,7,8]]:#4 m0.insertNextCell(NORM_PENTA6,elt) pass - m0.checkCoherency2() + m0.checkCoherency1() m1=MEDCouplingUMesh(); m1.setName("mesh") m1.setMeshDimension(2); m1.allocateCells(5); @@ -3703,7 +3703,7 @@ class MEDLoaderTest(unittest.TestCase): m.changeSpaceDimension(3,0.) infos=["aa [b]","cc [de]","gg [klm]"] m.getCoords().setInfoOnComponents(infos) - m.checkCoherency2() + m.checkCoherency1() mm=MEDFileUMesh() mm.setMeshAtLevel(0,m) m1=MEDCouplingCMesh() ; m1.setCoords(arr) ; m1.setName("Mesh") @@ -3787,7 +3787,7 @@ class MEDLoaderTest(unittest.TestCase): m.changeSpaceDimension(3,0.) infos=["aa [b]","cc [de]","gg [klm]"] m.getCoords().setInfoOnComponents(infos) - m.checkCoherency2() + m.checkCoherency1() f=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f.setMesh(m) f.setName("Field") arr=DataArrayDouble(25,2) ; arr.setInfoOnComponents(compos) @@ -3852,7 +3852,7 @@ class MEDLoaderTest(unittest.TestCase): m.changeSpaceDimension(3,0.) infos=["aa [b]","cc [de]","gg [klm]"] m.getCoords().setInfoOnComponents(infos) - m.checkCoherency2() + m.checkCoherency1() f=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f.setMesh(m) f.setName("Field") arr=DataArrayDouble(25,2) ; arr.setInfoOnComponents(compos) @@ -4350,7 +4350,7 @@ class MEDLoaderTest(unittest.TestCase): m3D=m.buildExtrudedMesh(m1D,0) m3D.sortCellsInMEDFileFrmt() m3D.setName(meshName) - m2D=m ; m2D.setCoords(m3D.getCoords()) ; m2D.shiftNodeNumbersInConn(delta) ; m2D.setName(meshName) ; m2D.checkCoherency2() + m2D=m ; m2D.setCoords(m3D.getCoords()) ; m2D.shiftNodeNumbersInConn(delta) ; m2D.setName(meshName) ; m2D.checkCoherency1() m1D=m2D.computeSkin() ; m1D.setName(meshName) m0D=MEDCouplingUMesh.Build0DMeshFromCoords(m3D.getCoords()) ; m0D.setName(meshName) ; m0D=m0D[[2,4,10]] # diff --git a/src/MEDLoader/Swig/MEDLoaderTest4.py b/src/MEDLoader/Swig/MEDLoaderTest4.py index b7c17377a..852f8ca69 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest4.py +++ b/src/MEDLoader/Swig/MEDLoaderTest4.py @@ -2642,7 +2642,7 @@ class MEDLoaderTest4(unittest.TestCase): m.allocateCells() m.insertNextCell(NORM_QUAD4,[0,3,4,1]) m.insertNextCell(NORM_QUAD4,[1,4,5,2]) - m.checkCoherency2() + m.checkCoherency1() # t=(1.1,0,-1) f=MEDCouplingFieldDouble(ON_GAUSS_NE) ; f.setTime(*t) ; f.setMesh(m) @@ -2756,7 +2756,7 @@ class MEDLoaderTest4(unittest.TestCase): m.allocateCells() m.insertNextCell(NORM_QUAD4,[0,3,4,1]) m.insertNextCell(NORM_QUAD4,[1,4,5,2]) - m.checkCoherency2() + m.checkCoherency1() # t=(1.1,0,-1) f=MEDCouplingFieldDouble(ON_GAUSS_PT) ; f.setTime(*t) ; f.setMesh(m) diff --git a/v8_work/TODO.txt b/v8_work/TODO.txt index 507a69f9d..651f52503 100644 --- a/v8_work/TODO.txt +++ b/v8_work/TODO.txt @@ -20,7 +20,7 @@ Covariance fixes [DONE] + MEDCouplingIMesh deepCpy -Various simplifications +Various simplifications [DONE] ======================= + remove isIdentity2 + remove replaceOneValByInThis (changeValue fait le meme boulot) - Attention repercuter if(oldValue==newValue) return 0 @@ -68,7 +68,6 @@ MEDCouplingMesh getBarycenterAndOwner / computeCellCenterOfMass checkCoherency / checkConsistencyLight checkCoherency1 / checkConsistency - checkCoherency2 / checkConsistencyDeep MEDCouplingPointSet -------------------