// --------------------------------------------------------------------------------
DriverGMF_Read::DriverGMF_Read():
Driver_SMESHDS_Mesh(),
- _makeRequiredGroups( true )
+ _makeRequiredGroups( true ),
+ _makeFaultGroups( true )
{
}
// --------------------------------------------------------------------------------
}
}
- // Read required entities into groups
+ // Read some entities into groups
+ // see MeshGems/Docs/meshgems_formats_description.pdf
- if ( _makeRequiredGroups )
- {
// get ids of existing groups
std::set< int > groupIDs;
const std::set<SMESHDS_GroupBase*>& groups = myMesh->GetGroups();
groupIDs.insert( (*grIter)->GetID() );
if ( groupIDs.empty() ) groupIDs.insert( 0 );
+ // Read required entities into groups
+ if ( _makeRequiredGroups )
+ {
+
const int kes[4][3] = { { GmfRequiredVertices, SMDSAbs_Node, nodeIDShift },
{ GmfRequiredEdges, SMDSAbs_Edge, edgeIDShift },
{ GmfRequiredTriangles, SMDSAbs_Face, triaIDShift },
- { GmfRequiredQuadrilaterals,SMDSAbs_Face, quadIDShift }};
+ { GmfRequiredQuadrilaterals,SMDSAbs_Face, quadIDShift }
+ };
const char* names[4] = { "_required_Vertices" ,
"_required_Edges" ,
"_required_Triangles" ,
- "_required_Quadrilaterals" };
+ "_required_Quadrilaterals"
+ };
for ( int i = 0; i < 4; ++i )
{
int gmfKwd = kes[i][0];
}
}
+ // Read fault entities into groups
+ if ( _makeFaultGroups )
+ {
+
+ const int kes[7][3] = { { GmfFault_SmallTri, SMDSAbs_Face, triaIDShift },
+ { GmfFault_BadShape, SMDSAbs_Face, triaIDShift },
+ { GmfFault_Overlap, SMDSAbs_Face, triaIDShift },
+ { GmfFault_Inter, SMDSAbs_Face, triaIDShift },
+ { GmfFault_NearTri, SMDSAbs_Face, triaIDShift },
+ { GmfFault_FreeEdge, SMDSAbs_Face, triaIDShift },
+ { GmfFault_MultipleEdge, SMDSAbs_Face, triaIDShift }
+ };
+ const char* names[7] = { "Fault_SmallTri",
+ "Fault_BadShape",
+ "Fault_Overlap",
+ "Fault_Inter",
+ "Fault_NearTri",
+ "Fault_FreeEdge",
+ "Fault_MultipleEdge"
+ };
+ for ( int i = 0; i < 7; ++i )
+ {
+ int gmfKwd = kes[i][0];
+ SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1];
+ int shift = kes[i][2];
+ if ( int nb = GmfStatKwd(meshID, gmfKwd))
+ {
+ const int newID = *groupIDs.rbegin() + 1;
+ groupIDs.insert( newID );
+ SMESHDS_Group* group = new SMESHDS_Group( newID, myMesh, entity );
+ group->SetStoreName( names[i] );
+ myMesh->AddGroup( group );
+
+ GmfGotoKwd(meshID, gmfKwd);
+ for ( int i = 0; i < nb; ++i )
+ {
+ GmfGetLin(meshID, gmfKwd, &iN[0] );
+ group->Add( shift + iN[0] );
+ }
+ }
+ }
+ }
+
+
myMesh->Modified();
myMesh->CompactMesh();
static int GmfIniFlg=0;
static GmfMshSct *GmfMshTab[ MaxMsh + 1 ];
+// see MeshGems/Docs/meshgems_formats_description.pdf
static const char *GmfKwdFmt[ GmfMaxKwd + 1 ][4] =
{ {"Reserved", "", "", ""},
{"MeshVersionFormatted", "", "", "i"},
{"Iterations", "","","i"},
{"Time", "","","r"},
{"Fault_SmallTri", "Fault_SmallTri","i","i"},
- {"CoarseHexahedra", "CoarseHexahedron", "i", "i"}
+ {"CoarseHexahedra", "CoarseHexahedron", "i", "i"},
+ {"Fault_MultipleEdge", "Fault_MultipleEdge", "i", "i"}
};
{
/* Search which kwd code this string is associated with,
then get its header and save the current position in file (just before the data) */
-
+ // printf("libmesh ScaKwdTab %s\n", str);
for(KwdCod=1; KwdCod<= GmfMaxKwd; KwdCod++)
if(!strcmp(str, GmfKwdFmt[ KwdCod ][0]))
{