From: abn Date: Wed, 16 Sep 2015 14:12:24 +0000 (+0200) Subject: Renamed duplicateNodesOnM1Group into buildInnerBoundaryAlongM1Group X-Git-Tag: V7_7_0b1~1^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=234460763336340b26f2fe131594d303e87f2e03;p=tools%2Fmedcoupling.git Renamed duplicateNodesOnM1Group into buildInnerBoundaryAlongM1Group --- diff --git a/src/MEDLoader/MEDFileMesh.cxx b/src/MEDLoader/MEDFileMesh.cxx index 9c7698caf..b77e3416d 100644 --- a/src/MEDLoader/MEDFileMesh.cxx +++ b/src/MEDLoader/MEDFileMesh.cxx @@ -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 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 m0=getMeshAtLevel(0); MEDCouplingAutoRefCountObjectPtr 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 newFam=DataArrayInt::New(); newFam->alloc(newm1->getNumberOfCells(),1); int idd=getMaxFamilyId()+1; diff --git a/src/MEDLoader/MEDFileMesh.hxx b/src/MEDLoader/MEDFileMesh.hxx index 2bb997d34..87ffb429a 100644 --- a/src/MEDLoader/MEDFileMesh.hxx +++ b/src/MEDLoader/MEDFileMesh.hxx @@ -300,7 +300,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT void setGroupsOnSetMesh(int meshDimRelToMax, const std::vector& 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& oldCode, std::vector& newCode, DataArrayInt *& o2nRenumCell); MEDLOADER_EXPORT DataArrayInt *zipCoords(); MEDLOADER_EXPORT MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const; diff --git a/src/MEDLoader/Swig/MEDLoaderCommon.i b/src/MEDLoader/Swig/MEDLoaderCommon.i index 36fdbadb8..85d65699b 100644 --- a/src/MEDLoader/Swig/MEDLoaderCommon.i +++ b/src/MEDLoader/Swig/MEDLoaderCommon.i @@ -1215,10 +1215,10 @@ namespace ParaMEDMEM return const_cast(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 )); diff --git a/src/MEDLoader/Swig/MEDLoaderTest3.py b/src/MEDLoader/Swig/MEDLoaderTest3.py index baa860a56..004c88a5a 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest3.py +++ b/src/MEDLoader/Swig/MEDLoaderTest3.py @@ -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());