From: ageay Date: Tue, 6 Aug 2013 10:25:49 +0000 (+0000) Subject: Improve perf of P1P0,P0P1,P1P1 -> DualMesh X-Git-Tag: V7_3_1b1~225 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=62344746ee578d0bb861dd0849305e2d73d7f8f7;p=tools%2Fmedcoupling.git Improve perf of P1P0,P0P1,P1P1 -> DualMesh --- diff --git a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx index 9b9a2104d..e82f6ccae 100644 --- a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx +++ b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx @@ -1527,13 +1527,13 @@ MEDCoupling1DGTUMesh *MEDCoupling1SGTUMesh::computeDualMesh3D() const throw(INTE /*static const int DUAL_CONN_TETRA_0[48]={ 8,5,14,4, 10,4,14,7, 11,7,14,5, 8,4,14,5, 9,6,14,4, 12,5,14,6, - 10,7,14,4, 9,4,14,6, 13,7,14,6, + 10,7,14,4, 9,4,14,6, 13,6,14,7, 11,5,14,7, 13,7,14,6, 12,6,14,5 };*/ static const int DUAL_TETRA_0[36]={ 4,1,0, 6,0,3, 7,3,1, 4,0,1, 5,2,0, 8,1,2, - 6,3,0, 5,0,2, 9,3,2, + 6,3,0, 5,0,2, 9,2,3, 7,1,3, 9,3,2, 8,2,1 }; static const int DUAL_TETRA_1[36]={ @@ -1563,7 +1563,7 @@ MEDCoupling1DGTUMesh *MEDCoupling1SGTUMesh::computeDualMesh3D() const throw(INTE MEDCouplingAutoRefCountObjectPtr zeArr(DataArrayDouble::Aggregate(v)); baryArr=0; edgesBaryArr=0; facesBaryArr=0; 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); + MEDCouplingAutoRefCountObjectPtr cArr(DataArrayInt::New()),ciArr(DataArrayInt::New()); ciArr->alloc(nbOfNodes+1,1); ciArr->setIJ(0,0,0); cArr->alloc(0,1); for(int i=0;ipushBackSilent(cArr->getNumberOfTuples()); + ciArr->setIJ(i+1,0,cArr->getNumberOfTuples()); } ret->setNodalConnectivity(cArr,ciArr); return ret.retn(); @@ -1634,7 +1634,7 @@ MEDCoupling1DGTUMesh *MEDCoupling1SGTUMesh::computeDualMesh2D() const throw(INTE MEDCouplingAutoRefCountObjectPtr zeArr(DataArrayDouble::Aggregate(v)); baryArr=0; edgesBaryArr=0; 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); + MEDCouplingAutoRefCountObjectPtr cArr(DataArrayInt::New()),ciArr(DataArrayInt::New()); ciArr->alloc(nbOfNodes+1,1); ciArr->setIJ(0,0,0); cArr->alloc(0,1); for(int i=0;i zePolyg(MEDCoupling1DGTUMesh::BuildAPolygonFromParts(polyg)); cArr->insertAtTheEnd(zePolyg.begin(),zePolyg.end()); - ciArr->pushBackSilent(cArr->getNumberOfTuples()); + ciArr->setIJ(i+1,0,cArr->getNumberOfTuples()); } ret->setNodalConnectivity(cArr,ciArr); return ret.retn(); @@ -2493,7 +2493,7 @@ DataArrayInt *MEDCoupling1DGTUMesh::getNodeIdsInUse(int& nbrOfNodesInUse) const int nodeId=conn[conni[0]+j]; if(nodeId==-1) continue; if(nodeId>=0 && nodeId