From c1844e1fb1fc82d69f58a92543c1285f6c762d4c Mon Sep 17 00:00:00 2001 From: ageay Date: Mon, 7 Feb 2011 14:42:42 +0000 Subject: [PATCH] *** empty log message *** --- src/MEDCoupling/MEDCouplingPointSet.hxx | 4 ++-- src/MEDCoupling/MEDCouplingUMesh.cxx | 4 ++-- src/MEDCoupling/MEDCouplingUMesh.hxx | 4 ++-- src/MEDCoupling/MEDCouplingUMeshDesc.cxx | 4 ++-- src/MEDCoupling/MEDCouplingUMeshDesc.hxx | 4 ++-- src/MEDCoupling_Swig/MEDCoupling.i | 20 +++++++++++++++---- src/MEDCoupling_Swig/MEDCouplingBasicsTest.py | 6 ++---- src/ParaMEDMEM/ElementLocator.cxx | 4 ++-- 8 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingPointSet.hxx b/src/MEDCoupling/MEDCouplingPointSet.hxx index 764fdd3eb..2a3cc8527 100644 --- a/src/MEDCoupling/MEDCouplingPointSet.hxx +++ b/src/MEDCoupling/MEDCouplingPointSet.hxx @@ -92,8 +92,8 @@ namespace ParaMEDMEM void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const; void unserialization(const std::vector& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector& littleStrings); - virtual void giveCellsInBoundingBox(const double *bbox, double eps, std::vector& elems) = 0; - virtual void giveCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector& elems) = 0; + virtual void getCellsInBoundingBox(const double *bbox, double eps, std::vector& elems) = 0; + virtual void getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector& elems) = 0; virtual DataArrayInt *zipCoordsTraducer() = 0; protected: virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception) = 0; diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index bb70f7981..487267126 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -1322,7 +1322,7 @@ void MEDCouplingUMesh::renumberCells(const int *old2NewBg, bool check) throw(INT * Warning 'elems' is incremented during the call so if elems is not empty before call returned elements will be * added in 'elems' parameter. */ -void MEDCouplingUMesh::giveCellsInBoundingBox(const double *bbox, double eps, std::vector& elems) +void MEDCouplingUMesh::getCellsInBoundingBox(const double *bbox, double eps, std::vector& elems) { if(getMeshDimension()==-1) { @@ -1374,7 +1374,7 @@ void MEDCouplingUMesh::giveCellsInBoundingBox(const double *bbox, double eps, st * Warning 'elems' is incremented during the call so if elems is not empty before call returned elements will be * added in 'elems' parameter. */ -void MEDCouplingUMesh::giveCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector& elems) +void MEDCouplingUMesh::getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector& elems) { if(getMeshDimension()==-1) { diff --git a/src/MEDCoupling/MEDCouplingUMesh.hxx b/src/MEDCoupling/MEDCouplingUMesh.hxx index 341c5c3a5..c820f6899 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.hxx +++ b/src/MEDCoupling/MEDCouplingUMesh.hxx @@ -100,8 +100,8 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void renumberNodes(const int *newNodeNumbers, int newNbOfNodes); MEDCOUPLING_EXPORT void renumberNodes2(const int *newNodeNumbers, int newNbOfNodes); MEDCOUPLING_EXPORT void renumberCells(const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT void giveCellsInBoundingBox(const double *bbox, double eps, std::vector& elems); - MEDCOUPLING_EXPORT void giveCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector& elems); + MEDCOUPLING_EXPORT void getCellsInBoundingBox(const double *bbox, double eps, std::vector& elems); + MEDCOUPLING_EXPORT void getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector& elems); MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureField(bool isAbs) const; MEDCOUPLING_EXPORT DataArrayDouble *getPartMeasureField(bool isAbs, const int *begin, const int *end) const; MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const; diff --git a/src/MEDCoupling/MEDCouplingUMeshDesc.cxx b/src/MEDCoupling/MEDCouplingUMeshDesc.cxx index 1aabf4cdb..562dcdf52 100644 --- a/src/MEDCoupling/MEDCouplingUMeshDesc.cxx +++ b/src/MEDCoupling/MEDCouplingUMeshDesc.cxx @@ -241,7 +241,7 @@ void MEDCouplingUMeshDesc::unserialization(const std::vector& tinyInfo, Dat setMeshDimension(tinyInfo[2]); } -void MEDCouplingUMeshDesc::giveCellsInBoundingBox(const double *bbox, double eps, std::vector& elems) +void MEDCouplingUMeshDesc::getCellsInBoundingBox(const double *bbox, double eps, std::vector& elems) { int dim=getSpaceDimension(); double* elem_bb=new double[2*dim]; @@ -286,7 +286,7 @@ void MEDCouplingUMeshDesc::giveCellsInBoundingBox(const double *bbox, double eps delete [] elem_bb; } -void MEDCouplingUMeshDesc::giveCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps, std::vector& elems) +void MEDCouplingUMeshDesc::getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps, std::vector& elems) { int dim=getSpaceDimension(); double* elem_bb=new double[2*dim]; diff --git a/src/MEDCoupling/MEDCouplingUMeshDesc.hxx b/src/MEDCoupling/MEDCouplingUMeshDesc.hxx index 357416f85..0c063e449 100644 --- a/src/MEDCoupling/MEDCouplingUMeshDesc.hxx +++ b/src/MEDCoupling/MEDCouplingUMeshDesc.hxx @@ -59,8 +59,8 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void resizeForUnserialization(const std::vector& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector& littleStrings); MEDCOUPLING_EXPORT void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const; MEDCOUPLING_EXPORT void unserialization(const std::vector& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, const std::vector& littleStrings); - MEDCOUPLING_EXPORT void giveCellsInBoundingBox(const double *bbox, double eps, std::vector& elems); - MEDCOUPLING_EXPORT void giveCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps, std::vector& elems); + MEDCOUPLING_EXPORT void getCellsInBoundingBox(const double *bbox, double eps, std::vector& elems); + MEDCOUPLING_EXPORT void getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps, std::vector& elems); MEDCOUPLING_EXPORT DataArrayInt *mergeNodes(double precision, bool& areNodesMerged, int& newNbOfNodes); MEDCOUPLING_EXPORT DataArrayInt *mergeNodes2(double precision, bool& areNodesMerged, int& newNbOfNodes); MEDCOUPLING_EXPORT void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception); diff --git a/src/MEDCoupling_Swig/MEDCoupling.i b/src/MEDCoupling_Swig/MEDCoupling.i index 7e100502e..ff28e1d6f 100644 --- a/src/MEDCoupling_Swig/MEDCoupling.i +++ b/src/MEDCoupling_Swig/MEDCoupling.i @@ -495,7 +495,7 @@ namespace ParaMEDMEM void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const throw(INTERP_KERNEL::Exception); void unserialization(const std::vector& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector& littleStrings) throw(INTERP_KERNEL::Exception); - virtual void giveCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector& elems) throw(INTERP_KERNEL::Exception) = 0; + virtual void getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector& elems) throw(INTERP_KERNEL::Exception) = 0; virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception) = 0; %extend { @@ -675,12 +675,12 @@ namespace ParaMEDMEM return ret; } - PyObject *giveCellsInBoundingBox(PyObject *bbox, double eps) throw(INTERP_KERNEL::Exception) + PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) throw(INTERP_KERNEL::Exception) { std::vector elems; int size; double *tmp=convertPyToNewDblArr2(bbox,&size); - self->giveCellsInBoundingBox(tmp,eps,elems); + self->getCellsInBoundingBox(tmp,eps,elems); delete [] tmp; return convertIntArrToPyList2(elems); } @@ -734,7 +734,6 @@ namespace ParaMEDMEM DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception); DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception); DataArrayInt *zipConnectivityTraducer(int compType) throw(INTERP_KERNEL::Exception); - void getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const throw(INTERP_KERNEL::Exception); MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception); void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception); bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception); @@ -986,6 +985,19 @@ namespace ParaMEDMEM return ret; } + PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception) + { + MEDCouplingAutoRefCountObjectPtr d0=DataArrayInt::New(); + MEDCouplingAutoRefCountObjectPtr d1=DataArrayInt::New(); + self->getReverseNodalConnectivity(d0,d1); + PyObject *ret=PyTuple_New(2); + PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 )); + d0->incrRef(); + d1->incrRef(); + return ret; + } + DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception) { if(!da) diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py index 1989dc3f1..48cd58dac 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py @@ -193,9 +193,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): pass def testRevNodal(self): mesh=MEDCouplingDataForTest.build2DTargetMesh_1() - revNodal=DataArrayInt.New(); - revNodalIndx=DataArrayInt.New(); - mesh.getReverseNodalConnectivity(revNodal,revNodalIndx); + revNodal,revNodalIndx=mesh.getReverseNodalConnectivity(); revNodalExpected=[0,0,1,1,2,0,3,0,1,2,3,4,2,4,3,3,4,4]; revNodalIndexExpected=[0,1,3,5,7,12,14,15,17,18]; self.assertEqual(revNodal.getNbOfElems(),18) @@ -4110,7 +4108,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): pos1=[5.,30.,2.] self.assertEqual(16,m.getCellContainingPoint(pos1,1e-12)); # - elems=m2.giveCellsInBoundingBox([3.5,6.,12.2,25.,0.,1.5],1e-7) + elems=m2.getCellsInBoundingBox([3.5,6.,12.2,25.,0.,1.5],1e-7) self.assertEqual([1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17],elems) # pt=[2.4,12.7,-3.4] diff --git a/src/ParaMEDMEM/ElementLocator.cxx b/src/ParaMEDMEM/ElementLocator.cxx index c486aea99..45e5457e3 100644 --- a/src/ParaMEDMEM/ElementLocator.cxx +++ b/src/ParaMEDMEM/ElementLocator.cxx @@ -92,10 +92,10 @@ namespace ParaMEDMEM INTERP_KERNEL::DirectedBoundingBox dbb; double* distant_bb = _domain_bounding_boxes+rank*dbb.dataSize(_local_cell_mesh_space_dim); dbb.setData(distant_bb); - _local_cell_mesh->giveCellsInBoundingBox(dbb,getBoundingBoxAdjustment(),elems); + _local_cell_mesh->getCellsInBoundingBox(dbb,getBoundingBoxAdjustment(),elems); #else double* distant_bb = _domain_bounding_boxes+rank*2*_local_cell_mesh_space_dim; - _local_cell_mesh->giveCellsInBoundingBox(distant_bb,getBoundingBoxAdjustment(),elems); + _local_cell_mesh->getCellsInBoundingBox(distant_bb,getBoundingBoxAdjustment(),elems); #endif DataArrayInt *distant_ids_send; -- 2.39.2