From 8536a3a6c0c03947d651fdd3a0c1f32cd4eb3e2e Mon Sep 17 00:00:00 2001 From: geay Date: Fri, 4 Apr 2014 12:27:01 +0200 Subject: [PATCH] Unwarnigization campaign. First auto indentation with Eclipse on MEDCouplingUMesh. --- .../Geometric2D/InterpKernelGeo2DBounds.cxx | 4 +- .../InterpKernelGeo2DEdgeArcCircle.cxx | 5 +- src/MEDCoupling/MEDCouplingStructuredMesh.cxx | 4 +- src/MEDCoupling/MEDCouplingUMesh.cxx | 416 +++++++++--------- src/MEDCoupling/MEDCouplingUMesh.hxx | 27 +- 5 files changed, 225 insertions(+), 231 deletions(-) diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DBounds.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DBounds.cxx index 09e7df58f..da586f518 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DBounds.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DBounds.cxx @@ -103,8 +103,8 @@ void Bounds::prepareForAggregation() * If diagonal of 'this' is the same order of 2*radius, intrcptArcAngle0 and intrcptArcDelta remains unchanged. * @param center IN parameter. * @param radius IN parameter. - * @param intrcptArcAngle0 OUT parameter. - * @param intrcptArcDelta IN/OUT parameter. + * @param [out] intrcptArcAngle0 OUT parameter. + * @param [out] intrcptArcDelta OUT parameter. */ void Bounds::getInterceptedArc(const double *center, double radius, double& intrcptArcAngle0, double& intrcptArcDelta) const { diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx index 9511658fe..9bd2c7bad 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx @@ -119,17 +119,16 @@ double ArcCArcCIntersector::getAngle(Node *node) const bool ArcCArcCIntersector::internalAreColinears(const EdgeArcCircle& a1, const EdgeArcCircle& a2, double& distBetweenCenters, double& cst, double& radiusL, double centerL[2], double& radiusB, double centerB[2]) { - double angle0L,angleL; double lgth1=fabs(a1.getAngle()*a1.getRadius()); double lgth2=fabs(a2.getAngle()*a2.getRadius()); if(lgth1 conn(DataArrayInt::New()); conn->alloc(4*GetNumberOfCellsOfSubLevelMesh(ngs,3)); - int *cp(conn->getPointer()),pos(0); + int *cp(conn->getPointer()); //X for(int i=0;i conn(DataArrayInt::New()); conn->alloc(2*GetNumberOfCellsOfSubLevelMesh(ngs,2)); - int *cp(conn->getPointer()),pos(0); + int *cp(conn->getPointer()); //X for(int i=0;i::const_iterator iter=_types.begin();iter!=_types.end();iter++) @@ -565,8 +565,8 @@ bool MEDCouplingUMesh::isEqualWithoutConsideringStr(const MEDCouplingMesh *other */ void MEDCouplingUMesh::checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const { - MEDCouplingPointSet::checkFastEquivalWith(other,prec); - const MEDCouplingUMesh *otherC=dynamic_cast(other); + MEDCouplingPointSet::checkFastEquivalWith(other,prec); + const MEDCouplingUMesh *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::checkFastEquivalWith : Two meshes are not not unstructured !"); } @@ -843,7 +843,7 @@ void MEDCouplingUMesh::computeNeighborsOfCells(DataArrayInt *&neighbors, DataArr * \param [out] neighborsIndx is an array of size this->getNumberOfCells()+1 newly allocated and should be dealt by the caller. This arrays allow to use the first output parameter \b neighbors. */ void MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descIndx, const DataArrayInt *revDesc, const DataArrayInt *revDescIndx, - DataArrayInt *&neighbors, DataArrayInt *&neighborsIndx) throw(INTERP_KERNEL::Exception) + DataArrayInt *&neighbors, DataArrayInt *&neighborsIndx) { if(!desc || !descIndx || !revDesc || !revDescIndx) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ComputeNeighborsOfCellsAdv some input array is empty !"); @@ -1252,7 +1252,7 @@ bool MEDCouplingUMesh::unPolyze() if(cm.isDynamic()) { switch(cm.getDimension()) - { + { case 2: { INTERP_KERNEL::AutoPtr tmp=new int[lgthOfCurCell-1]; @@ -1272,7 +1272,7 @@ bool MEDCouplingUMesh::unPolyze() newType=(lgthOfCurCell==3)?INTERP_KERNEL::NORM_SEG2:INTERP_KERNEL::NORM_POLYL; break; } - } + } ret=ret || (newType!=type); conn[newPos]=newType; newPos+=newLgth+1; @@ -1547,7 +1547,7 @@ DataArrayInt *MEDCouplingUMesh::zipCoordsTraducer() int MEDCouplingUMesh::AreCellsEqual(const int *conn, const int *connI, int cell1, int cell2, int compType) { switch(compType) - { + { case 0: return AreCellsEqual0(conn,connI,cell1,cell2); case 1: @@ -1558,7 +1558,7 @@ int MEDCouplingUMesh::AreCellsEqual(const int *conn, const int *connI, int cell1 return AreCellsEqual3(conn,connI,cell1,cell2); case 7: return AreCellsEqual7(conn,connI,cell1,cell2); - } + } throw INTERP_KERNEL::Exception("Unknown comparison asked ! Must be in 0,1,2,3 or 7."); } @@ -1668,7 +1668,7 @@ int MEDCouplingUMesh::AreCellsEqual7(const int *conn, const int *connI, int cell else return 0; } - + return work!=tmp+sz1?1:0; } else @@ -1756,7 +1756,7 @@ void MEDCouplingUMesh::findCommonCells(int compType, int startCellId, DataArrayI } void MEDCouplingUMesh::FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI, - DataArrayInt *& commonCellsArr, DataArrayInt *& commonCellsIArr) throw(INTERP_KERNEL::Exception) + DataArrayInt *& commonCellsArr, DataArrayInt *& commonCellsIArr) { MEDCouplingAutoRefCountObjectPtr commonCells=DataArrayInt::New(),commonCellsI=DataArrayInt::New(); commonCells->alloc(0,1); int nbOfCells=nodalI->getNumberOfTuples()-1; @@ -2385,7 +2385,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildUnstructured() const * \warning This method modifies param \b otherDimM1OnSameCoords (for speed reasons). */ void MEDCouplingUMesh::findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords, DataArrayInt *& nodeIdsToDuplicate, - DataArrayInt *& cellIdsNeededToBeRenum, DataArrayInt *& cellIdsNotModified) const throw(INTERP_KERNEL::Exception) + DataArrayInt *& cellIdsNeededToBeRenum, DataArrayInt *& cellIdsNotModified) const { checkFullyDefined(); otherDimM1OnSameCoords.checkFullyDefined(); @@ -2747,7 +2747,7 @@ INTERP_KERNEL::NormalizedCellType MEDCouplingUMesh::getTypeOfCell(int cellId) co */ DataArrayInt *MEDCouplingUMesh::giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const { - + MEDCouplingAutoRefCountObjectPtr ret=DataArrayInt::New(); ret->alloc(0,1); checkConnectivityFullyDefined(); @@ -3011,8 +3011,8 @@ void MEDCouplingUMesh::setConnectivity(DataArrayInt *conn, DataArrayInt *connInd * If 'deeCpy' is true all arrays (coordinates and connectivities) are deeply copied. */ MEDCouplingUMesh::MEDCouplingUMesh(const MEDCouplingUMesh& other, bool deepCopy):MEDCouplingPointSet(other,deepCopy),_mesh_dim(other._mesh_dim), - _nodal_connec(0),_nodal_connec_index(0), - _types(other._types) + _nodal_connec(0),_nodal_connec_index(0), + _types(other._types) { if(other._nodal_connec) _nodal_connec=other._nodal_connec->performCpy(deepCopy); @@ -3575,29 +3575,29 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::buildPartOrthogonalField(const int *be */ MEDCouplingFieldDouble *MEDCouplingUMesh::buildDirectionVectorField() const { - if(getMeshDimension()!=1) + if(getMeshDimension()!=1) throw INTERP_KERNEL::Exception("Expected a umesh with meshDim == 1 for buildDirectionVectorField !"); - if(_types.size()!=1 || *(_types.begin())!=INTERP_KERNEL::NORM_SEG2) - throw INTERP_KERNEL::Exception("Expected a umesh with only NORM_SEG2 type of elements for buildDirectionVectorField !"); - MEDCouplingAutoRefCountObjectPtr ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME); - MEDCouplingAutoRefCountObjectPtr array=DataArrayDouble::New(); - int nbOfCells=getNumberOfCells(); - int spaceDim=getSpaceDimension(); - array->alloc(nbOfCells,spaceDim); - double *pt=array->getPointer(); - const double *coo=getCoords()->getConstPointer(); - std::vector conn; - conn.reserve(2); - for(int i=0;i()); - } - ret->setArray(array); - ret->setMesh(this); - ret->synchronizeTimeWithSupport(); - return ret.retn(); + if(_types.size()!=1 || *(_types.begin())!=INTERP_KERNEL::NORM_SEG2) + throw INTERP_KERNEL::Exception("Expected a umesh with only NORM_SEG2 type of elements for buildDirectionVectorField !"); + MEDCouplingAutoRefCountObjectPtr ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME); + MEDCouplingAutoRefCountObjectPtr array=DataArrayDouble::New(); + int nbOfCells=getNumberOfCells(); + int spaceDim=getSpaceDimension(); + array->alloc(nbOfCells,spaceDim); + double *pt=array->getPointer(); + const double *coo=getCoords()->getConstPointer(); + std::vector conn; + conn.reserve(2); + for(int i=0;i()); + } + ret->setArray(array); + ret->setMesh(this); + ret->synchronizeTimeWithSupport(); + return ret.retn(); } /*! @@ -3840,31 +3840,31 @@ void MEDCouplingUMesh::project1D(const double *pt, const double *v, double eps, { if(getMeshDimension()!=1) throw INTERP_KERNEL::Exception("Expected a umesh with meshDim == 1 for project1D !"); - if(_types.size()!=1 || *(_types.begin())!=INTERP_KERNEL::NORM_SEG2) - throw INTERP_KERNEL::Exception("Expected a umesh with only NORM_SEG2 type of elements for project1D !"); - if(getSpaceDimension()!=3) - throw INTERP_KERNEL::Exception("Expected a umesh with spaceDim==3 for project1D !"); - MEDCouplingAutoRefCountObjectPtr f=buildDirectionVectorField(); - const double *fPtr=f->getArray()->getConstPointer(); - double tmp[3]; - for(int i=0;i(tmp); - n1/=INTERP_KERNEL::norm<3>(tmp1); - if(n1>eps) - throw INTERP_KERNEL::Exception("UMesh::Projection 1D failed !"); - } - const double *coo=getCoords()->getConstPointer(); - for(int i=0;i()); - std::transform(tmp,tmp+3,v,tmp,std::multiplies()); - res[i]=std::accumulate(tmp,tmp+3,0.); - } + if(_types.size()!=1 || *(_types.begin())!=INTERP_KERNEL::NORM_SEG2) + throw INTERP_KERNEL::Exception("Expected a umesh with only NORM_SEG2 type of elements for project1D !"); + if(getSpaceDimension()!=3) + throw INTERP_KERNEL::Exception("Expected a umesh with spaceDim==3 for project1D !"); + MEDCouplingAutoRefCountObjectPtr f=buildDirectionVectorField(); + const double *fPtr=f->getArray()->getConstPointer(); + double tmp[3]; + for(int i=0;i(tmp); + n1/=INTERP_KERNEL::norm<3>(tmp1); + if(n1>eps) + throw INTERP_KERNEL::Exception("UMesh::Projection 1D failed !"); + } + const double *coo=getCoords()->getConstPointer(); + for(int i=0;i()); + std::transform(tmp,tmp+3,v,tmp,std::multiplies()); + res[i]=std::accumulate(tmp,tmp+3,0.); + } } /*! @@ -3872,7 +3872,7 @@ void MEDCouplingUMesh::project1D(const double *pt, const double *v, double eps, * \a this is expected to be a mesh so that its space dimension is equal to its * mesh dimension + 1. Furthermore only mesh dimension 1 and 2 are supported for the moment. * Distance from \a ptBg to \a ptEnd is expected to be equal to the space dimension. \a this is also expected to be fully defined (connectivity and coordinates). - + * * WARNING, if there is some orphan nodes in \a this (nodes not fetched by any cells in \a this ( see MEDCouplingUMesh::zipCoords ) ) these nodes will ** not ** been taken * into account in this method. Only cells and nodes lying on them are considered in the algorithm (even if one of these orphan nodes is closer than returned distance). * A user that needs to consider orphan nodes should invoke DataArrayDouble::minimalDistanceTo method on the coordinates array of \a this. @@ -3954,7 +3954,7 @@ DataArrayDouble *MEDCouplingUMesh::distanceToPoints(const DataArrayDouble *pts, MEDCouplingAutoRefCountObjectPtr bboxArr(getBoundingBoxForBBTree()); const double *bbox(bboxArr->begin()); switch(spaceDim) - { + { case 3: { BBTreeDst<3> myTree(bbox,0,0,nbCells); @@ -3983,7 +3983,7 @@ DataArrayDouble *MEDCouplingUMesh::distanceToPoints(const DataArrayDouble *pts, } default: throw INTERP_KERNEL::Exception("MEDCouplingUMesh::distanceToPoints : only spacedim 2 and 3 supported !"); - } + } cellIds=ret1.retn(); return ret0.retn(); } @@ -4005,7 +4005,7 @@ void MEDCouplingUMesh::DistanceToPoint3DSurfAlg(const double *pt, const int *cel for(const int *zeCell=cellIdsBg;zeCell!=cellIdsEnd;zeCell++) { switch((INTERP_KERNEL::NormalizedCellType)nc[ncI[*zeCell]]) - { + { case INTERP_KERNEL::NORM_TRI3: { double tmp=INTERP_KERNEL::DistanceFromPtToTriInSpaceDim3(pt,coords+3*nc[ncI[*zeCell]+1],coords+3*nc[ncI[*zeCell]+2],coords+3*nc[ncI[*zeCell]+3]); @@ -4023,7 +4023,7 @@ void MEDCouplingUMesh::DistanceToPoint3DSurfAlg(const double *pt, const int *cel } default: throw INTERP_KERNEL::Exception("MEDCouplingUMesh::distanceToPoint3DSurfAlg : not managed cell type ! Supporting TRI3, QUAD4 and POLYGON !"); - } + } } } @@ -4043,8 +4043,8 @@ void MEDCouplingUMesh::DistanceToPoint2DCurveAlg(const double *pt, const int *ce ret0=std::numeric_limits::max(); for(const int *zeCell=cellIdsBg;zeCell!=cellIdsEnd;zeCell++) { - switch((INTERP_KERNEL::NormalizedCellType)nc[ncI[*zeCell]]) - { + switch((INTERP_KERNEL::NormalizedCellType)nc[ncI[*zeCell]]) + { case INTERP_KERNEL::NORM_SEG2: { std::size_t uselessEntry=0; @@ -4056,7 +4056,7 @@ void MEDCouplingUMesh::DistanceToPoint2DCurveAlg(const double *pt, const int *ce } default: throw INTERP_KERNEL::Exception("MEDCouplingUMesh::distanceToPoint2DCurveAlg : not managed cell type ! Supporting SEG2 !"); - } + } } } @@ -4130,7 +4130,7 @@ namespace ParaMEDMEM INTERP_KERNEL::NormalizedCellType getTypeOfElement(int) const { return (INTERP_KERNEL::NormalizedCellType)0; } // end }; - + /*! * Warning the nodes in \a m should be decrRefed ! To avoid that Node * pointer be replaced by another instance. */ @@ -4140,7 +4140,7 @@ namespace ParaMEDMEM INTERP_KERNEL::Node *n0(new INTERP_KERNEL::Node(coords2D[2*bg[0]],coords2D[2*bg[0]+1])),*n1(new INTERP_KERNEL::Node(coords2D[2*bg[1]],coords2D[2*bg[1]+1])); m[n0]=bg[0]; m[n1]=bg[1]; switch(typ) - { + { case INTERP_KERNEL::NORM_SEG2: { ret=new INTERP_KERNEL::EdgeLin(n0,n1); @@ -4162,7 +4162,7 @@ namespace ParaMEDMEM } default: throw INTERP_KERNEL::Exception("MEDCouplingUMeshBuildQPFromEdge2 : Expecting a mesh with spaceDim==2 and meshDim==1 !"); - } + } return ret; } @@ -4170,7 +4170,7 @@ namespace ParaMEDMEM { INTERP_KERNEL::Edge *ret=0; switch(typ) - { + { case INTERP_KERNEL::NORM_SEG2: { ret=new INTERP_KERNEL::EdgeLin(mapp2[bg[0]].first,mapp2[bg[1]].first); @@ -4193,7 +4193,7 @@ namespace ParaMEDMEM } default: throw INTERP_KERNEL::Exception("MEDCouplingUMeshBuildQPFromEdge : Expecting a mesh with spaceDim==2 and meshDim==1 !"); - } + } return ret; } @@ -4204,8 +4204,7 @@ namespace ParaMEDMEM * 'mapp' returns a mapping between local numbering in submesh (represented by a Node*) and the global node numbering in 'mDesc'. */ INTERP_KERNEL::QuadraticPolygon *MEDCouplingUMeshBuildQPFromMesh(const MEDCouplingUMesh *mDesc, const std::vector& candidates, - std::map& mapp) - throw(INTERP_KERNEL::Exception) + std::map& mapp) { mapp.clear(); std::map > mapp2;//bool is for a flag specifying if node is boundary (true) or only a middle for SEG3. @@ -4380,7 +4379,7 @@ void MEDCouplingUMesh::getCellsContainingPoints(const double *pos, int nbOfPoint } /*else if(mDim==2) { - + }*/ else throw INTERP_KERNEL::Exception("For spaceDim==3 only meshDim==3 implemented for getelementscontainingpoints !"); @@ -4524,7 +4523,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildExtrudedMesh(const MEDCouplingUMesh *me int oldNbOfNodes=getNumberOfNodes(); MEDCouplingAutoRefCountObjectPtr newCoords; switch(policy) - { + { case 0: { newCoords=fillExtCoordsUsingTranslation(mesh1D,isQuad); @@ -4537,7 +4536,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildExtrudedMesh(const MEDCouplingUMesh *me } default: throw INTERP_KERNEL::Exception("Not implemented extrusion policy : must be in (0) !"); - } + } setCoords(newCoords); MEDCouplingAutoRefCountObjectPtr ret=buildExtrudedMeshFromThisLowLev(oldNbOfNodes,isQuad); updateTime(); @@ -4775,7 +4774,6 @@ DataArrayDouble *MEDCouplingUMesh::fillExtCoordsUsingTranslAndAutoRotation3D(con double cosangle=i+1rotate(end,vecPlane,angle); - } retPtr=std::copy(tmp2->getConstPointer(),tmp2->getConstPointer()+tmp2->getNbOfElems(),retPtr); } @@ -4963,10 +4961,10 @@ DataArrayInt *MEDCouplingUMesh::convertLinearCellsToQuadratic(int conversionType MEDCouplingAutoRefCountObjectPtr coordsSafe; int meshDim=getMeshDimension(); switch(conversionType) - { + { case 0: switch(meshDim) - { + { case 1: ret=convertLinearCellsToQuadratic1D0(conn,connI,coords,types); connSafe=conn; connISafe=connI; coordsSafe=coords; @@ -4981,32 +4979,32 @@ DataArrayInt *MEDCouplingUMesh::convertLinearCellsToQuadratic(int conversionType break; default: throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertLinearCellsToQuadratic : conversion of type 0 mesh dimensions available are [1,2,3] !"); - } + } break; - case 1: - { - switch(meshDim) - { case 1: - ret=convertLinearCellsToQuadratic1D0(conn,connI,coords,types);//it is not a bug. In 1D policy 0 and 1 are equals - connSafe=conn; connISafe=connI; coordsSafe=coords; - break; - case 2: - ret=convertLinearCellsToQuadratic2D1(conn,connI,coords,types); - connSafe=conn; connISafe=connI; coordsSafe=coords; - break; - case 3: - ret=convertLinearCellsToQuadratic3D1(conn,connI,coords,types); - connSafe=conn; connISafe=connI; coordsSafe=coords; - break; + { + switch(meshDim) + { + case 1: + ret=convertLinearCellsToQuadratic1D0(conn,connI,coords,types);//it is not a bug. In 1D policy 0 and 1 are equals + connSafe=conn; connISafe=connI; coordsSafe=coords; + break; + case 2: + ret=convertLinearCellsToQuadratic2D1(conn,connI,coords,types); + connSafe=conn; connISafe=connI; coordsSafe=coords; + break; + case 3: + ret=convertLinearCellsToQuadratic3D1(conn,connI,coords,types); + connSafe=conn; connISafe=connI; coordsSafe=coords; + break; + default: + throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertLinearCellsToQuadratic : conversion of type 1 mesh dimensions available are [1,2,3] !"); + } + break; + } default: - throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertLinearCellsToQuadratic : conversion of type 1 mesh dimensions available are [1,2,3] !"); - } - break; - } - default: - throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertLinearCellsToQuadratic : conversion type available are 0 (default, the simplest) and 1 (the most complex) !"); - } + throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertLinearCellsToQuadratic : conversion type available are 0 (default, the simplest) and 1 (the most complex) !"); + } setConnectivity(connSafe,connISafe,false); _types=types; setCoords(coordsSafe); @@ -5108,7 +5106,6 @@ DataArrayInt *MEDCouplingUMesh::convertLinearCellsToQuadratic2DAnd3D0(const MEDC */ DataArrayInt *MEDCouplingUMesh::convertLinearCellsToQuadratic2D0(DataArrayInt *&conn, DataArrayInt *&connI, DataArrayDouble *& coords, std::set& types) const { - MEDCouplingAutoRefCountObjectPtr desc(DataArrayInt::New()),descI(DataArrayInt::New()),tmp2(DataArrayInt::New()),tmp3(DataArrayInt::New()); MEDCouplingAutoRefCountObjectPtr m1D=buildDescendingConnectivity(desc,descI,tmp2,tmp3); tmp2=0; tmp3=0; return convertLinearCellsToQuadratic2DAnd3D0(m1D,desc,descI,conn,connI,coords,types); @@ -5397,18 +5394,18 @@ void MEDCouplingUMesh::tessellate2DCurve(double eps) DataArrayInt *MEDCouplingUMesh::simplexize(int policy) { switch(policy) - { + { case 0: return simplexizePol0(); case 1: return simplexizePol1(); case (int) INTERP_KERNEL::PLANAR_FACE_5: - return simplexizePlanarFace5(); + return simplexizePlanarFace5(); case (int) INTERP_KERNEL::PLANAR_FACE_6: - return simplexizePlanarFace6(); + return simplexizePlanarFace6(); default: throw INTERP_KERNEL::Exception("MEDCouplingUMesh::simplexize : unrecognized policy ! Must be :\n - 0 or 1 (only available for meshdim=2) \n - PLANAR_FACE_5, PLANAR_FACE_6 (only for meshdim=3)"); - } + } } /*! @@ -5471,7 +5468,7 @@ DataArrayInt *MEDCouplingUMesh::simplexizePol0() if((INTERP_KERNEL::NormalizedCellType)oldc[ci[0]]==INTERP_KERNEL::NORM_QUAD4) { const int tmp[8]={(int)INTERP_KERNEL::NORM_TRI3,oldc[ci[0]+1],oldc[ci[0]+2],oldc[ci[0]+3], - (int)INTERP_KERNEL::NORM_TRI3,oldc[ci[0]+1],oldc[ci[0]+3],oldc[ci[0]+4]}; + (int)INTERP_KERNEL::NORM_TRI3,oldc[ci[0]+1],oldc[ci[0]+3],oldc[ci[0]+4]}; pt=std::copy(tmp,tmp+8,pt); ptI[1]=ptI[0]+4; ptI[2]=ptI[0]+8; @@ -5524,7 +5521,7 @@ DataArrayInt *MEDCouplingUMesh::simplexizePol1() if((INTERP_KERNEL::NormalizedCellType)oldc[ci[0]]==INTERP_KERNEL::NORM_QUAD4) { const int tmp[8]={(int)INTERP_KERNEL::NORM_TRI3,oldc[ci[0]+1],oldc[ci[0]+2],oldc[ci[0]+4], - (int)INTERP_KERNEL::NORM_TRI3,oldc[ci[0]+2],oldc[ci[0]+3],oldc[ci[0]+4]}; + (int)INTERP_KERNEL::NORM_TRI3,oldc[ci[0]+2],oldc[ci[0]+3],oldc[ci[0]+4]}; pt=std::copy(tmp,tmp+8,pt); ptI[1]=ptI[0]+4; ptI[2]=ptI[0]+8; @@ -5934,15 +5931,15 @@ void MEDCouplingUMesh::orientCorrectlyPolyhedrons() if(type==INTERP_KERNEL::NORM_POLYHED) { try - { + { if(!IsPolyhedronWellOriented(conn+connI[i]+1,conn+connI[i+1],coordsPtr)) TryToCorrectPolyhedronOrientation(conn+connI[i]+1,conn+connI[i+1],coordsPtr); - } + } catch(INTERP_KERNEL::Exception& e) - { + { std::ostringstream oss; oss << "Something wrong in polyhedron #" << i << " : " << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); - } + } } } updateTime(); @@ -6017,7 +6014,7 @@ DataArrayInt *MEDCouplingUMesh::findAndCorrectBadOriented3DCells() { INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[connI[i]]; switch(type) - { + { case INTERP_KERNEL::NORM_TETRA4: { if(!IsTetra4WellOriented(conn+connI[i]+1,conn+connI[i+1],coordsPtr)) @@ -6058,7 +6055,7 @@ DataArrayInt *MEDCouplingUMesh::findAndCorrectBadOriented3DCells() } default: throw INTERP_KERNEL::Exception("MEDCouplingUMesh::orientCorrectly3DCells : Your mesh contains type of cell not supported yet ! send mail to anthony.geay@cea.fr to add it !"); - } + } } updateTime(); return ret.retn(); @@ -6129,28 +6126,28 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::getEdgeRatioField() const { INTERP_KERNEL::NormalizedCellType t=(INTERP_KERNEL::NormalizedCellType)*conn; switch(t) - { - case INTERP_KERNEL::NORM_TRI3: - { - FillInCompact3DMode(spaceDim,3,conn+1,coo,tmp); - *pt=INTERP_KERNEL::triEdgeRatio(tmp); - break; - } - case INTERP_KERNEL::NORM_QUAD4: - { - FillInCompact3DMode(spaceDim,4,conn+1,coo,tmp); - *pt=INTERP_KERNEL::quadEdgeRatio(tmp); - break; - } - case INTERP_KERNEL::NORM_TETRA4: - { - FillInCompact3DMode(spaceDim,4,conn+1,coo,tmp); - *pt=INTERP_KERNEL::tetraEdgeRatio(tmp); - break; - } + { + case INTERP_KERNEL::NORM_TRI3: + { + FillInCompact3DMode(spaceDim,3,conn+1,coo,tmp); + *pt=INTERP_KERNEL::triEdgeRatio(tmp); + break; + } + case INTERP_KERNEL::NORM_QUAD4: + { + FillInCompact3DMode(spaceDim,4,conn+1,coo,tmp); + *pt=INTERP_KERNEL::quadEdgeRatio(tmp); + break; + } + case INTERP_KERNEL::NORM_TETRA4: + { + FillInCompact3DMode(spaceDim,4,conn+1,coo,tmp); + *pt=INTERP_KERNEL::tetraEdgeRatio(tmp); + break; + } default: throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getEdgeRatioField : A cell with not manged type (NORM_TRI3, NORM_QUAD4 and NORM_TETRA4) has been detected !"); - } + } conn+=connI[i+1]-connI[i]; } ret->setName("EdgeRatio"); @@ -6201,28 +6198,28 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::getAspectRatioField() const { INTERP_KERNEL::NormalizedCellType t=(INTERP_KERNEL::NormalizedCellType)*conn; switch(t) - { - case INTERP_KERNEL::NORM_TRI3: - { - FillInCompact3DMode(spaceDim,3,conn+1,coo,tmp); - *pt=INTERP_KERNEL::triAspectRatio(tmp); - break; - } - case INTERP_KERNEL::NORM_QUAD4: - { - FillInCompact3DMode(spaceDim,4,conn+1,coo,tmp); - *pt=INTERP_KERNEL::quadAspectRatio(tmp); - break; - } - case INTERP_KERNEL::NORM_TETRA4: - { - FillInCompact3DMode(spaceDim,4,conn+1,coo,tmp); - *pt=INTERP_KERNEL::tetraAspectRatio(tmp); - break; - } + { + case INTERP_KERNEL::NORM_TRI3: + { + FillInCompact3DMode(spaceDim,3,conn+1,coo,tmp); + *pt=INTERP_KERNEL::triAspectRatio(tmp); + break; + } + case INTERP_KERNEL::NORM_QUAD4: + { + FillInCompact3DMode(spaceDim,4,conn+1,coo,tmp); + *pt=INTERP_KERNEL::quadAspectRatio(tmp); + break; + } + case INTERP_KERNEL::NORM_TETRA4: + { + FillInCompact3DMode(spaceDim,4,conn+1,coo,tmp); + *pt=INTERP_KERNEL::tetraAspectRatio(tmp); + break; + } default: throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getAspectRatioField : A cell with not manged type (NORM_TRI3, NORM_QUAD4 and NORM_TETRA4) has been detected !"); - } + } conn+=connI[i+1]-connI[i]; } ret->setName("AspectRatio"); @@ -6272,16 +6269,16 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::getWarpField() const { INTERP_KERNEL::NormalizedCellType t=(INTERP_KERNEL::NormalizedCellType)*conn; switch(t) - { - case INTERP_KERNEL::NORM_QUAD4: - { - FillInCompact3DMode(3,4,conn+1,coo,tmp); - *pt=INTERP_KERNEL::quadWarp(tmp); - break; - } + { + case INTERP_KERNEL::NORM_QUAD4: + { + FillInCompact3DMode(3,4,conn+1,coo,tmp); + *pt=INTERP_KERNEL::quadWarp(tmp); + break; + } default: throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getWarpField : A cell with not manged type (NORM_QUAD4) has been detected !"); - } + } conn+=connI[i+1]-connI[i]; } ret->setName("Warp"); @@ -6332,16 +6329,16 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::getSkewField() const { INTERP_KERNEL::NormalizedCellType t=(INTERP_KERNEL::NormalizedCellType)*conn; switch(t) - { - case INTERP_KERNEL::NORM_QUAD4: - { - FillInCompact3DMode(3,4,conn+1,coo,tmp); - *pt=INTERP_KERNEL::quadSkew(tmp); - break; - } + { + case INTERP_KERNEL::NORM_QUAD4: + { + FillInCompact3DMode(3,4,conn+1,coo,tmp); + *pt=INTERP_KERNEL::quadSkew(tmp); + break; + } default: throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getSkewField : A cell with not manged type (NORM_QUAD4) has been detected !"); - } + } conn+=connI[i+1]-connI[i]; } ret->setName("Skew"); @@ -7052,7 +7049,7 @@ std::vector MEDCouplingUMesh::splitByType() const MEDCoupling1GTUMesh *MEDCouplingUMesh::convertIntoSingleGeoTypeMesh() const { checkConnectivityFullyDefined(); - if(_types.size()!=1) + if(_types.size()!=1) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertIntoSingleGeoTypeMesh : current mesh does not contain exactly one geometric type !"); INTERP_KERNEL::NormalizedCellType typ=*_types.begin(); MEDCouplingAutoRefCountObjectPtr ret=MEDCoupling1GTUMesh::New(getName(),typ); @@ -7079,7 +7076,7 @@ MEDCoupling1GTUMesh *MEDCouplingUMesh::convertIntoSingleGeoTypeMesh() const DataArrayInt *MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh() const { checkConnectivityFullyDefined(); - if(_types.size()!=1) + if(_types.size()!=1) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh : current mesh does not contain exactly one geometric type !"); INTERP_KERNEL::NormalizedCellType typ=*_types.begin(); const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(typ); @@ -7160,7 +7157,7 @@ void MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh(DataArrayInt */ MEDCouplingUMesh *MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(const std::vector& ms, DataArrayInt *&szOfCellGrpOfSameType, - DataArrayInt *&idInMsOfCellGrpOfSameType) throw(INTERP_KERNEL::Exception) + DataArrayInt *&idInMsOfCellGrpOfSameType) { std::vector ms2; for(std::vector::const_iterator it=ms.begin();it!=ms.end();it++) @@ -7586,7 +7583,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshes(const MEDCouplingUMesh *mesh1, * \throw If the coordinates array is not set in none of the meshes. * \throw If \a a[ *i* ]->getMeshDimension() < 0. * \throw If the meshes in \a a are of different dimension (getMeshDimension()). -*/ + */ MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshes(std::vector& a) { std::size_t sz=a.size(); @@ -7932,7 +7929,7 @@ void MEDCouplingUMesh::AppendExtrudedCell(const int *connBg, const int *connEnd, ret.push_back(cm.getExtrudedType()); int deltaz=isQuad?2*nbOfNodesPerLev:nbOfNodesPerLev; switch(flatType) - { + { case INTERP_KERNEL::NORM_POINT1: { ret.push_back(connBg[1]); @@ -7966,7 +7963,7 @@ void MEDCouplingUMesh::AppendExtrudedCell(const int *connBg, const int *connEnd, case INTERP_KERNEL::NORM_TRI6: { int conn[15]={connBg[1],connBg[2],connBg[3],connBg[1]+deltaz,connBg[2]+deltaz,connBg[3]+deltaz,connBg[4],connBg[5],connBg[6],connBg[4]+deltaz,connBg[5]+deltaz,connBg[6]+deltaz, - connBg[1]+nbOfNodesPerLev,connBg[2]+nbOfNodesPerLev,connBg[3]+nbOfNodesPerLev}; + connBg[1]+nbOfNodesPerLev,connBg[2]+nbOfNodesPerLev,connBg[3]+nbOfNodesPerLev}; ret.insert(ret.end(),conn,conn+15); break; } @@ -7999,7 +7996,7 @@ void MEDCouplingUMesh::AppendExtrudedCell(const int *connBg, const int *connEnd, } default: throw INTERP_KERNEL::Exception("A flat type has been detected that has not its extruded representation !"); - } + } } /*! @@ -8658,7 +8655,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::Intersect2DMeshes(const MEDCouplingUMesh *m1 INTERP_KERNEL::QUADRATIC_PLANAR::_precision=eps; INTERP_KERNEL::QUADRATIC_PLANAR::_arc_detection_precision=eps; IntersectDescending2DMeshes(m1,m2,eps,intersectEdge1,colinear2, subDiv2, - m1Desc,desc1,descIndx1,revDesc1,revDescIndx1, + m1Desc,desc1,descIndx1,revDesc1,revDescIndx1, addCoo, m2Desc,desc2,descIndx2,revDesc2,revDescIndx2); revDesc1->decrRef(); revDescIndx1->decrRef(); revDesc2->decrRef(); revDescIndx2->decrRef(); MEDCouplingAutoRefCountObjectPtr dd1(desc1),dd2(descIndx1),dd3(desc2),dd4(descIndx2); @@ -8740,7 +8737,7 @@ void MEDCouplingUMesh::BuildIntersecting2DCellsFromEdges(double eps, const MEDCo MEDCouplingUMeshBuildQPFromMesh3(coo1,offset1,coo2,offset2,addCoords,desc1+descIndx1[i],desc1+descIndx1[i+1],intesctEdges1,/* output */mapp,mappRev); // pol1 is the full cell from mesh2, in QP format, with all the additional intersecting nodes. pol1.buildFromCrudeDataArray(mappRev,cm.isQuadratic(),conn1+connI1[i]+1,coo1, - desc1+descIndx1[i],desc1+descIndx1[i+1],intesctEdges1); + desc1+descIndx1[i],desc1+descIndx1[i+1],intesctEdges1); // std::set edges1;// store all edges of pol1 that are NOT consumed by intersect cells. If any after iteration over candidates2 -> a part of pol1 should appear in result std::set edgesBoundary2;// store all edges that are on boundary of (pol2 intersect pol1) minus edges on pol1. @@ -8759,7 +8756,7 @@ void MEDCouplingUMesh::BuildIntersecting2DCellsFromEdges(double eps, const MEDCo MEDCouplingUMeshBuildQPFromMesh3(coo1,offset1,coo2,offset2,addCoords,desc2+descIndx2[*it2],desc2+descIndx2[*it2+1],intesctEdges2,/* output */mapp,mappRev); // pol2 is the new QP in the final merged result. pol2s[ii].buildFromCrudeDataArray2(mappRev,cm2.isQuadratic(),conn2+connI2[*it2]+1,coo2,desc2+descIndx2[*it2],desc2+descIndx2[*it2+1],intesctEdges2, - pol1,desc1+descIndx1[i],desc1+descIndx1[i+1],intesctEdges1,colinear2, /* output */ edgesIn2ForShare); + pol1,desc1+descIndx1[i],desc1+descIndx1[i+1],intesctEdges1,colinear2, /* output */ edgesIn2ForShare); } ii=0; for(std::vector::const_iterator it2=candidates2.begin();it2!=candidates2.end();it2++,ii++) @@ -8774,14 +8771,14 @@ void MEDCouplingUMesh::BuildIntersecting2DCellsFromEdges(double eps, const MEDCo if(!edges1.empty()) { try - { + { INTERP_KERNEL::QuadraticPolygon::ComputeResidual(pol1,edges1,edgesBoundary2,mapp,offset3,i,addCoordsQuadratic,cr,crI,cNb1,cNb2); - } + } catch(INTERP_KERNEL::Exception& e) - { + { std::ostringstream oss; oss << "Error when computing residual of cell #" << i << " in source/m1 mesh ! Maybe the neighbours of this cell in mesh are not well connected !\n" << "The deep reason is the following : " << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); - } + } } for(std::map::const_iterator it=mappRev.begin();it!=mappRev.end();it++) (*it).second->decrRef(); @@ -8898,7 +8895,7 @@ DataArrayInt *MEDCouplingUMesh::conformize2D(double eps) { std::map m; INTERP_KERNEL::Edge *e1(MEDCouplingUMeshBuildQPFromEdge2((INTERP_KERNEL::NormalizedCellType)c[ci[i]],c+ci[i]+1,coords,m)), - *e2(MEDCouplingUMeshBuildQPFromEdge2((INTERP_KERNEL::NormalizedCellType)c[ci[*it]],c+ci[*it]+1,coords,m)); + *e2(MEDCouplingUMeshBuildQPFromEdge2((INTERP_KERNEL::NormalizedCellType)c[ci[*it]],c+ci[*it]+1,coords,m)); INTERP_KERNEL::MergePoints merge; INTERP_KERNEL::QuadraticPolygon c1,c2; e1->intersectWith(e2,merge,c1,c2); @@ -9059,7 +9056,6 @@ void MEDCouplingUMesh::IntersectDescending2DMeshes(const MEDCouplingUMesh *m1, c MEDCouplingUMesh *& m1Desc, DataArrayInt *&desc1, DataArrayInt *&descIndx1, DataArrayInt *&revDesc1, DataArrayInt *&revDescIndx1, std::vector& addCoo, MEDCouplingUMesh *& m2Desc, DataArrayInt *&desc2, DataArrayInt *&descIndx2, DataArrayInt *&revDesc2, DataArrayInt *&revDescIndx2) - throw(INTERP_KERNEL::Exception) { static const int SPACEDIM=2; // Build desc connectivity @@ -9137,8 +9133,8 @@ void MEDCouplingUMesh::IntersectDescending2DMeshes(const MEDCouplingUMesh *m1, c * \param[out] intersectEdge the same content as subDiv, but correclty oriented. */ void MEDCouplingUMesh::BuildIntersectEdges(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, - const std::vector& addCoo, - const std::vector< std::vector >& subDiv, std::vector< std::vector >& intersectEdge) + const std::vector& addCoo, + const std::vector< std::vector >& subDiv, std::vector< std::vector >& intersectEdge) { int offset1=m1->getNumberOfNodes(); int ncell=m2->getNumberOfCells(); @@ -9203,7 +9199,7 @@ void MEDCouplingUMesh::BuildIntersectEdges(const MEDCouplingUMesh *m1, const MED void MEDCouplingUMesh::AssemblyForSplitFrom3DCurve(const std::vector& cut3DCurve, std::vector& nodesOnPlane, const int *nodal3DSurf, const int *nodalIndx3DSurf, const int *nodal3DCurve, const int *nodalIndx3DCurve, const int *desc, const int *descIndx, - std::vector< std::pair >& cut3DSurf) throw(INTERP_KERNEL::Exception) + std::vector< std::pair >& cut3DSurf) { std::set nodesOnP(nodesOnPlane.begin(),nodesOnPlane.end()); int nbOf3DSurfCell=(int)cut3DSurf.size(); @@ -9228,7 +9224,7 @@ void MEDCouplingUMesh::AssemblyForSplitFrom3DCurve(const std::vector& cut3D } } switch(res.size()) - { + { case 2: { cut3DSurf[i].first=res[0]; cut3DSurf[i].second=res[1]; @@ -9258,7 +9254,7 @@ void MEDCouplingUMesh::AssemblyForSplitFrom3DCurve(const std::vector& cut3D else throw INTERP_KERNEL::Exception("MEDCouplingUMesh::AssemblyPointsFrom3DCurve : unexpected situation !"); } - } + } } } @@ -9273,7 +9269,7 @@ void MEDCouplingUMesh::AssemblyForSplitFrom3DCurve(const std::vector& cut3D */ void MEDCouplingUMesh::assemblyForSplitFrom3DSurf(const std::vector< std::pair >& cut3DSurf, const int *desc, const int *descIndx, - DataArrayInt *nodalRes, DataArrayInt *nodalResIndx, DataArrayInt *cellIds) const throw(INTERP_KERNEL::Exception) + DataArrayInt *nodalRes, DataArrayInt *nodalResIndx, DataArrayInt *cellIds) const { checkFullyDefined(); if(getMeshDimension()!=3 || getSpaceDimension()!=3) @@ -9502,7 +9498,7 @@ bool MEDCouplingUMesh::RemoveIdsFromIndexedArrays(const int *idsToRemoveBg, cons * \sa MEDCouplingUMesh::ExtractFromIndexedArrays2 */ void MEDCouplingUMesh::ExtractFromIndexedArrays(const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, - DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut) throw(INTERP_KERNEL::Exception) + DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut) { if(!arrIn || !arrIndxIn) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : input pointer is NULL !"); @@ -9574,7 +9570,7 @@ void MEDCouplingUMesh::ExtractFromIndexedArrays(const int *idsOfSelectBg, const * \sa MEDCouplingUMesh::ExtractFromIndexedArrays */ void MEDCouplingUMesh::ExtractFromIndexedArrays2(int idsOfSelectStart, int idsOfSelectStop, int idsOfSelectStep, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, - DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut) throw(INTERP_KERNEL::Exception) + DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut) { if(!arrIn || !arrIndxIn) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays2 : input pointer is NULL !"); @@ -9650,7 +9646,7 @@ void MEDCouplingUMesh::ExtractFromIndexedArrays2(int idsOfSelectStart, int idsOf */ void MEDCouplingUMesh::SetPartOfIndexedArrays(const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex, - DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut) throw(INTERP_KERNEL::Exception) + DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut) { if(arrIn==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : presence of null pointer in input parameter !"); @@ -9713,7 +9709,7 @@ void MEDCouplingUMesh::SetPartOfIndexedArrays(const int *idsOfSelectBg, const in * \sa MEDCouplingUMesh::SetPartOfIndexedArrays */ void MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(const int *idsOfSelectBg, const int *idsOfSelectEnd, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn, - const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception) + const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) { if(arrInOut==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : presence of null pointer in input parameter !"); @@ -9855,7 +9851,7 @@ DataArrayInt *MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeedAlg(std::vecto */ void MEDCouplingUMesh::SetPartOfIndexedArrays2(int start, int end, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex, - DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut) throw(INTERP_KERNEL::Exception) + DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut) { if(arrIn==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays2 : presence of null pointer in input parameter !"); @@ -9917,7 +9913,7 @@ void MEDCouplingUMesh::SetPartOfIndexedArrays2(int start, int end, int step, con * \sa MEDCouplingUMesh::SetPartOfIndexedArrays2 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx */ void MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx2(int start, int end, int step, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn, - const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception) + const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) { if(arrInOut==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx2 : presence of null pointer in input parameter !"); @@ -9976,7 +9972,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildSpreadZonesWithPoly() const MEDCouplingAutoRefCountObjectPtr tmp=static_cast(buildPartOfMySelf((*it)->begin(),(*it)->end(),true)); MEDCouplingAutoRefCountObjectPtr cell; switch(mdim) - { + { case 2: cell=tmp->buildUnionOf2DMesh(); break; @@ -9985,8 +9981,8 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildSpreadZonesWithPoly() const break; default: throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSpreadZonesWithPoly : meshdimension supported are [2,3] ! Not implemented yet for others !"); - } - + } + ret->insertNextCell((INTERP_KERNEL::NormalizedCellType)cell->getIJSafe(0,0),cell->getNumberOfTuples()-1,cell->getConstPointer()+1); } // @@ -10368,7 +10364,7 @@ int MEDCouplingUMesh::split2DCellsQuadratic(const DataArrayInt *desc, const Data } MEDCouplingUMeshCellIterator::MEDCouplingUMeshCellIterator(MEDCouplingUMesh *mesh):_mesh(mesh),_cell(new MEDCouplingUMeshCell(mesh)), - _own_cell(true),_cell_id(-1),_nb_cell(0) + _own_cell(true),_cell_id(-1),_nb_cell(0) { if(mesh) { @@ -10386,8 +10382,8 @@ MEDCouplingUMeshCellIterator::~MEDCouplingUMeshCellIterator() } MEDCouplingUMeshCellIterator::MEDCouplingUMeshCellIterator(MEDCouplingUMesh *mesh, MEDCouplingUMeshCell *itc, int bg, int end):_mesh(mesh),_cell(itc), - _own_cell(false),_cell_id(bg-1), - _nb_cell(end) + _own_cell(false),_cell_id(bg-1), + _nb_cell(end) { if(mesh) mesh->incrRef(); @@ -10423,8 +10419,8 @@ MEDCouplingUMeshCellByTypeEntry::~MEDCouplingUMeshCellByTypeEntry() } MEDCouplingUMeshCellEntry::MEDCouplingUMeshCellEntry(MEDCouplingUMesh *mesh, INTERP_KERNEL::NormalizedCellType type, MEDCouplingUMeshCell *itc, int bg, int end):_mesh(mesh),_type(type), - _itc(itc), - _bg(bg),_end(end) + _itc(itc), + _bg(bg),_end(end) { if(_mesh) _mesh->incrRef(); diff --git a/src/MEDCoupling/MEDCouplingUMesh.hxx b/src/MEDCoupling/MEDCouplingUMesh.hxx index 62c337bbc..e45707c60 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.hxx +++ b/src/MEDCoupling/MEDCouplingUMesh.hxx @@ -122,7 +122,7 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const; MEDCOUPLING_EXPORT void computeNeighborsOfCells(DataArrayInt *&neighbors, DataArrayInt *&neighborsIdx) const; MEDCOUPLING_EXPORT static void ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI, - DataArrayInt *&neighbors, DataArrayInt *&neighborsIdx) throw(INTERP_KERNEL::Exception); + DataArrayInt *&neighbors, DataArrayInt *&neighborsIdx); MEDCOUPLING_EXPORT MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const; MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelf(const int *begin, const int *end, bool keepCoords=true) const; MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step, bool keepCoords=true) const; @@ -136,7 +136,7 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords, DataArrayInt *&cellIdsRk0, DataArrayInt *&cellIdsRk1) const; MEDCOUPLING_EXPORT MEDCouplingUMesh *computeSkin() const; MEDCOUPLING_EXPORT void findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords, DataArrayInt *& nodeIdsToDuplicate, - DataArrayInt *& cellIdsNeededToBeRenum, DataArrayInt *& cellIdsNotModified) const throw(INTERP_KERNEL::Exception); + DataArrayInt *& cellIdsNeededToBeRenum, DataArrayInt *& cellIdsNotModified) const; MEDCOUPLING_EXPORT void duplicateNodes(const int *nodeIdsToDuplicateBg, const int *nodeIdsToDuplicateEnd); MEDCOUPLING_EXPORT void renumberNodesInConn(const int *newNodeNumbersO2N); MEDCOUPLING_EXPORT void shiftNodeNumbersInConn(int delta); @@ -208,7 +208,7 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void convertNodalConnectivityToDynamicGeoTypeMesh(DataArrayInt *&nodalConn, DataArrayInt *&nodalConnIndex) const; MEDCOUPLING_EXPORT static MEDCouplingUMesh *AggregateSortedByTypeMeshesOnSameCoords(const std::vector& ms, DataArrayInt *&szOfCellGrpOfSameType, - DataArrayInt *&idInMsOfCellGrpOfSameType) throw(INTERP_KERNEL::Exception); + DataArrayInt *&idInMsOfCellGrpOfSameType); MEDCOUPLING_EXPORT DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, const int *begin, const int *end) const; MEDCOUPLING_EXPORT DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const; MEDCOUPLING_EXPORT MEDCouplingUMesh *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, const int *idsPerGeoTypeBg, const int *idsPerGeoTypeEnd) const; @@ -243,23 +243,23 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT static bool BuildConvexEnvelopOf2DCellJarvis(const double *coords, const int *nodalConnBg, const int *nodalConnEnd, DataArrayInt *nodalConnecOut); MEDCOUPLING_EXPORT static bool RemoveIdsFromIndexedArrays(const int *idsToRemoveBg, const int *idsToRemoveEnd, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0); MEDCOUPLING_EXPORT static void ExtractFromIndexedArrays(const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, - DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut) throw(INTERP_KERNEL::Exception); + DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut); MEDCOUPLING_EXPORT static void ExtractFromIndexedArrays2(int idsOfSelectStart, int idsOfSelectStop, int idsOfSelectStep, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, - DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut) throw(INTERP_KERNEL::Exception); + DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut); MEDCOUPLING_EXPORT static void SetPartOfIndexedArrays(const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex, - DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut) throw(INTERP_KERNEL::Exception); + DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut); MEDCOUPLING_EXPORT static void SetPartOfIndexedArraysSameIdx(const int *idsOfSelectBg, const int *idsOfSelectEnd, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn, - const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception); + const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex); MEDCOUPLING_EXPORT static void SetPartOfIndexedArrays2(int start, int end, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex, - DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut) throw(INTERP_KERNEL::Exception); + DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut); MEDCOUPLING_EXPORT static void SetPartOfIndexedArraysSameIdx2(int start, int end, int step, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn, - const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception); + const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex); MEDCOUPLING_EXPORT static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn); MEDCOUPLING_EXPORT static DataArrayInt *ComputeSpreadZoneGraduallyFromSeed(const int *seedBg, const int *seedEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling, int& nbOfDepthPeelingPerformed); MEDCOUPLING_EXPORT static void FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI, - DataArrayInt *& commonCellsArr, DataArrayInt *& commonCellsIArr) throw(INTERP_KERNEL::Exception); + DataArrayInt *& commonCellsArr, DataArrayInt *& commonCellsIArr); MEDCOUPLING_EXPORT DataArrayInt *buildUnionOf2DMesh() const; MEDCOUPLING_EXPORT DataArrayInt *buildUnionOf3DMesh() const; private: @@ -310,8 +310,7 @@ namespace ParaMEDMEM std::vector< std::vector >& intersectEdge1, std::vector< std::vector >& colinear2, std::vector< std::vector >& subDiv2, MEDCouplingUMesh *& m1Desc, DataArrayInt *&desc1, DataArrayInt *&descIndx1, DataArrayInt *&revDesc1, DataArrayInt *&revDescIndx1, std::vector& addCoo, - MEDCouplingUMesh *& m2Desc, DataArrayInt *&desc2, DataArrayInt *&descIndx2, DataArrayInt *&revDesc2, DataArrayInt *&revDescIndx2) - throw(INTERP_KERNEL::Exception); + MEDCouplingUMesh *& m2Desc, DataArrayInt *&desc2, DataArrayInt *&descIndx2, DataArrayInt *&revDesc2, DataArrayInt *&revDescIndx2); static void BuildIntersectEdges(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, const std::vector& addCoo, const std::vector< std::vector >& subDiv, std::vector< std::vector >& intersectEdge); static void BuildIntersecting2DCellsFromEdges(double eps, const MEDCouplingUMesh *m1, const int *desc1, const int *descIndx1, const std::vector >& intesctEdges1, const std::vector< std::vector >& colinear2, const MEDCouplingUMesh *m2, const int *desc2, const int *descIndx2, const std::vector >& intesctEdges2, @@ -319,9 +318,9 @@ namespace ParaMEDMEM std::vector& addCoordsQuadratic, std::vector& cr, std::vector& crI, std::vector& cNb1, std::vector& cNb2); static void AssemblyForSplitFrom3DCurve(const std::vector& cut3DCurve, std::vector& nodesOnPlane, const int *nodal3DSurf, const int *nodalIndx3DSurf, const int *nodal3DCurve, const int *nodalIndx3DCurve, - const int *desc, const int *descIndx, std::vector< std::pair >& cut3DSurf) throw(INTERP_KERNEL::Exception); + const int *desc, const int *descIndx, std::vector< std::pair >& cut3DSurf); void assemblyForSplitFrom3DSurf(const std::vector< std::pair >& cut3DSurf, - const int *desc, const int *descIndx, DataArrayInt *nodalRes, DataArrayInt *nodalResIndx, DataArrayInt *cellIds) const throw(INTERP_KERNEL::Exception); + const int *desc, const int *descIndx, DataArrayInt *nodalRes, DataArrayInt *nodalResIndx, DataArrayInt *cellIds) const; void split2DCellsLinear(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *subNodesInSeg, const DataArrayInt *subNodesInSegI); int split2DCellsQuadratic(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *subNodesInSeg, const DataArrayInt *subNodesInSegI, const DataArrayInt *mid, const DataArrayInt *midI); static bool Colinearize2DCell(const double *coords, const int *connBg, const int *connEnd, int offset, DataArrayInt *newConnOfCell, DataArrayDouble *appendedCoords); -- 2.39.2