From: ageay Date: Tue, 6 Aug 2013 13:17:07 +0000 (+0000) Subject: Improve perf of P1P0,P0P1,P1P1 -> DualMesh X-Git-Tag: V7_3_1b1~224 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=107e9abeda5d5905d214af1f29591a3985501fb1;p=tools%2Fmedcoupling.git Improve perf of P1P0,P0P1,P1P1 -> DualMesh --- diff --git a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx index e82f6ccae..d80bf9374 100644 --- a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx +++ b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx @@ -1524,12 +1524,6 @@ MEDCoupling1GTUMesh *MEDCoupling1SGTUMesh::computeDualMesh() const throw(INTERP_ MEDCoupling1DGTUMesh *MEDCoupling1SGTUMesh::computeDualMesh3D() const throw(INTERP_KERNEL::Exception) { - /*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,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, @@ -1577,6 +1571,7 @@ MEDCoupling1DGTUMesh *MEDCoupling1SGTUMesh::computeDualMesh3D() const throw(INTE int curCellId(revNod[revNodI[0]+j]); const int *connOfCurCell(nodal+4*curCellId); std::size_t nodePosInCurCell(std::distance(connOfCurCell,std::find(connOfCurCell,connOfCurCell+4,i))); + if(j!=0) cArr->pushBackSilent(-1); int tmp[14]; // tmp[0]=d1[6*curCellId+DUAL_TETRA_0[nodePosInCurCell*9+0]-4]+offset0; tmp[1]=d2[4*curCellId+DUAL_TETRA_0[nodePosInCurCell*9+1]]+nbOfNodes; @@ -1591,7 +1586,7 @@ MEDCoupling1DGTUMesh *MEDCoupling1SGTUMesh::computeDualMesh3D() const throw(INTE int kk(0); for(int k=0;k<4;k++) { - if(FACEID_NOT_SH_NODE[k]!=(int)nodePosInCurCell) + if(FACEID_NOT_SH_NODE[nodePosInCurCell]!=k) { const int *faceId(d2+4*curCellId+k); if(rdi2[*faceId+1]-rdi2[*faceId]==1) @@ -1614,8 +1609,8 @@ MEDCoupling1DGTUMesh *MEDCoupling1SGTUMesh::computeDualMesh3D() const throw(INTE MEDCoupling1DGTUMesh *MEDCoupling1SGTUMesh::computeDualMesh2D() const throw(INTERP_KERNEL::Exception) { - static const int DUAL_TRI_0[6]={2,0, 0,1, 1,2}; - static const int DUAL_TRI_1[6]={+3,-5, -3,+4, -4,+5}; + static const int DUAL_TRI_0[6]={0,2, 1,0, 2,1}; + static const int DUAL_TRI_1[6]={-3,+5, +3,-4, +4,-5}; static const int FACEID_NOT_SH_NODE[3]={1,2,0}; if(getCellModelEnum()!=INTERP_KERNEL::NORM_TRI3) throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::computeDualMesh2D : only TRI3 supported !"); @@ -1655,7 +1650,7 @@ MEDCoupling1DGTUMesh *MEDCoupling1SGTUMesh::computeDualMesh2D() const throw(INTE int kk(0); for(int k=0;k<3;k++) { - if(FACEID_NOT_SH_NODE[k]!=(int)nodePosInCurCell) + if(FACEID_NOT_SH_NODE[nodePosInCurCell]!=k) { const int *edgeId(d2+3*curCellId+k); if(rdi2[*edgeId+1]-rdi2[*edgeId]==1)