- int trouveHexa8=0;
- SMDS_MeshVolumesIterator itVolumes(_meshDS);
- for (;itVolumes.More();itVolumes.Next())
- {
- const Handle(SMDS_MeshElement)& elem = itVolumes.Value();
-
- int nb_of_nodes = elem->NbNodes();
- medElement=SALOME_MED::MED_HEXA8;
- ASSERT(nb_of_nodes=8);
-
- if (trouveHexa8 == 0)
- {
- trouveHexa8=1;
- _TypesId[SALOME_MED::MED_CELL].push_back(SALOME_MED::MED_HEXA8);
- };
- // Traitement de la maille
- int longueur=_seq_elemId[index]->length();
- _seq_elemId[index]->length(longueur+nb_of_nodes);
-
- for (int k=0; k<nb_of_nodes; k++)
- {
- _seq_elemId[index][longueur+k]=elem->GetConnection(k+1) +1;
- }
-
- }
-
- _mapNbTypes[SALOME_MED::MED_CELL]=trouveHexa8;
- _mapNbTypes[SALOME_MED::MED_ALL_ENTITIES]
- =trouveHexa8 + trouveTria3 + trouveTria6 + trouveQuad4 + trouveSeg2 + trouveSeg3 ;
- } /* fin du _compte */
+ for(int k=0; itn->more(); k++)
+ _seq_elemId[index][longueur + k] = itn->next()->GetID()+1;
+ }
+
+ _mapNbTypes[SALOME_MED::MED_EDGE] = trouveSeg2 + trouveSeg3;
+
+ // On compte les faces MED_TRIA3, MED_HEXA8, MED_TRIA6
+ // On range les elements dans les vecteurs correspondants
+ int trouveTria3 = 0;
+ int trouveTria6 = 0;
+ int trouveQuad4 = 0;
+
+ _mapIndToSeqElts[SALOME_MED::MED_TRIA3] = _indexElts++;
+ _mapIndToSeqElts[SALOME_MED::MED_TRIA6] = _indexElts++;
+ _mapIndToSeqElts[SALOME_MED::MED_QUAD4] = _indexElts++;
+ _mapIndToVectTypes[SALOME_MED::MED_FACE] = _indexEnts++;
+
+ SMDS_FaceIteratorPtr itFaces=_meshDS->facesIterator();
+ while(itFaces->more())
+ {
+ const SMDS_MeshFace * elem = itFaces->next();
+ int nb_of_nodes = elem->NbNodes();
+
+ switch (nb_of_nodes)
+ {
+ case 3:
+ {
+ medElement = SALOME_MED::MED_TRIA3;
+ if (trouveTria3 == 0)
+ {
+ trouveTria3 = 1;
+ _TypesId[SALOME_MED::MED_FACE].
+ push_back(SALOME_MED::MED_TRIA3);
+ }
+ break;
+ }
+ case 4:
+ {
+ medElement = SALOME_MED::MED_QUAD4;
+ if (trouveQuad4 == 0)
+ {
+ trouveQuad4 = 1;
+ _TypesId[SALOME_MED::MED_FACE].
+ push_back(SALOME_MED::MED_QUAD4);
+ }
+ break;
+ }
+ case 6:
+ {
+ medElement = SALOME_MED::MED_TRIA6;
+ if (trouveTria6 == 0)
+ {
+ trouveTria6 = 1;
+ _TypesId[SALOME_MED::MED_FACE].
+ push_back(SALOME_MED::MED_TRIA6);
+ }
+ break;
+ }
+ }
+ int index = _mapIndToSeqElts[medElement];
+ SCRUTE(index);
+
+ // Traitement de la face
+ // Attention La numérotation des noeuds Med commence a 1
+
+ int longueur = _seq_elemId[index]->length();
+ _seq_elemId[index]->length(longueur + nb_of_nodes);
+
+ SMDS_NodeIteratorPtr itn=_meshDS->nodesIterator();
+
+ for(int k=0; itn->more(); k++)
+ _seq_elemId[index][longueur + k] = itn->next()->GetID()+1;
+ } //itFaces
+
+ _mapNbTypes[SALOME_MED::MED_FACE] =
+ trouveTria3 + trouveTria6 + trouveQuad4;
+
+ _mapIndToSeqElts[SALOME_MED::MED_HEXA8] = _indexElts++;
+ _mapIndToVectTypes[SALOME_MED::MED_CELL] = _indexEnts++;
+ int index = _mapIndToSeqElts[medElement];
+
+ int trouveHexa8 = 0;
+
+ SMDS_VolumeIteratorPtr itVolumes=_meshDS->volumesIterator();
+ while(itVolumes->more())
+ {
+ const SMDS_MeshVolume * elem = itVolumes->next();
+
+ int nb_of_nodes = elem->NbNodes();
+ medElement = SALOME_MED::MED_HEXA8;
+ ASSERT(nb_of_nodes == 8);
+
+ if (trouveHexa8 == 0)
+ {
+ trouveHexa8 = 1;
+ _TypesId[SALOME_MED::MED_CELL].push_back(SALOME_MED::MED_HEXA8);
+ };
+ // Traitement de la maille
+ int longueur = _seq_elemId[index]->length();
+ _seq_elemId[index]->length(longueur + nb_of_nodes);
+
+ SMDS_NodeIteratorPtr itn=_meshDS->nodesIterator();
+ for(int k=0; itn->more(); k++)
+ _seq_elemId[index][longueur + k] = itn->next()->GetID()+1;
+ }
+
+ _mapNbTypes[SALOME_MED::MED_CELL] = trouveHexa8;
+ _mapNbTypes[SALOME_MED::MED_ALL_ENTITIES]
+ =
+ trouveHexa8 + trouveTria3 + trouveTria6 + trouveQuad4 + trouveSeg2 +
+ trouveSeg3;
+ }// fin du _compte