X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingCurveLinearMesh.cxx;h=a5158def80dd680168d661ecaa03f84e15a8e165;hb=f13ce72017fd205546293a53f7b041824cb50eec;hp=72fc699495e724f0e9cef07586521e771fc6c603;hpb=eedc1b14c73761aee3f41c268a5f7362aa18678b;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx b/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx index 72fc69949..a5158def8 100644 --- a/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx @@ -168,14 +168,13 @@ void MEDCouplingCurveLinearMesh::checkDeepEquivalWith(const MEDCouplingMesh *oth /*! * Nothing is done here (except to check that the other is a ParaMEDMEM::MEDCouplingCurveLinearMesh instance too). - * The user intend that the nodes are the same, so by construction of ParaMEDMEM::MEDCouplingCurveLinearMesh, 'this' and 'other' are the same ! + * The user intend that the nodes are the same, so by construction of ParaMEDMEM::MEDCouplingCurveLinearMesh, \a this and \a other are the same ! */ void MEDCouplingCurveLinearMesh::checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec, DataArrayInt *&cellCor) const { - const MEDCouplingCurveLinearMesh *otherC=dynamic_cast(other); - if(!otherC) - throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::checkDeepEquivalOnSameNodesWith : other is NOT a cartesian mesh ! Impossible to check equivalence !"); + if(!isEqualWithoutConsideringStr(other,prec)) + throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::checkDeepEquivalOnSameNodesWith : Meshes are not the same !"); } void MEDCouplingCurveLinearMesh::checkCoherency() const @@ -215,43 +214,13 @@ void MEDCouplingCurveLinearMesh::checkCoherency2(double eps) const int MEDCouplingCurveLinearMesh::getNumberOfCells() const { checkCoherency(); - std::size_t nbOfCells=1,i=0; - for(std::vector::const_iterator it=_structure.begin();it!=_structure.end();it++,i++) - nbOfCells*=(*it)-1; - return (int)nbOfCells; + return MEDCouplingStructuredMesh::getNumberOfCells(); } int MEDCouplingCurveLinearMesh::getNumberOfNodes() const { checkCoherency(); - std::size_t nbOfNodes=1; - for(std::vector::const_iterator it=_structure.begin();it!=_structure.end();it++) - nbOfNodes*=(*it); - return (int)nbOfNodes; -} - -void MEDCouplingCurveLinearMesh::getSplitCellValues(int *res) const -{ - int meshDim=getMeshDimension(); - for(int l=0;lgetNumberOfComponents(); } -int MEDCouplingCurveLinearMesh::getMeshDimension() const -{ - return (int)_structure.size(); -} - void MEDCouplingCurveLinearMesh::getCoordinatesOfNode(int nodeId, std::vector& coo) const { if(!((const DataArrayDouble *)_coords)) @@ -350,11 +320,11 @@ std::vector MEDCouplingCurveLinearMesh::getNodeGridStructure() const MEDCouplingStructuredMesh *MEDCouplingCurveLinearMesh::buildStructuredSubPart(const std::vector< std::pair >& cellPart) const { checkCoherency(); - int dim(getMeshDimension()); + int dim(getSpaceDimension()); std::vector dims(getMeshDimension()); if(dim!=(int)cellPart.size()) { - std::ostringstream oss; oss << "MEDCouplingCurveLinearMesh::buildStructuredSubPart : the mesh dimension is " << dim << " and cell part size is " << cellPart.size() << " !"; + std::ostringstream oss; oss << "MEDCouplingCurveLinearMesh::buildStructuredSubPart : the space dimension is " << dim << " and cell part size is " << cellPart.size() << " !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); } std::vector< std::pair > nodePartFormat(cellPart);