- * ECRITURE DES ELEMENTS *
- ****************************************************************************/
- fprintf(stdout, "\n(**************************)\n");
- fprintf(stdout, "(* ELEMENTS DU MAILLAGE : *)\n");
- fprintf(stdout, "(**************************)");
- /* Ecriture des connectivites, noms, numeros des mailles */
-
- SMDS_EdgeIteratorPtr itEdges=myMesh->edgesIterator();
- while(itEdges->more())
- {
- const SMDS_MeshElement * elem = itEdges->next();
-
- switch (elem->NbNodes())
- {
- case 2:
- {
- fprintf(myFileId, "%d %d ", elem->GetID(), 102);
- break;
- }
- case 3:
- {
- fprintf(myFileId, "%d %d ", elem->GetID(), 103);
- break;
- }
- }
-
- SMDS_ElemIteratorPtr it=elem->nodesIterator();
- while(it->more()) fprintf(myFileId, "%d ", it->next()->GetID());
-
- fprintf(myFileId, "\n");
- }
-
- SMDS_FaceIteratorPtr itFaces=myMesh->facesIterator();
- while(itFaces->more())
- {
- const SMDS_MeshElement * elem = itFaces->next();
-
- switch (elem->NbNodes())
- {
- case 3:
- {
- fprintf(myFileId, "%d %d ", elem->GetID(), 203);
- break;
- }
- case 4:
- {
- fprintf(myFileId, "%d %d ", elem->GetID(), 204);
- break;
- }
- case 6:
- {
- fprintf(myFileId, "%d %d ", elem->GetID(), 206);
- break;
- }
- }
-
- SMDS_ElemIteratorPtr it=elem->nodesIterator();
- while(it->more()) fprintf(myFileId, "%d ", it->next()->GetID());
-
- fprintf(myFileId, "\n");
- }
-
- SMDS_VolumeIteratorPtr itVolumes=myMesh->volumesIterator();
- while(itVolumes->more())
- {
- const SMDS_MeshElement * elem = itVolumes->next();
-
- switch (elem->NbNodes())
- {
- case 8:
- {
- fprintf(myFileId, "%d %d ", elem->GetID(), 308);
- break;
- }
- }
-
- SMDS_ElemIteratorPtr it=elem->nodesIterator();
- while(it->more()) fprintf(myFileId, "%d ", it->next()->GetID());
-
- fprintf(myFileId, "\n");
- }
-
- fclose(myFileId);
+ * ECRITURE DES ELEMENTS *
+ ****************************************************************************/
+ /* Ecriture des connectivites, noms, numeros des mailles */
+
+ SMDS_EdgeIteratorPtr itEdges=myMesh->edgesIterator();
+ while(itEdges->more()){
+ const SMDS_MeshElement * elem = itEdges->next();
+ switch (elem->NbNodes()) {
+ case 2:
+ fprintf(aFileId, "%d %d ", elem->GetID(), 102);
+ break;
+ case 3:
+ fprintf(aFileId, "%d %d ", elem->GetID(), 103);
+ break;
+ }
+ SMDS_ElemIteratorPtr it=elem->nodesIterator();
+ while(it->more())
+ fprintf(aFileId, "%d ", it->next()->GetID());
+ fprintf(aFileId, "\n");
+ }
+
+ SMDS_FaceIteratorPtr itFaces=myMesh->facesIterator();
+ while(itFaces->more()){
+ const SMDS_MeshElement * elem = itFaces->next();
+ if ( elem->IsPoly() )
+ fprintf(aFileId, "%d %d ", elem->GetID(), 400+elem->NbNodes());
+ else
+ fprintf(aFileId, "%d %d ", elem->GetID(), 200+elem->NbNodes());
+ SMDS_ElemIteratorPtr it=elem->nodesIterator();
+ while(it->more())
+ fprintf(aFileId, "%d ", it->next()->GetID());
+ fprintf(aFileId, "\n");
+ }
+
+ SMDS_VolumeIteratorPtr itVolumes=myMesh->volumesIterator();
+ while(itVolumes->more()){
+ const SMDS_MeshElement * elem = itVolumes->next();
+ if ( elem->IsPoly() )
+ fprintf(aFileId, "%d %d ", elem->GetID(), 500+elem->NbNodes());
+ else
+ fprintf(aFileId, "%d %d ", elem->GetID(), 300+elem->NbNodes());
+ SMDS_ElemIteratorPtr it=elem->nodesIterator();
+ while(it->more())
+ fprintf(aFileId, "%d ", it->next()->GetID());
+
+ fprintf(aFileId, "\n");
+ }
+
+ fclose(aFileId);
+
+ return aResult;