]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
MEDCouplingUMesh::renumberNodeInConn public
authorageay <ageay>
Tue, 24 Apr 2012 12:57:51 +0000 (12:57 +0000)
committerageay <ageay>
Tue, 24 Apr 2012 12:57:51 +0000 (12:57 +0000)
src/MEDCoupling/MEDCouplingUMesh.cxx
src/MEDCoupling/MEDCouplingUMesh.hxx
src/MEDCoupling_Swig/MEDCoupling.i

index 54b1f8464c0e7b7686d895aa2c50f0f9d13c72fa..b8704033309b0fe8cfe8fd0be0dede6621a3e3a5 100644 (file)
@@ -1542,7 +1542,7 @@ void MEDCouplingUMesh::renumberNodes2(const int *newNodeNumbers, int newNbOfNode
  * Use it with care !
  * @param 'newNodeNumbers' in old2New convention
  */
-void MEDCouplingUMesh::renumberNodesInConn(const int *newNodeNumbers)
+void MEDCouplingUMesh::renumberNodesInConn(const int *newNodeNumbersO2N)
 {
   int *conn=getNodalConnectivity()->getPointer();
   const int *connIndex=getNodalConnectivityIndex()->getConstPointer();
@@ -1553,7 +1553,7 @@ void MEDCouplingUMesh::renumberNodesInConn(const int *newNodeNumbers)
         int& node=conn[iconn];
         if(node>=0)//avoid polyhedron separator
           {
-            node=newNodeNumbers[node];
+            node=newNodeNumbersO2N[node];
           }
       }
   _nodal_connec->declareAsNew();
index 8cb98085ab60927351276f0309202377e548cff0..97988cb7f73a018329c04e84f426eaf8acce06a5 100644 (file)
@@ -117,6 +117,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT DataArrayInt *findCellsIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
     MEDCOUPLING_EXPORT void renumberNodes(const int *newNodeNumbers, int newNbOfNodes);
     MEDCOUPLING_EXPORT void renumberNodes2(const int *newNodeNumbers, int newNbOfNodes);
+    MEDCOUPLING_EXPORT void renumberNodesInConn(const int *newNodeNumbersO2N);
     MEDCOUPLING_EXPORT void renumberCells(const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception);
     MEDCOUPLING_EXPORT void getCellsInBoundingBox(const double *bbox, double eps, std::vector<int>& elems) const;
     MEDCOUPLING_EXPORT void getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector<int>& elems);
@@ -199,7 +200,6 @@ namespace ParaMEDMEM
     DataArrayInt *simplexizePol0() throw(INTERP_KERNEL::Exception);
     DataArrayInt *simplexizePol1() throw(INTERP_KERNEL::Exception);
     void subDivide2DMesh(const int *nodeSubdived, const int *nodeIndxSubdived, const int *desc, const int *descIndex) throw(INTERP_KERNEL::Exception);
-    void renumberNodesInConn(const int *newNodeNumbers);
     void fillCellIdsToKeepFromNodeIds(const int *begin, const int *end, bool fullyIn, std::vector<int>& cellIdsKept) const;
     void split3DCurveWithPlane(const double *origin, const double *vec, double eps, std::vector<int>& cut3DCurve) throw(INTERP_KERNEL::Exception);
     MEDCouplingUMesh *buildExtrudedMeshFromThisLowLev(int nbOfNodesOf1Lev, bool isQuad) const;
index 106f3bb913c9a99107c2b62094c229dd0662880c..1437a0e3468558e71ae1e5a61ccf60de2a11ed64 100644 (file)
@@ -822,7 +822,7 @@ namespace ParaMEDMEM
            void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
            {
              void *da=0;
-             int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
+             int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
              if (!SWIG_IsOK(res1))
                {
                  int size;
@@ -841,7 +841,7 @@ namespace ParaMEDMEM
            void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
            {
              void *da=0;
-             int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
+             int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
              if (!SWIG_IsOK(res1))
                {
                  int size;
@@ -1215,6 +1215,26 @@ namespace ParaMEDMEM
         return ret;
       }
 
+      void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
+      {
+        void *da=0;
+        int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+        if (!SWIG_IsOK(res1))
+          {
+            int size;
+            INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
+            self->renumberNodesInConn(tmp);
+          }
+        else
+          {
+            DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
+            if(!da2)
+              throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+            da2->checkAllocated();
+            self->renumberNodesInConn(da2->getConstPointer());
+          }
+      }
+
       PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
       {
         int sz;