+// 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)
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 )
{
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] );
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++;
}
}
} // 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],