Salome HOME
factorizations continue
authorageay <ageay>
Wed, 19 Jun 2013 06:18:05 +0000 (06:18 +0000)
committerageay <ageay>
Wed, 19 Jun 2013 06:18:05 +0000 (06:18 +0000)
src/MEDCoupling/MEDCouplingPointSet.cxx
src/MEDCoupling/MEDCouplingPointSet.hxx
src/MEDCoupling/MEDCouplingUMesh.cxx
src/MEDCoupling/MEDCouplingUMesh.hxx
src/MEDCoupling_Swig/MEDCouplingCommon.i

index 808ce986c35c1f3e477804ad43b865e549779850..70411f77b82982c29fa8ba84b55f2d0dcf0f2897 100644 (file)
@@ -1465,3 +1465,53 @@ void MEDCouplingPointSet::checkFastEquivalWith(const MEDCouplingMesh *other, dou
   if(!status)
     throw INTERP_KERNEL::Exception("checkFastEquivalWith : Two meshes are not equal because on 3 test cells some difference have been detected !");
 }
+
+/*!
+ * Finds cells whose all or some nodes are in a given array of node ids.
+ *  \param [in] begin - the array of node ids.
+ *  \param [in] end - a pointer to the (last+1)-th element of \a begin.
+ *  \param [in] fullyIn - if \c true, then cells whose all nodes are in the
+ *         array \a begin are returned only, else cells whose any node is in the
+ *         array \a begin are returned.
+ *  \return DataArrayInt * - a new instance of DataArrayInt holding ids of found
+ *         cells. The caller is to delete this array using decrRef() as it is no more
+ *         needed. 
+ *  \throw If the coordinates array is not set.
+ *  \throw If the nodal connectivity of cells is not defined.
+ *  \throw If any cell id in \a begin is not valid.
+ *
+ * \sa MEDCouplingPointSet::getCellIdsFullyIncludedInNodeIds
+ *
+ *  \ref cpp_mcumesh_getCellIdsLyingOnNodes "Here is a C++ example".<br>
+ *  \ref  py_mcumesh_getCellIdsLyingOnNodes "Here is a Python example".
+ */
+DataArrayInt *MEDCouplingPointSet::getCellIdsLyingOnNodes(const int *begin, const int *end, bool fullyIn) const
+{
+  DataArrayInt *cellIdsKept=0;
+  fillCellIdsToKeepFromNodeIds(begin,end,fullyIn,cellIdsKept);
+  cellIdsKept->setName(getName());
+  return cellIdsKept;
+}
+
+/*!
+ * Finds cells whose all nodes are in a given array of node ids.
+ * This method is a specialization of MEDCouplingPointSet::getCellIdsLyingOnNodes (true
+ * as last input argument).
+ *  \param [in] partBg - the array of node ids.
+ *  \param [in] partEnd - a pointer to a (last+1)-th element of \a partBg.
+ *  \return DataArrayInt * - a new instance of DataArrayInt holding ids of found
+ *          cells. The caller is to delete this array using decrRef() as it is no
+ *          more needed.
+ *  \throw If the coordinates array is not set.
+ *  \throw If the nodal connectivity of cells is not defined.
+ *  \throw If any cell id in \a partBg is not valid.
+ * 
+ * \sa MEDCouplingPointSet::getCellIdsLyingOnNodes
+ *
+ *  \ref cpp_mcumesh_getCellIdsFullyIncludedInNodeIds "Here is a C++ example".<br>
+ *  \ref  py_mcumesh_getCellIdsFullyIncludedInNodeIds "Here is a Python example".
+ */
+DataArrayInt *MEDCouplingPointSet::getCellIdsFullyIncludedInNodeIds(const int *partBg, const int *partEnd) const
+{
+  return getCellIdsLyingOnNodes(partBg,partEnd,true);
+}
index c7cec31ad535152ddb0f9b7653341de181b007c4..ed2b4505643e890a85bfc52a3f361c4868a2827f 100644 (file)
@@ -104,6 +104,8 @@ namespace ParaMEDMEM
     MEDCouplingMesh *buildPartAndReduceNodes(const int *start, const int *end, DataArrayInt*& arr) const;
     MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
     MEDCouplingMesh *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt*& arr) const throw(INTERP_KERNEL::Exception);
+    DataArrayInt *getCellIdsFullyIncludedInNodeIds(const int *partBg, const int *partEnd) const;
+    DataArrayInt *getCellIdsLyingOnNodes(const int *begin, const int *end, bool fullyIn) const;
     virtual MEDCouplingPointSet *buildPartOfMySelf(const int *start, const int *end, bool keepCoords=true) const;
     virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step, bool keepCoords=true) const throw(INTERP_KERNEL::Exception);
     virtual MEDCouplingPointSet *buildPartOfMySelfKeepCoords(const int *begin, const int *end) const = 0;
index ce9038fc8eb2f2d56d7ba96df2771aad3ee96f91..953b9f8f83deb60bd545ae8ad6e7dfe41a7462c2 100644 (file)
@@ -2060,28 +2060,6 @@ void MEDCouplingUMesh::setPartOfMySelf2(int start, int end, int step, const MEDC
     }
 }                      
 
-/*!
- * Finds cells whose all nodes are in a given array of node ids.
- *  \param [in] partBg - the array of node ids.
- *  \param [in] partEnd - a pointer to a (last+1)-th element of \a partBg.
- *  \return DataArrayInt * - a new instance of DataArrayInt holding ids of found
- *          cells. The caller is to delete this array using decrRef() as it is no
- *          more needed.
- *  \throw If the coordinates array is not set.
- *  \throw If the nodal connectivity of cells is not defined.
- *  \throw If any cell id in \a partBg is not valid.
- *
- *  \ref cpp_mcumesh_getCellIdsFullyIncludedInNodeIds "Here is a C++ example".<br>
- *  \ref  py_mcumesh_getCellIdsFullyIncludedInNodeIds "Here is a Python example".
- */
-DataArrayInt *MEDCouplingUMesh::getCellIdsFullyIncludedInNodeIds(const int *partBg, const int *partEnd) const
-{
-  DataArrayInt *cellIdsKept=0;
-  fillCellIdsToKeepFromNodeIds(partBg,partEnd,true,cellIdsKept);
-  cellIdsKept->setName(getName());
-  return cellIdsKept;
-}
-
 /*!
  * Keeps from \a this only cells which constituing point id are in the ids specified by [ \a begin,\a end ).
  * The resulting cell ids are stored at the end of the 'cellIdsKept' parameter.
@@ -2122,31 +2100,6 @@ void MEDCouplingUMesh::fillCellIdsToKeepFromNodeIds(const int *begin, const int
   cellIdsKeptArr=cellIdsKept.retn();
 }
 
-/*!
- * Finds cells whose all or some nodes are in a given array of node ids.
- *  \param [in] begin - the array of node ids.
- *  \param [in] end - a pointer to the (last+1)-th element of \a begin.
- *  \param [in] fullyIn - if \c true, then cells whose all nodes are in the
- *         array \a begin are returned only, else cells whose any node is in the
- *         array \a begin are returned.
- *  \return DataArrayInt * - a new instance of DataArrayInt holding ids of found
- *         cells. The caller is to delete this array using decrRef() as it is no more
- *         needed. 
- *  \throw If the coordinates array is not set.
- *  \throw If the nodal connectivity of cells is not defined.
- *  \throw If any cell id in \a begin is not valid.
- *
- *  \ref cpp_mcumesh_getCellIdsLyingOnNodes "Here is a C++ example".<br>
- *  \ref  py_mcumesh_getCellIdsLyingOnNodes "Here is a Python example".
- */
-DataArrayInt *MEDCouplingUMesh::getCellIdsLyingOnNodes(const int *begin, const int *end, bool fullyIn) const
-{
-  DataArrayInt *cellIdsKept=0;
-  fillCellIdsToKeepFromNodeIds(begin,end,fullyIn,cellIdsKept);
-  cellIdsKept->setName(getName());
-  return cellIdsKept;
-}
-
 /*!
  * Creates a new MEDCouplingUMesh containing cells, of dimension one less than \a
  * this->getMeshDimension(), that bound some cells of \a this mesh.
index cf33bbb26598c7d34652722e9b1c3e09fa0e5ab6..ce2d83637fe79c69e6d76fb8901c925938b229a0 100644 (file)
@@ -70,7 +70,6 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
     MEDCOUPLING_EXPORT int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
     MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
-    MEDCOUPLING_EXPORT DataArrayInt *getCellIdsFullyIncludedInNodeIds(const int *partBg, const int *partEnd) const;
     MEDCOUPLING_EXPORT std::string simpleRepr() const;
     MEDCOUPLING_EXPORT std::string advancedRepr() const;
     MEDCOUPLING_EXPORT std::string cppRepr() const throw(INTERP_KERNEL::Exception);
@@ -127,7 +126,6 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step, bool keepCoords=true) const throw(INTERP_KERNEL::Exception);
     MEDCOUPLING_EXPORT void setPartOfMySelf(const int *cellIdsBg, const int *cellIdsEnd, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
     MEDCOUPLING_EXPORT void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
-    MEDCOUPLING_EXPORT DataArrayInt *getCellIdsLyingOnNodes(const int *begin, const int *end, bool fullyIn) const;
     MEDCOUPLING_EXPORT MEDCouplingPointSet *buildFacePartOfMySelfNode(const int *begin, const int *end, bool fullyIn) const;
     MEDCOUPLING_EXPORT MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
     MEDCOUPLING_EXPORT DataArrayInt *findBoundaryNodes() const;
index b6ce64a3746b272497929e52f9ee719df6fddf3e..c08677a9e46550df75149e7536f882926f15a543 100644 (file)
@@ -337,6 +337,7 @@ using namespace INTERP_KERNEL;
 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
+%newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
@@ -376,7 +377,6 @@ using namespace INTERP_KERNEL;
 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
-%newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsLyingOnNodes;
 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
@@ -1411,6 +1411,26 @@ namespace ParaMEDMEM
              return res;
            }
            
+           DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const 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);
+                 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
+               }
+             else
+               {
+                 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
+                 if(!da2)
+                   throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
+                 da2->checkAllocated();
+                 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
+               }
+           }
+           
            static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
            {
              int sz;
@@ -2444,26 +2464,6 @@ namespace ParaMEDMEM
         return ret;
       }
 
-      DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const 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);
-            return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
-          }
-        else
-          {
-            DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
-            if(!da2)
-              throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
-            da2->checkAllocated();
-            return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
-          }
-      }
-
       static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
       {
         DataArrayInt *cellNb1=0,*cellNb2=0;
@@ -2635,6 +2635,7 @@ namespace ParaMEDMEM
   {
   public:
     static MEDCoupling1GTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
+    INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
   };
 
   //== MEDCoupling1SGTUMesh