From: eap Date: Wed, 17 Dec 2008 13:33:14 +0000 (+0000) Subject: MEDMEM Industrialization 2008 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5bb18e8c1814ea9cf50cafcf621295270db65e52;p=tools%2Fmedcoupling.git MEDMEM Industrialization 2008 --- diff --git a/src/INTERP_KERNEL/DualMESH.cxx b/src/INTERP_KERNEL/DualMESH.cxx index 87d52f574..6671d0d71 100644 --- a/src/INTERP_KERNEL/DualMESH.cxx +++ b/src/INTERP_KERNEL/DualMESH.cxx @@ -1,3 +1,21 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File : DualMESH.cxx // Created : Thu Oct 30 11:35:33 2008 // Author : Edward AGAPOV (eap) @@ -215,11 +233,10 @@ DualMESH::DualMESH( MESH & mesh ):MESH() else // here geom == MED_TETRA4 { - list < int > dualConn, faceIndex; + list < int > dualConn; vector< int > dualIndex; dualIndex.reserve( nbDualCells + 1 ); dualIndex.push_back( 1 ); - faceIndex.push_back( 1 ); for ( iNode = 1; iNode <= nbDualCells; ++iNode ) { @@ -276,13 +293,11 @@ DualMESH::DualMESH( MESH & mesh ):MESH() dualConn.push_back( middle[i] ); dualConn.push_back( tetBary ); dualConn.push_back( triaBary[i] ); - faceIndex.push_back( faceIndex.back() + 3 ); nbFaces++; dualConn.push_back( middle[i+1] ); dualConn.push_back( triaBary[i] ); dualConn.push_back( tetBary ); - faceIndex.push_back( faceIndex.back() + 3 ); nbFaces++; TLink link ( middle[i], middle[i+1], triaBary[i] ); @@ -310,9 +325,11 @@ DualMESH::DualMESH( MESH & mesh ):MESH() dualConn.push_back( middle1 ); dualConn.push_back( triBary ); dualConn.push_back( middle2 ); - dualConn.push_back( nextBnd ); + nbFaces++; - faceIndex.push_back( faceIndex.back() + 4 ); + dualConn.push_back( middle2 ); + dualConn.push_back( nextBnd ); + dualConn.push_back( middle1 ); nbFaces++; } } @@ -321,7 +338,10 @@ DualMESH::DualMESH( MESH & mesh ):MESH() } // loop on input nodes vector< int > polyConnectivity( dualConn.begin(), dualConn.end() ); - vector< int > polyFaceIndex( faceIndex.begin(), faceIndex.end() ); + vector< int > polyFaceIndex( dualIndex.back() ); + polyFaceIndex[0] = 1; + for ( int iFace = 1; iFace < polyFaceIndex.size(); ++iFace ) + polyFaceIndex[ iFace ] = polyFaceIndex[ iFace-1 ] + 3; _connectivity->setPolyhedronConnectivity(MED_NODAL, & polyConnectivity[0], & dualIndex[0],