X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FDriverCGNS%2FDriverCGNS_Write.cxx;h=517a56f25afe361d8d45c93e042b7fd11926fcdc;hb=d4a710ce52f6e76786a7b3845e2f7975dc9a00b1;hp=0c9a20970a6e1a9581c0571be42339a793c4ed07;hpb=75bac8d6f5e2acd561b16b295e68cb07f7040cb9;p=modules%2Fsmesh.git diff --git a/src/DriverCGNS/DriverCGNS_Write.cxx b/src/DriverCGNS/DriverCGNS_Write.cxx index 0c9a20970..517a56f25 100644 --- a/src/DriverCGNS/DriverCGNS_Write.cxx +++ b/src/DriverCGNS/DriverCGNS_Write.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -92,6 +92,11 @@ namespace interlaces[SMDSEntity_Quad_Quadrangle] = ids; cgTypes [SMDSEntity_Quad_Quadrangle] = CGNS_ENUMV( QUAD_8 ); } + { + static int ids[] = { 0,3,2,1,7,6,5,4,8 }; + interlaces[SMDSEntity_BiQuad_Quadrangle] = ids; + cgTypes [SMDSEntity_BiQuad_Quadrangle] = CGNS_ENUMV( QUAD_9 ); + } { static int ids[] = { 0, 2, 1, 3 }; interlaces[SMDSEntity_Tetra] = ids; @@ -133,8 +138,15 @@ namespace cgTypes [SMDSEntity_Quad_Hexa] = CGNS_ENUMV( HEXA_20 ); } { - cgTypes[SMDSEntity_Polygon] = CGNS_ENUMV( NGON_n ); - cgTypes[SMDSEntity_Polyhedra] = CGNS_ENUMV( NFACE_n ); + static int ids[] = { 0,3,2,1,4,7,6,5,11,10,9,8,12,15,14,13,19,18,17,16, + 20, 24,23,22,21, 25}; + interlaces[SMDSEntity_TriQuad_Hexa] = ids; + cgTypes [SMDSEntity_TriQuad_Hexa] = CGNS_ENUMV( HEXA_27 ); + } + { + cgTypes[SMDSEntity_Polygon] = CGNS_ENUMV( NGON_n ); + cgTypes[SMDSEntity_Polyhedra] = CGNS_ENUMV( NFACE_n ); + cgTypes[SMDSEntity_Hexagonal_Prism] = CGNS_ENUMV( NFACE_n ); } } cgType = cgTypes[ smType ]; @@ -353,7 +365,8 @@ Driver_Mesh::Status DriverCGNS_Write::Perform() } while ( elem && elem->GetEntityType() == elemType ); - else if ( elemType == SMDSEntity_Polyhedra ) // POLYHEDRA + else if ( elemType == SMDSEntity_Polyhedra || + elemType == SMDSEntity_Hexagonal_Prism) // POLYHEDRA { // to save polyhedrons after all const SMDS_MeshInfo& meshInfo = myMesh->GetMeshInfo(); @@ -374,7 +387,7 @@ Driver_Mesh::Status DriverCGNS_Write::Perform() // Write polyhedral volumes // ------------------------- - if ( myMesh->GetMeshInfo().NbPolyhedrons() > 0 ) + if ( myMesh->GetMeshInfo().NbElements() > cgID-1 ) // polyhedra or hexagonal prisms remain { // the polyhedron (NFACE_n) is described as a set of signed face IDs, // so first we are to write all polygones (NGON_n) bounding polyhedrons @@ -398,7 +411,9 @@ Driver_Mesh::Status DriverCGNS_Write::Perform() while ( elemIt->more() ) { elem = elemIt->next(); - if ( elem->GetEntityType() == SMDSEntity_Polyhedra ) + SMDSAbs_EntityType type = elem->GetEntityType(); + if ( type == SMDSEntity_Polyhedra || + type == SMDSEntity_Hexagonal_Prism ) { ++nbPolyhTreated; vol.Set( elem );