From: ageay Date: Tue, 20 Aug 2013 15:31:36 +0000 (+0000) Subject: Suppression of useless MEDCouplingUMeshDesc. X-Git-Tag: V7_3_1b1~191 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9bfceade3bf338dff08d1fcaee9b821b4a8224f9;p=tools%2Fmedcoupling.git Suppression of useless MEDCouplingUMeshDesc. --- diff --git a/src/MEDCoupling/CMakeLists.txt b/src/MEDCoupling/CMakeLists.txt index 520777b52..d89ee9b03 100644 --- a/src/MEDCoupling/CMakeLists.txt +++ b/src/MEDCoupling/CMakeLists.txt @@ -46,7 +46,6 @@ SET(medcoupling_SOURCES MEDCouplingFieldDiscretization.cxx MEDCouplingRefCountObject.cxx MEDCouplingPointSet.cxx - MEDCouplingUMeshDesc.cxx MEDCouplingFieldTemplate.cxx MEDCouplingExtrudedMesh.cxx MEDCouplingMesh.cxx diff --git a/src/MEDCoupling/MEDCouplingUMeshDesc.cxx b/src/MEDCoupling/MEDCouplingUMeshDesc.cxx deleted file mode 100644 index 4279fe86b..000000000 --- a/src/MEDCoupling/MEDCouplingUMeshDesc.cxx +++ /dev/null @@ -1,572 +0,0 @@ -// 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 -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// Author : Anthony Geay (CEA/DEN) - -#include "MEDCouplingUMeshDesc.hxx" -#include "CellModel.hxx" -#include "MEDCouplingMemArray.hxx" -#include "MEDCouplingAutoRefCountObjectPtr.hxx" - -#include -#include - -using namespace ParaMEDMEM; - -MEDCouplingUMeshDesc::MEDCouplingUMeshDesc():_mesh_dim(-2),_desc_connec(0),_desc_connec_index(0), - _nodal_connec_face(0),_nodal_connec_face_index(0) -{ -} - -MEDCouplingUMeshDesc::~MEDCouplingUMeshDesc() -{ - if(_desc_connec) - _desc_connec->decrRef(); - if(_desc_connec_index) - _desc_connec_index->decrRef(); - if(_nodal_connec_face) - _nodal_connec_face->decrRef(); - if(_nodal_connec_face_index) - _nodal_connec_face_index->decrRef(); -} - -MEDCouplingUMeshDesc *MEDCouplingUMeshDesc::New() -{ - return new MEDCouplingUMeshDesc; -} - -MEDCouplingUMeshDesc *MEDCouplingUMeshDesc::New(const char *meshName, int meshDim) -{ - MEDCouplingUMeshDesc *ret=new MEDCouplingUMeshDesc; - ret->setName(meshName); - ret->setMeshDimension(meshDim); - 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 0; -} - -MEDCouplingPointSet *MEDCouplingUMeshDesc::deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); -} - -void MEDCouplingUMeshDesc::shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); -} - -void MEDCouplingUMeshDesc::checkCoherency() const throw(INTERP_KERNEL::Exception) -{ - for(std::set::const_iterator iter=_types.begin();iter!=_types.end();iter++) - { - if((int)INTERP_KERNEL::CellModel::GetCellModel(*iter).getDimension()!=_mesh_dim) - { - std::ostringstream message; - message << "MeshDesc invalid because dimension is " << _mesh_dim << " and there is presence of cell(s) with type " << (*iter); - throw INTERP_KERNEL::Exception(message.str().c_str()); - } - } -} - -void MEDCouplingUMeshDesc::checkCoherency1(double eps) const throw(INTERP_KERNEL::Exception) -{ - checkCoherency(); -} - -void MEDCouplingUMeshDesc::checkCoherency2(double eps) const throw(INTERP_KERNEL::Exception) -{ - checkCoherency1(eps); -} - -void MEDCouplingUMeshDesc::checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec, - DataArrayInt *&cellCor) const throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::checkDeepEquivalOnSameNodesWith : not implemented yet !"); -} - -void MEDCouplingUMeshDesc::setMeshDimension(unsigned meshDim) -{ - _mesh_dim=meshDim; - declareAsNew(); -} - -int MEDCouplingUMeshDesc::getNumberOfCells() const -{ - if(_desc_connec_index) - return _desc_connec_index->getNumberOfTuples()-1; - else - throw INTERP_KERNEL::Exception("Unable to get number of cells because no connectivity specified !"); -} - -int MEDCouplingUMeshDesc::getNumberOfFaces() const -{ - if(_nodal_connec_face_index) - return _nodal_connec_face_index->getNumberOfTuples()-1; - else - throw INTERP_KERNEL::Exception("Unable to get number of faces because no connectivity specified !"); -} - -int MEDCouplingUMeshDesc::getCellMeshLength() const -{ - return _desc_connec->getNbOfElems(); -} - -int MEDCouplingUMeshDesc::getFaceMeshLength() const -{ - return _nodal_connec_face->getNbOfElems(); -} - -INTERP_KERNEL::NormalizedCellType MEDCouplingUMeshDesc::getTypeOfCell(int cellId) const -{ - const int *desc_connec=_desc_connec->getConstPointer(); - const int *desc_connec_index=_desc_connec_index->getConstPointer(); - return (INTERP_KERNEL::NormalizedCellType)desc_connec[desc_connec_index[cellId]+1]; -} - -std::set MEDCouplingUMeshDesc::getAllGeoTypes() const -{ - 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 !"); -} - -DataArrayInt *MEDCouplingUMeshDesc::computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::computeNbOfFacesPerCell : not implemented yet !"); -} - -DataArrayInt *MEDCouplingUMeshDesc::computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::computeEffectiveNbOfNodesPerCell : not implemented yet !"); -} - -int MEDCouplingUMeshDesc::getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const -{ - const int *desc_connec=_desc_connec->getConstPointer(); - const int *desc_connec_index=_desc_connec_index->getConstPointer(); - int nbOfCells=getNumberOfCells(); - int ret=0; - for(int i=0;i& conn) const -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); -} - -std::string MEDCouplingUMeshDesc::simpleRepr() const -{ - std::string ret("Unstructured mesh with descending connectivity : "); - ret+=getName(); - ret+="\n"; - return ret; -} - -std::string MEDCouplingUMeshDesc::advancedRepr() const -{ - std::string ret("Unstructured mesh with descending connectivity : "); - ret+=getName(); - ret+="\n"; - return ret; -} - -void MEDCouplingUMeshDesc::setConnectivity(DataArrayInt *descConn, DataArrayInt *descConnIndex, DataArrayInt *nodalFaceConn, DataArrayInt *nodalFaceConnIndx) -{ - DataArrayInt::SetArrayIn(descConn,_desc_connec); - DataArrayInt::SetArrayIn(descConnIndex,_desc_connec_index); - DataArrayInt::SetArrayIn(nodalFaceConn,_nodal_connec_face); - DataArrayInt::SetArrayIn(nodalFaceConnIndx,_nodal_connec_face_index); - computeTypes(); -} - -std::vector MEDCouplingUMeshDesc::getDistributionOfTypes() const throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); -} - -DataArrayInt *MEDCouplingUMeshDesc::checkTypeConsistencyAndContig(const std::vector& code, const std::vector& idsPerType) const throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); -} - -void MEDCouplingUMeshDesc::splitProfilePerType(const DataArrayInt *profile, std::vector& code, std::vector& idsInPflPerType, std::vector& idsPerType) const throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); -} - -void MEDCouplingUMeshDesc::getTinySerializationInformation(std::vector& tinyInfoD, std::vector& tinyInfo, std::vector& littleStrings) const -{ - MEDCouplingPointSet::getTinySerializationInformation(tinyInfoD,tinyInfo,littleStrings); - tinyInfo.push_back(getMeshDimension()); - tinyInfo.push_back(getNumberOfNodes()); - tinyInfo.push_back(getNumberOfCells()); - tinyInfo.push_back(getCellMeshLength()); - tinyInfo.push_back(getNumberOfFaces()); - tinyInfo.push_back(getFaceMeshLength()); -} - -bool MEDCouplingUMeshDesc::isEmptyMesh(const std::vector& tinyInfo) const -{ - return tinyInfo[5]<=0; -} - -void MEDCouplingUMeshDesc::resizeForUnserialization(const std::vector& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector& littleStrings) const -{ - std::vector tinyInfoTmp(tinyInfo.begin()+1,tinyInfo.end()); - MEDCouplingPointSet::resizeForUnserialization(tinyInfoTmp,a1,a2,littleStrings); - a1->alloc(tinyInfo[5]+tinyInfo[4]+1+tinyInfo[7]+tinyInfo[6]+1,1); -} - -void MEDCouplingUMeshDesc::serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const -{ - MEDCouplingPointSet::serialize(a1,a2); - // - a1=DataArrayInt::New(); - a1->alloc(getCellMeshLength()+getNumberOfCells()+1+getFaceMeshLength()+getNumberOfFaces()+1,1); - int *ptA1=a1->getPointer(); - const int *descConn=_desc_connec->getConstPointer(); - const int *descConnIndex=_desc_connec_index->getConstPointer(); - const int *faceConn=_nodal_connec_face->getConstPointer(); - const int *faceConnIndex=_nodal_connec_face_index->getConstPointer(); - ptA1=std::copy(descConn,descConn+getCellMeshLength(),ptA1); - ptA1=std::copy(descConnIndex,descConnIndex+getNumberOfCells()+1,ptA1); - ptA1=std::copy(faceConn,faceConn+getFaceMeshLength(),ptA1); - std::copy(faceConnIndex,faceConnIndex+getNumberOfFaces()+1,ptA1); -} - -void MEDCouplingUMeshDesc::unserialization(const std::vector& tinyInfoD, const std::vector& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector& littleStrings) -{ - std::vector tinyInfoTmp(tinyInfo.begin()+1,tinyInfo.end()); - MEDCouplingPointSet::unserialization(tinyInfoD,tinyInfoTmp,a1,a2,littleStrings); - // - const int *recvBuffer=a1->getConstPointer(); - DataArrayInt *descConn=DataArrayInt::New(); - descConn->alloc(tinyInfo[5],1); - std::copy(recvBuffer,recvBuffer+tinyInfo[5],descConn->getPointer()); - DataArrayInt *descConnIndex=DataArrayInt::New(); - descConnIndex->alloc(tinyInfo[4]+1,1); - std::copy(recvBuffer+tinyInfo[5],recvBuffer+tinyInfo[5]+tinyInfo[4]+1,descConnIndex->getPointer()); - DataArrayInt *faceConn=DataArrayInt::New(); - faceConn->alloc(tinyInfo[7],1); - std::copy(recvBuffer+tinyInfo[5]+tinyInfo[4]+1,recvBuffer+tinyInfo[5]+tinyInfo[4]+1+tinyInfo[7],faceConn->getPointer()); - DataArrayInt *faceConnIndex=DataArrayInt::New(); - faceConnIndex->alloc(tinyInfo[6]+1,1); - std::copy(recvBuffer+tinyInfo[5]+tinyInfo[4]+1+tinyInfo[7], - recvBuffer+tinyInfo[5]+tinyInfo[5]+1+tinyInfo[7]+tinyInfo[6]+1,faceConnIndex->getPointer()); - setConnectivity(descConn,descConnIndex,faceConn,faceConnIndex); - descConn->decrRef(); - descConnIndex->decrRef(); - faceConn->decrRef(); - faceConnIndex->decrRef(); - setMeshDimension(tinyInfo[2]); -} - -DataArrayDouble *MEDCouplingUMeshDesc::getBoundingBoxForBBTree() const -{ - throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::getBoundingBoxForBBTree : not implemented yet !"); -} - -DataArrayInt *MEDCouplingUMeshDesc::getCellsInBoundingBox(const double *bbox, double eps) const -{ - MEDCouplingAutoRefCountObjectPtr elems=DataArrayInt::New(); elems->alloc(0,1); - int dim=getSpaceDimension(); - double* elem_bb=new double[2*dim]; - const int* conn = _desc_connec->getConstPointer(); - const int* conn_index= _desc_connec_index->getConstPointer(); - const int* face = _nodal_connec_face->getConstPointer(); - const int* face_index= _nodal_connec_face_index->getConstPointer(); - const double* coords = getCoords()->getConstPointer(); - int nbOfCells=getNumberOfCells(); - for ( int ielem=0; ielem::max(); - elem_bb[i*2+1]=-std::numeric_limits::max(); - } - - for (int jface=conn_index[ielem]+1; jface elem_bb[idim*2+1] ) - { - elem_bb[idim*2+1] = coords[node*dim+idim] ; - } - } - } - } - if(intersectsBoundingBox(elem_bb, bbox, dim, eps)) - elems->pushBackSilent(ielem); - } - delete [] elem_bb; - return elems.retn(); -} - -DataArrayInt *MEDCouplingUMeshDesc::getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps) -{ - MEDCouplingAutoRefCountObjectPtr elems=DataArrayInt::New(); elems->alloc(0,1); - int dim=getSpaceDimension(); - double* elem_bb=new double[2*dim]; - const int* conn = _desc_connec->getConstPointer(); - const int* conn_index= _desc_connec_index->getConstPointer(); - const int* face = _nodal_connec_face->getConstPointer(); - const int* face_index= _nodal_connec_face_index->getConstPointer(); - const double* coords = getCoords()->getConstPointer(); - int nbOfCells=getNumberOfCells(); - for ( int ielem=0; ielem::max(); - elem_bb[i*2+1]=-std::numeric_limits::max(); - } - - for (int jface=conn_index[ielem]+1; jface elem_bb[idim*2+1] ) - { - elem_bb[idim*2+1] = coords[node*dim+idim] ; - } - } - } - } - if (intersectsBoundingBox(bbox, elem_bb, dim, eps)) - elems->pushBackSilent(ielem); - } - delete [] elem_bb; - return elems.retn(); -} - -MEDCouplingPointSet *MEDCouplingUMeshDesc::mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); -} - -MEDCouplingPointSet *MEDCouplingUMeshDesc::buildPartOfMySelfNode(const int *start, const int *end, bool fullyIn) const -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); - return 0; -} - -MEDCouplingPointSet *MEDCouplingUMeshDesc::buildFacePartOfMySelfNode(const int *start, const int *end, bool fullyIn) const -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); - return 0; -} - -MEDCouplingPointSet *MEDCouplingUMeshDesc::buildPartOfMySelfKeepCoords(const int *begin, const int *end) const -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); -} - -MEDCouplingPointSet *MEDCouplingUMeshDesc::buildPartOfMySelfKeepCoords2(int start, int end, int step) const -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); -} - -void MEDCouplingUMeshDesc::computeNodeIdsAlg(std::vector& nodeIdsInUse) const throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); -} - -DataArrayInt *MEDCouplingUMeshDesc::simplexize(int policy) throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::simplexize : Not implemented yet !"); -} - -DataArrayInt *MEDCouplingUMeshDesc::findBoundaryNodes() const -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); -} - -MEDCouplingPointSet *MEDCouplingUMeshDesc::buildBoundaryMesh(bool keepCoords) const -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); - return 0; -} - -MEDCouplingUMesh *MEDCouplingUMeshDesc::buildUnstructured() const throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::buildUnstructured : not implemented yet !"); -} - -void MEDCouplingUMeshDesc::renumberCells(const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("Available for UMesh desc but not implemented yet !"); -} - -void MEDCouplingUMeshDesc::renumberNodesInConn(const int *newNodeNumbersO2N) -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); -} - -MEDCouplingFieldDouble *MEDCouplingUMeshDesc::getMeasureField(bool isAbs) const -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); - return 0; -} - -MEDCouplingFieldDouble *MEDCouplingUMeshDesc::getMeasureFieldOnNode(bool isAbs) const -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); - return 0; -} - -MEDCouplingFieldDouble *MEDCouplingUMeshDesc::buildOrthogonalField() const -{ - if(getMeshDimension()!=2) - throw INTERP_KERNEL::Exception("Expected a cmesh with meshDim == 2 !"); - throw INTERP_KERNEL::Exception("Not implemented yet !"); - return 0; -} - -DataArrayInt *MEDCouplingUMeshDesc::zipCoordsTraducer() throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); - return 0; -} - -void MEDCouplingUMeshDesc::findCommonCells(int compType, int startCellId, DataArrayInt *& commonCellsArr, DataArrayInt *& commonCellsIArr) const throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); -} - -void MEDCouplingUMeshDesc::getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); -} - -void MEDCouplingUMeshDesc::computeTypes() -{ - if(_desc_connec && _desc_connec_index) - { - _types.clear(); - const int *conn=_desc_connec->getConstPointer(); - const int *connIndex=_desc_connec_index->getConstPointer(); - int nbOfElem=_desc_connec_index->getNbOfElems()-1; - for(const int *pt=connIndex;pt!=connIndex+nbOfElem;pt++) - _types.insert((INTERP_KERNEL::NormalizedCellType)conn[*pt]); - } -} - -void MEDCouplingUMeshDesc::checkFullyDefined() const throw(INTERP_KERNEL::Exception) -{ - if(!_desc_connec || !_desc_connec_index || !_nodal_connec_face || !_nodal_connec_face_index || !_coords) - throw INTERP_KERNEL::Exception("full connectivity and coordinates not set in unstructured mesh."); -} - -MEDCouplingMesh *MEDCouplingUMeshDesc::mergeMyselfWith(const MEDCouplingMesh *other) const -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); - return 0; -} - -DataArrayInt *MEDCouplingUMeshDesc::getNodeIdsInUse(int& nbrOfNodesInUse) const throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); -} - -void MEDCouplingUMeshDesc::fillCellIdsToKeepFromNodeIds(const int *begin, const int *end, bool fullyIn, DataArrayInt *&cellIdsKeptArr) const -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); -} - -DataArrayDouble *MEDCouplingUMeshDesc::getBarycenterAndOwner() const -{ - throw INTERP_KERNEL::Exception("Not implemented yet !"); - return 0; -} - -int MEDCouplingUMeshDesc::getCellContainingPoint(const double *pos, double eps) const -{ - throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::getCellContainingPoint : not implemented yet !"); -} - -void MEDCouplingUMeshDesc::writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData) const throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::writeVTKLL : not implemented yet !"); -} - -std::string MEDCouplingUMeshDesc::getVTKDataSetType() const throw(INTERP_KERNEL::Exception) -{ - 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() << "\"."; -} - -int MEDCouplingUMeshDesc::getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception) -{ - throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::getNumberOfNodesInCell : not implemented yet !"); -} diff --git a/src/MEDCoupling/MEDCouplingUMeshDesc.hxx b/src/MEDCoupling/MEDCouplingUMeshDesc.hxx deleted file mode 100644 index 093698e77..000000000 --- a/src/MEDCoupling/MEDCouplingUMeshDesc.hxx +++ /dev/null @@ -1,119 +0,0 @@ -// 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 -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// Author : Anthony Geay (CEA/DEN) - -#ifndef __PARAMEDMEM_MEDCOUPLINGUMESHDESC_HXX__ -#define __PARAMEDMEM_MEDCOUPLINGUMESHDESC_HXX__ - -#include "MEDCouplingPointSet.hxx" -#include "MEDCoupling.hxx" -#include "NormalizedUnstructuredMesh.hxx" - -#include - -namespace ParaMEDMEM -{ - class MEDCouplingUMeshDesc : public MEDCouplingPointSet - { - public: - MEDCOUPLING_EXPORT static MEDCouplingUMeshDesc *New(); - MEDCOUPLING_EXPORT static MEDCouplingUMeshDesc *New(const char *meshName, int meshDim); - MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const; - MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const; - MEDCOUPLING_EXPORT MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT void checkCoherency() const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT void checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec, - DataArrayInt *&cellCor) const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT void setMeshDimension(unsigned meshDim); - MEDCOUPLING_EXPORT int getNumberOfCells() const; - MEDCOUPLING_EXPORT int getNumberOfFaces() const; - MEDCOUPLING_EXPORT int getCellMeshLength() const; - MEDCOUPLING_EXPORT int getFaceMeshLength() const; - MEDCOUPLING_EXPORT int getMeshDimension() const { return _mesh_dim; } - MEDCOUPLING_EXPORT INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const; - MEDCOUPLING_EXPORT std::set getAllGeoTypes() const; - MEDCOUPLING_EXPORT DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const; - MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector& conn) const; - MEDCOUPLING_EXPORT int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT std::string simpleRepr() const; - MEDCOUPLING_EXPORT std::string advancedRepr() const; - MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return UNSTRUCTURED_DESC; } - MEDCOUPLING_EXPORT void setConnectivity(DataArrayInt *descConn, DataArrayInt *descConnIndex, DataArrayInt *nodalFaceConn, DataArrayInt *nodalFaceConnIndx); - //tools to overload - MEDCOUPLING_EXPORT std::vector getDistributionOfTypes() const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT DataArrayInt *checkTypeConsistencyAndContig(const std::vector& code, const std::vector& idsPerType) const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT void splitProfilePerType(const DataArrayInt *profile, std::vector& code, std::vector& idsInPflPerType, std::vector& idsPerType) const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT void getTinySerializationInformation(std::vector& tinyInfoD, std::vector& tinyInfo, std::vector& littleStrings) const; - MEDCOUPLING_EXPORT bool isEmptyMesh(const std::vector& tinyInfo) const; - MEDCOUPLING_EXPORT void resizeForUnserialization(const std::vector& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector& littleStrings) const; - MEDCOUPLING_EXPORT void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const; - MEDCOUPLING_EXPORT void unserialization(const std::vector& tinyInfoD, const std::vector& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector& littleStrings); - MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTree() const; - MEDCOUPLING_EXPORT DataArrayInt *getCellsInBoundingBox(const double *bbox, double eps) const; - MEDCOUPLING_EXPORT DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps); - MEDCOUPLING_EXPORT MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const; - MEDCOUPLING_EXPORT DataArrayInt *getNodeIdsInUse(int& nbrOfNodesInUse) const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT void fillCellIdsToKeepFromNodeIds(const int *begin, const int *end, bool fullyIn, DataArrayInt *&cellIdsKeptArr) const; - MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoords(const int *begin, const int *end) const; - MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoords2(int start, int end, int step) const; - MEDCOUPLING_EXPORT void computeNodeIdsAlg(std::vector& nodeIdsInUse) const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfNode(const int *start, const int *end, bool fullyIn) const; - MEDCOUPLING_EXPORT MEDCouplingPointSet *buildFacePartOfMySelfNode(const int *start, const int *end, bool fullyIn) const; - MEDCOUPLING_EXPORT DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT DataArrayInt *findBoundaryNodes() const; - MEDCOUPLING_EXPORT MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const; - MEDCOUPLING_EXPORT MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT void renumberCells(const int *old2NewBg, bool check=true) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT void renumberNodesInConn(const int *newNodeNumbersO2N); - MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureField(bool isAbs) const; - MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const; - MEDCOUPLING_EXPORT int getCellContainingPoint(const double *pos, double eps) const; - MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildOrthogonalField() const; - MEDCOUPLING_EXPORT DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT void findCommonCells(int compType, int startCellId, DataArrayInt *& commonCellsArr, DataArrayInt *& commonCellsIArr) const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT void getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const; - MEDCOUPLING_EXPORT DataArrayDouble *getBarycenterAndOwner() const; - MEDCOUPLING_EXPORT DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception); - private: - MEDCouplingUMeshDesc(); - ~MEDCouplingUMeshDesc(); - void computeTypes(); - void checkFullyDefined() const throw(INTERP_KERNEL::Exception); - void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData) const throw(INTERP_KERNEL::Exception); - void reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception); - std::string getVTKDataSetType() const throw(INTERP_KERNEL::Exception); - private: - int _mesh_dim; - DataArrayInt *_desc_connec; - DataArrayInt *_desc_connec_index; - DataArrayInt *_nodal_connec_face; - DataArrayInt *_nodal_connec_face_index; - std::set _types; - }; -} - -#endif