-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "MEDCouplingUMeshDesc.hxx"
#include "CellModel.hxx"
#include "MEDCouplingMemArray.hxx"
+#include "MEDCouplingAutoRefCountObjectPtr.hxx"
#include <limits>
#include <sstream>
return ret;
}
+std::size_t MEDCouplingUMeshDesc::getHeapMemorySize() const
+{
+ std::size_t ret=0;
+ if(_desc_connec)
+ ret+=_desc_connec->getHeapMemorySize();
+ if(_desc_connec_index)
+ ret+=_desc_connec_index->getHeapMemorySize();
+ if(_nodal_connec_face)
+ ret+=_nodal_connec_face->getHeapMemorySize();
+ if(_nodal_connec_face_index)
+ ret+=_nodal_connec_face_index->getHeapMemorySize();
+ return MEDCouplingPointSet::getHeapMemorySize()+ret;
+}
+
+
MEDCouplingMesh *MEDCouplingUMeshDesc::deepCpy() const
{
throw INTERP_KERNEL::Exception("Not implemented yet !");
return _types;
}
+DataArrayInt *MEDCouplingUMeshDesc::giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
+{
+ throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::giveCellsWithType : not implemented yet !");
+}
+
+DataArrayInt *MEDCouplingUMeshDesc::computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception)
+{
+ throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::computeNbOfNodesPerCell : not implemented yet !");
+}
+
int MEDCouplingUMeshDesc::getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const
{
const int *desc_connec=_desc_connec->getConstPointer();
setMeshDimension(tinyInfo[2]);
}
-void MEDCouplingUMeshDesc::getCellsInBoundingBox(const double *bbox, double eps, std::vector<int>& elems) const
+DataArrayInt *MEDCouplingUMeshDesc::getCellsInBoundingBox(const double *bbox, double eps) const
{
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elems=DataArrayInt::New(); elems->alloc(0,1);
int dim=getSpaceDimension();
double* elem_bb=new double[2*dim];
const int* conn = _desc_connec->getConstPointer();
}
}
}
- if (intersectsBoundingBox(elem_bb, bbox, dim, eps))
- {
- elems.push_back(ielem);
- }
+ if(intersectsBoundingBox(elem_bb, bbox, dim, eps))
+ elems->pushBackSilent(ielem);
}
delete [] elem_bb;
+ return elems.retn();
}
-void MEDCouplingUMeshDesc::getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps, std::vector<int>& elems)
+DataArrayInt *MEDCouplingUMeshDesc::getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps)
{
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elems=DataArrayInt::New(); elems->alloc(0,1);
int dim=getSpaceDimension();
double* elem_bb=new double[2*dim];
const int* conn = _desc_connec->getConstPointer();
}
}
if (intersectsBoundingBox(bbox, elem_bb, dim, eps))
- {
- elems.push_back(ielem);
- }
+ elems->pushBackSilent(ielem);
}
delete [] elem_bb;
+ return elems.retn();
}
DataArrayInt *MEDCouplingUMeshDesc::mergeNodes(double precision, bool& areNodesMerged, int& newNbOfNodes)
throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::getVTKDataSetType : not implemented yet !");
}
+DataArrayDouble *MEDCouplingUMeshDesc::computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception)
+{
+ throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::computeIsoBarycenterOfNodesPerCell : not implemented yet !");
+}
+
+void MEDCouplingUMeshDesc::reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception)
+{
+ stream << "MEDCouplingUMeshDesc C++ instance at " << this << ". Name : \"" << getName() << "\".";
+}