From: ageay Date: Tue, 6 Aug 2013 09:48:40 +0000 (+0000) Subject: Improve perf of P1P0,P0P1,P1P1 -> DualMesh X-Git-Tag: V7_3_1b1~226 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=604f0e16552947d7464a9ab6b5692d570064ad6f;p=tools%2Fmedcoupling.git Improve perf of P1P0,P0P1,P1P1 -> DualMesh --- diff --git a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx index 781072716..9b9a2104d 100644 --- a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx +++ b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx @@ -1557,10 +1557,10 @@ MEDCoupling1DGTUMesh *MEDCoupling1SGTUMesh::computeDualMesh3D() const throw(INTE MEDCouplingAutoRefCountObjectPtr faces(thisu->buildDescendingConnectivity(d2Arr,di2Arr,rd2Arr,rdi2Arr)); thisu=0; const int *d2(d2Arr->begin()),*rd2(rd2Arr->begin()),*rdi2(rdi2Arr->begin()); MEDCouplingAutoRefCountObjectPtr edgesBaryArr(edges->getBarycenterAndOwner()),facesBaryArr(faces->getBarycenterAndOwner()),baryArr(getBarycenterAndOwner()); + const int nbOfNodes(getNumberOfNodes()),offset0(nbOfNodes+faces->getNumberOfCells()),offset1(offset0+edges->getNumberOfCells()); edges=0; faces=0; std::vector v(4); v[0]=getCoords(); v[1]=facesBaryArr; v[2]=edgesBaryArr; v[3]=baryArr; MEDCouplingAutoRefCountObjectPtr zeArr(DataArrayDouble::Aggregate(v)); baryArr=0; edgesBaryArr=0; facesBaryArr=0; - const int nbOfNodes(getNumberOfNodes()),offset0(nbOfNodes+faces->getNumberOfCells()),offset1(offset0+edges->getNumberOfCells()); std::string name("DualOf_"); name+=getName(); MEDCouplingAutoRefCountObjectPtr ret(MEDCoupling1DGTUMesh::New(name.c_str(),INTERP_KERNEL::NORM_POLYHED)); ret->setCoords(zeArr); MEDCouplingAutoRefCountObjectPtr cArr(DataArrayInt::New()),ciArr(DataArrayInt::New()); ciArr->alloc(nbOfNodes+1,0); ciArr->setIJ(0,0,0); cArr->alloc(0,1); @@ -1628,10 +1628,10 @@ MEDCoupling1DGTUMesh *MEDCoupling1SGTUMesh::computeDualMesh2D() const throw(INTE MEDCouplingAutoRefCountObjectPtr edges(thisu->buildDescendingConnectivity(d2Arr,di2Arr,rd2Arr,rdi2Arr)); thisu=0; const int *d2(d2Arr->begin()),*rd2(rd2Arr->begin()),*rdi2(rdi2Arr->begin()); MEDCouplingAutoRefCountObjectPtr edgesBaryArr(edges->getBarycenterAndOwner()),baryArr(getBarycenterAndOwner()); + const int nbOfNodes(getNumberOfNodes()),offset0(nbOfNodes+edges->getNumberOfCells()); edges=0; std::vector v(3); v[0]=getCoords(); v[1]=edgesBaryArr; v[2]=baryArr; MEDCouplingAutoRefCountObjectPtr zeArr(DataArrayDouble::Aggregate(v)); baryArr=0; edgesBaryArr=0; - const int nbOfNodes(getNumberOfNodes()),offset0(nbOfNodes+edges->getNumberOfCells()); std::string name("DualOf_"); name+=getName(); MEDCouplingAutoRefCountObjectPtr ret(MEDCoupling1DGTUMesh::New(name.c_str(),INTERP_KERNEL::NORM_POLYGON)); ret->setCoords(zeArr); MEDCouplingAutoRefCountObjectPtr cArr(DataArrayInt::New()),ciArr(DataArrayInt::New()); ciArr->alloc(nbOfNodes+1,0); ciArr->setIJ(0,0,0); cArr->alloc(0,1); diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index 5d690ea3f..d594c82ab 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -9322,7 +9322,7 @@ MEDCoupling1SGTUMesh *MEDCouplingUMesh::tetrahedrize(int policy, DataArrayInt *& const int *oldc(_nodal_connec->begin()); const int *oldci(_nodal_connec_index->begin()); const double *coords(_coords->begin()); - for(int i=0;i a; std::vector b; INTERP_KERNEL::SplitIntoTetras(pol,(INTERP_KERNEL::NormalizedCellType)oldc[oldci[0]],oldc+oldci[0]+1,oldc+oldci[1],coords,a,b);