]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
*** empty log message ***
authorageay <ageay>
Mon, 7 Feb 2011 14:42:42 +0000 (14:42 +0000)
committerageay <ageay>
Mon, 7 Feb 2011 14:42:42 +0000 (14:42 +0000)
src/MEDCoupling/MEDCouplingPointSet.hxx
src/MEDCoupling/MEDCouplingUMesh.cxx
src/MEDCoupling/MEDCouplingUMesh.hxx
src/MEDCoupling/MEDCouplingUMeshDesc.cxx
src/MEDCoupling/MEDCouplingUMeshDesc.hxx
src/MEDCoupling_Swig/MEDCoupling.i
src/MEDCoupling_Swig/MEDCouplingBasicsTest.py
src/ParaMEDMEM/ElementLocator.cxx

index 764fdd3eba578b67374609bb63ded93f37485429..2a3cc85279a43470692e9f2f68cfc521c1419e33 100644 (file)
@@ -92,8 +92,8 @@ namespace ParaMEDMEM
     void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
     void unserialization(const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
                          const std::vector<std::string>& littleStrings);
-    virtual void giveCellsInBoundingBox(const double *bbox, double eps, std::vector<int>& elems) = 0;
-    virtual void giveCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector<int>& elems) = 0;
+    virtual void getCellsInBoundingBox(const double *bbox, double eps, std::vector<int>& elems) = 0;
+    virtual void getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector<int>& elems) = 0;
     virtual DataArrayInt *zipCoordsTraducer() = 0;
   protected:
     virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception) = 0;
index bb70f79817675e502455b9a03ea60223714310a7..4872671268b30ec15205d673e4514e11707b4d8c 100644 (file)
@@ -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<int>& elems)
+void MEDCouplingUMesh::getCellsInBoundingBox(const double *bbox, double eps, std::vector<int>& 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<int>& elems)
+void MEDCouplingUMesh::getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector<int>& elems)
 {
   if(getMeshDimension()==-1)
     {
index 341c5c3a5fee281ec6a33676322cfd5730341092..c820f6899e209f3514bbc915e734adb04cde1e31 100644 (file)
@@ -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<int>& elems);
-    MEDCOUPLING_EXPORT void giveCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector<int>& elems);
+    MEDCOUPLING_EXPORT void getCellsInBoundingBox(const double *bbox, double eps, std::vector<int>& elems);
+    MEDCOUPLING_EXPORT void getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector<int>& 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;
index 1aabf4cdbcf9d7489530a54b4dfca5d783c23316..562dcdf52d7f7b5c6ab13f238776b3d6fb35ca57 100644 (file)
@@ -241,7 +241,7 @@ void MEDCouplingUMeshDesc::unserialization(const std::vector<int>& tinyInfo, Dat
   setMeshDimension(tinyInfo[2]);
 }
 
-void MEDCouplingUMeshDesc::giveCellsInBoundingBox(const double *bbox, double eps, std::vector<int>& elems)
+void MEDCouplingUMeshDesc::getCellsInBoundingBox(const double *bbox, double eps, std::vector<int>& 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<int>& elems)
+void MEDCouplingUMeshDesc::getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps, std::vector<int>& elems)
 {
   int dim=getSpaceDimension();
   double* elem_bb=new double[2*dim];
index 357416f852d95e2016df7f0b02fd7064586c45d9..0c063e44962d3f0d8ec5055e67b9878d6b7f0859 100644 (file)
@@ -59,8 +59,8 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings);
     MEDCOUPLING_EXPORT void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
     MEDCOUPLING_EXPORT void unserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings);
-    MEDCOUPLING_EXPORT void giveCellsInBoundingBox(const double *bbox, double eps, std::vector<int>& elems);
-    MEDCOUPLING_EXPORT void giveCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps, std::vector<int>& elems);
+    MEDCOUPLING_EXPORT void getCellsInBoundingBox(const double *bbox, double eps, std::vector<int>& elems);
+    MEDCOUPLING_EXPORT void getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps, std::vector<int>& 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);
index 7e100502e6a45f19ce6f764a5e1e57617b7826ac..ff28e1d6f67ed0cb3a92b6edf8cd8cb7ce74cf9c 100644 (file)
@@ -495,7 +495,7 @@ namespace ParaMEDMEM
       void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const throw(INTERP_KERNEL::Exception);
       void unserialization(const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
                            const std::vector<std::string>& littleStrings) throw(INTERP_KERNEL::Exception);
-      virtual void giveCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector<int>& elems) throw(INTERP_KERNEL::Exception) = 0;
+      virtual void getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector<int>& 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<int> 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<DataArrayInt> d0=DataArrayInt::New();
+        MEDCouplingAutoRefCountObjectPtr<DataArrayInt> 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)
index 1989dc3f13afedb00070ac735faa3d3d7cbb1bfd..48cd58dac78f45c1e918d0d9cd372f791add0bf4 100644 (file)
@@ -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]
index c486aea9951137fc29b847c6142a203dd83d0807..45e5457e358ebc90a0a0c31d9d220ceac2f0af8d 100644 (file)
@@ -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;