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;
* 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)
{
* 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)
{
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;
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];
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];
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);
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
{
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);
}
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);
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)
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)
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]
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;