Salome HOME
Renamed duplicateNodesOnM1Group into buildInnerBoundaryAlongM1Group
authorabn <adrien.bruneton@cea.fr>
Wed, 16 Sep 2015 14:12:24 +0000 (16:12 +0200)
committerabn <adrien.bruneton@cea.fr>
Wed, 16 Sep 2015 14:12:24 +0000 (16:12 +0200)
src/MEDLoader/MEDFileMesh.cxx
src/MEDLoader/MEDFileMesh.hxx
src/MEDLoader/Swig/MEDLoaderCommon.i
src/MEDLoader/Swig/MEDLoaderTest3.py

index 9c7698caf9fa2411a8792decd3037be4adc5cf42..b77e3416dcbacbed3a670942ffd8247aae36b2e1 100644 (file)
@@ -3583,28 +3583,28 @@ void MEDFileUMesh::optimizeFamilies()
 
 /**
  * \b this must be filled at level 0 and -1, typically the -1 level being (part of) the descending connectivity
- * of the top level. This method build a "crack" in \b this along the group of level -1 named grpNameM1.
- * The "crack" is built according to the following method:
- *  - all nodes along the crack which are not lying on an internal extremity of the crack are duplicated (so the
- * coordinates array is extended). The
- *  - new (-1)-level cells are built lying on those new nodes. So the edges/faces along the crack are duplicated.
- *  After this operation a top-level cell bordering the crack will loose some neighbor (typically the cell which is  on the
- *  other side of the crack is no more a neighbor)
- *   - finally, the connectivity of (part of) the top level-cells bordering the crack is also modified so that some cells
- *  bordering the crack use the newly computed nodes.
+ * of the top level. This method build a "crack", or an inner boundary, in \b this along the group of level -1 named grpNameM1.
+ * The boundary is built according to the following method:
+ *  - all nodes along the boundary which are not lying on an internal extremity of the (-1)-level group are duplicated (so the
+ * coordinates array is extended).
+ *  - new (-1)-level cells are built lying on those new nodes. So the edges/faces along the group are duplicated.
+ *  After this operation a top-level cell bordering the group will loose some neighbors (typically the cell which is  on the
+ *  other side of the group is no more a neighbor)
+ *   - finally, the connectivity of (part of) the top level-cells bordering the group is also modified so that some cells
+ *  bordering the newly created boundary use the newly computed nodes.
  *
- *  \param[in] grpNameM1 name of the (-1)-level group defining the crack
+ *  \param[in] grpNameM1 name of the (-1)-level group defining the boundary
  *  \param[out] nodesDuplicated ids of the initial nodes which have been duplicated (and whose copy is put at the end of
  *  the coord array)
  *  \param[out] cellsModified ids of the cells whose connectivity has been modified (to use the newly created nodes)
- *  \param[out] cellsNotModified ids of the rest of cells bordering the crack whose connectivity remains unchanged.
+ *  \param[out] cellsNotModified ids of the rest of cells bordering the new boundary whose connectivity remains unchanged.
  */
-void MEDFileUMesh::duplicateNodesOnM1Group(const std::string& grpNameM1, DataArrayInt *&nodesDuplicated,
+void MEDFileUMesh::buildInnerBoundaryAlongM1Group(const std::string& grpNameM1, DataArrayInt *&nodesDuplicated,
                                            DataArrayInt *&cellsModified, DataArrayInt *&cellsNotModified)
 {
   std::vector<int> levs=getNonEmptyLevels();
   if(std::find(levs.begin(),levs.end(),0)==levs.end() || std::find(levs.begin(),levs.end(),-1)==levs.end())
-    throw INTERP_KERNEL::Exception("MEDFileUMesh::duplicateNodesOnM1Group : This method works only for mesh definied on level 0 and -1 !");
+    throw INTERP_KERNEL::Exception("MEDFileUMesh::buildInnerBoundaryAlongM1Group : This method works only for mesh definied on level 0 and -1 !");
   MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m0=getMeshAtLevel(0);
   MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m1=getMeshAtLevel(-1);
   int nbNodes=m0->getNumberOfNodes();
@@ -3647,7 +3647,7 @@ void MEDFileUMesh::duplicateNodesOnM1Group(const std::string& grpNameM1, DataArr
   newm1->setName(getName());
   const DataArrayInt *fam=getFamilyFieldAtLevel(-1);
   if(!fam)
-    throw INTERP_KERNEL::Exception("MEDFileUMesh::duplicateNodesOnM1Group : internal problem !");
+    throw INTERP_KERNEL::Exception("MEDFileUMesh::buildInnerBoundaryAlongM1Group : internal problem !");
   MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newFam=DataArrayInt::New();
   newFam->alloc(newm1->getNumberOfCells(),1);
   int idd=getMaxFamilyId()+1;
index 2bb997d34aa6bfc77919f64c47907d99e9165580..87ffb429a08903a41fee7b988b9755b77634e42a 100644 (file)
@@ -300,7 +300,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT void setGroupsOnSetMesh(int meshDimRelToMax, const std::vector<const MEDCouplingUMesh *>& ms, bool renum=false);
     MEDLOADER_EXPORT void optimizeFamilies();
     // tools
-    MEDLOADER_EXPORT void duplicateNodesOnM1Group(const std::string& grpNameM1, DataArrayInt *&nodesDuplicated, DataArrayInt *&cellsModified, DataArrayInt *&cellsNotModified);
+    MEDLOADER_EXPORT void buildInnerBoundaryAlongM1Group(const std::string& grpNameM1, DataArrayInt *&nodesDuplicated, DataArrayInt *&cellsModified, DataArrayInt *&cellsNotModified);
     MEDLOADER_EXPORT bool unPolyze(std::vector<int>& oldCode, std::vector<int>& newCode, DataArrayInt *& o2nRenumCell);
     MEDLOADER_EXPORT DataArrayInt *zipCoords();
     MEDLOADER_EXPORT MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const;
index 36fdbadb8028095de3889417ddf1a786d112d79b..85d65699b06e1be2b983c81274d64f7b5d6a0b02 100644 (file)
@@ -1215,10 +1215,10 @@ namespace ParaMEDMEM
            return const_cast<PartDefinition *>(ret);
          }
 
-         PyObject *duplicateNodesOnM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
+         PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
          {
            DataArrayInt *ret0=0,*ret1=0,*ret2=0;
-           self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
+           self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
            PyObject *ret=PyTuple_New(3);
            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
index baa860a56ca0c429525efb8ad3231d2c83311990..004c88a5a1c1a900df69aa3658a52db240980854 100644 (file)
@@ -1232,7 +1232,7 @@ class MEDLoaderTest(unittest.TestCase):
             pass
         pass
 
-    def testDuplicateNodesOnM1Group1(self):
+    def testBuildInnerBoundaryAlongM1Group1(self):
         fname="Pyfile44.med"
         m=MEDCouplingCMesh.New()
         m.setCoordsAt(0,DataArrayDouble.New([0.,1.1,2.3,3.6,5.,6.5]))
@@ -1257,7 +1257,7 @@ class MEDLoaderTest(unittest.TestCase):
         self.assertEqual(ref0,mm.getMeshAtLevel(0)[[12,13,14]].getNodalConnectivity().getValues())
         self.assertEqual(ref1,mm.getMeshAtLevel(0)[[7,8,9]].getNodalConnectivity().getValues())
         #
-        nodes,cells,cells2=mm.duplicateNodesOnM1Group("Grp")
+        nodes,cells,cells2=mm.buildInnerBoundaryAlongM1Group("Grp")
         self.assertEqual([15,16,17],nodes.getValues());
         self.assertEqual([7,8,9],cells.getValues());
         self.assertEqual([12,13,14],cells2.getValues());
@@ -1282,7 +1282,7 @@ class MEDLoaderTest(unittest.TestCase):
         mm.write(fname,2)
         pass
 
-    def testDuplicateNodesOnM1Group2(self):
+    def testBuildInnerBoundaryAlongM1Group2(self):
         fname="Pyfile45.med"
         m=MEDCouplingCMesh.New()
         m.setCoordsAt(0,DataArrayDouble.New([0.,1.1,2.3,3.6,5.,6.5]))
@@ -1307,7 +1307,7 @@ class MEDLoaderTest(unittest.TestCase):
         self.assertEqual(ref0,mm.getMeshAtLevel(0)[[12,13,14]].getNodalConnectivity().getValues())
         self.assertEqual(ref1,mm.getMeshAtLevel(0)[[7,8]].getNodalConnectivity().getValues())
         #
-        nodes,cells,cells2=mm.duplicateNodesOnM1Group("Grp")
+        nodes,cells,cells2=mm.buildInnerBoundaryAlongM1Group("Grp")
         self.assertEqual([15],nodes.getValues());
         self.assertEqual([7,8],cells.getValues());
         self.assertEqual([12,13],cells2.getValues());
@@ -1332,8 +1332,8 @@ class MEDLoaderTest(unittest.TestCase):
         mm.write(fname,2)       
         pass
 
-    def testDuplicateNodesOnM1Group3(self):
-        """ Test duplicateNodesOnM1Group() with *non-connex* cracks """
+    def testBuildInnerBoundaryAlongM1Group3(self):
+        """ Test buildInnerBoundaryAlongM1Group() with *non-connex* cracks """
         fname = "Pyfile73.med"
         m = MEDCouplingCMesh.New()
         m.setCoordsAt(0, DataArrayDouble([0.0,1.1,2.3,3.6,5.0]))
@@ -1349,7 +1349,7 @@ class MEDLoaderTest(unittest.TestCase):
         mm.setMeshAtLevel(0,m)
         mm.setMeshAtLevel(-1,m2)
         mm.setGroupsAtLevel(-1,[grpSeg])
-        nodes, cellsMod, cellsNotMod = mm.duplicateNodesOnM1Group("Grp")
+        nodes, cellsMod, cellsNotMod = mm.buildInnerBoundaryAlongM1Group("Grp")
         self.assertEqual([1,13],nodes.getValues());
         self.assertEqual([0,6],cellsMod.getValues());
         self.assertEqual([1,7],cellsNotMod.getValues());