Salome HOME
NRI : Add MODULE version info.
[modules/smesh.git] / src / DriverMED / DriverMED_R_SMESHDS_Mesh.cxx
1 using namespace std;
2 #include "DriverMED_R_SMESHDS_Mesh.h"
3 #include "DriverMED_R_SMDS_Mesh.h"
4 #include "utilities.h"
5
6 #include <stdlib.h>
7
8 DriverMED_R_SMESHDS_Mesh::DriverMED_R_SMESHDS_Mesh() {
9   myFileId=-1;
10 }
11
12 DriverMED_R_SMESHDS_Mesh::~DriverMED_R_SMESHDS_Mesh() {
13 ;
14 }
15
16 void DriverMED_R_SMESHDS_Mesh::SetMesh(Handle(SMDS_Mesh)& aMesh) {
17   //myMesh = Handle(SMESHDS_Mesh)::DownCast(aMesh);
18   myMesh = aMesh;
19 }
20
21 void DriverMED_R_SMESHDS_Mesh::SetFile(string aFile) {
22   myFile = aFile;
23 }
24
25 void DriverMED_R_SMESHDS_Mesh::SetFileId(med_idt aFileId) {
26   myFileId = aFileId;
27 }
28
29 void DriverMED_R_SMESHDS_Mesh::SetMeshId(int aMeshId) {
30   myMeshId = aMeshId;
31 }
32
33 void DriverMED_R_SMESHDS_Mesh::Read() {
34
35   string myClass = string("SMDS_Mesh");
36   string myExtension = string("MED");
37
38   DriverMED_R_SMDS_Mesh* myReader = new DriverMED_R_SMDS_Mesh;
39
40   myReader->SetMesh(myMesh);
41   myReader->SetMeshId(myMeshId);
42   myReader->SetFile(myFile);
43   myReader->SetFileId(-1);
44
45   myReader->Read();
46
47 }
48
49 void DriverMED_R_SMESHDS_Mesh::Add() {
50
51   string myClass = string("SMDS_Mesh");
52   string myExtension = string("MED");
53
54   DriverMED_R_SMDS_Mesh* myReader = new DriverMED_R_SMDS_Mesh;
55
56   myReader->SetMesh(myMesh);
57   myReader->SetMeshId(myMeshId);
58
59   SCRUTE(myFileId);
60   myReader->SetFileId(myFileId);
61
62   myReader->Read();
63
64 }
65
66 void DriverMED_R_SMESHDS_Mesh::ReadMySelf() {
67
68   med_err ret = 0;
69   int i,j,k,l;
70   int numero;
71   char message[200];
72   Standard_Boolean ok;
73   /* nombre d'objets MED */
74   char nom_universel[MED_TAILLE_LNOM+1];
75   med_int long_fichier_en_tete; 
76   char *fichier_en_tete;
77   char version_hdf[10];
78   char version_med[10];
79   med_int nmaa,mdim,nnoe;
80   med_int nmai[MED_NBR_GEOMETRIE_MAILLE],nfac[MED_NBR_GEOMETRIE_FACE];
81   med_int nare[MED_NBR_GEOMETRIE_ARETE];
82   /* nom du maillage */
83   char nommaa[MED_TAILLE_NOM+1];
84   /* noeuds */
85   med_float *coo;
86   char nomcoo[3*MED_TAILLE_PNOM+1];
87   char unicoo[3*MED_TAILLE_PNOM+1];
88   char *nomnoe;
89   med_int *numnoe;
90   med_int *nufano; 
91   med_repere rep;
92   med_booleen inonoe,inunoe;
93   med_mode_switch mode_coo;
94   char str[MED_TAILLE_PNOM+1];
95   /* elements */
96   med_int nsup;
97   med_int edim;
98   med_int taille;
99   med_int elem_id;
100   med_int cmpt = 0;
101   med_int *connectivite;
102   char *nomele;
103   med_int *numele;
104   med_int *nufael;
105   med_booleen inoele, inuele;
106   med_connectivite typ_con;
107   med_geometrie_element typgeo;
108   med_geometrie_element typmai[MED_NBR_GEOMETRIE_MAILLE] = {MED_POINT1,MED_SEG2, 
109                                                    MED_SEG3,MED_TRIA3,
110                                                    MED_TRIA6,MED_QUAD4,
111                                                    MED_QUAD8,MED_TETRA4,
112                                                    MED_TETRA10,MED_HEXA8,
113                                                    MED_HEXA20,MED_PENTA6,
114                                                    MED_PENTA15,MED_PYRA5,
115                                                    MED_PYRA13};
116   med_int desmai[MED_NBR_GEOMETRIE_MAILLE] = {0,2,3,3,3,4,4,4,4,6,6,5,5,5,5};
117   med_int nmailles[MED_NBR_GEOMETRIE_MAILLE];
118   char nommai[MED_NBR_GEOMETRIE_MAILLE] [MED_TAILLE_NOM+1] = {"MED_POINT1",
119                                                           "MED_SEG2", 
120                                                           "MED_SEG3",
121                                                           "MED_TRIA3",
122                                                           "MED_TRIA6",
123                                                           "MED_QUAD4",
124                                                           "MED_QUAD8",
125                                                           "MED_TETRA4",
126                                                           "MED_TETRA10",
127                                                           "MED_HEXA8",
128                                                           "MED_HEXA20",
129                                                           "MED_PENTA6",
130                                                           "MED_PENTA15",
131                                                           "MED_PYRA5",
132                                                           "MED_PYRA13"};
133   med_geometrie_element typfac[MED_NBR_GEOMETRIE_FACE] = {MED_TRIA3,MED_TRIA6,
134                                                  MED_QUAD4,MED_QUAD8};
135   med_int desfac[MED_NBR_GEOMETRIE_FACE] = {3,3,4,4};
136   med_int nfaces[MED_NBR_GEOMETRIE_FACE];
137   char nomfac[MED_NBR_GEOMETRIE_FACE][MED_TAILLE_NOM+1] = {"MED_TRIA3","MED_TRIA6",
138                                                        "MED_QUAD4","MED_QUAD8"};
139   med_geometrie_element typare[MED_NBR_GEOMETRIE_ARETE] = {MED_SEG2,MED_SEG3};
140   med_int desare[MED_NBR_GEOMETRIE_ARETE] = {2,3};
141   med_int naretes[MED_NBR_GEOMETRIE_ARETE];
142   char nomare[MED_NBR_GEOMETRIE_ARETE] [MED_TAILLE_NOM+1] = {"MED_SEG2","MED_SEG3"};
143   /* familles */
144   med_int nfam;
145   med_int natt,ngro;
146   char *attdes,*gro;
147   med_int *attval,*attide;
148   char nomfam[MED_TAILLE_NOM+1];
149   med_int numfam;
150   char str1[MED_TAILLE_DESC+1];
151   char str2[MED_TAILLE_LNOM+1];
152   string fam;
153   string fam_type;
154   string fam_id;
155   
156   char* file2Read;
157   bool locally_managed;
158
159   if (myFileId==-1) 
160     locally_managed = true;
161   else
162     locally_managed = false;
163
164   if (locally_managed)
165     { 
166     file2Read = (char*)myFile.c_str();
167     myFileId = MEDouvrir(file2Read,MED_LECT);
168     if (myFileId < 0)
169       {
170         fprintf(stderr,">> ERREUR : ouverture du fichier %s \n",file2Read);
171         exit(EXIT_FAILURE);
172       }
173     numero = 1;
174     }
175   else
176     numero = myMeshId;
177   sprintf(nommaa,"Mesh %d",myMeshId);//pour load
178   SCRUTE(nommaa);
179     
180   typ_con = MED_NOD;
181   mode_coo = MED_FULL_INTERLACE;
182   mdim = 3;
183
184   Handle(SMESHDS_Mesh) mySMESHDSMesh = Handle(SMESHDS_Mesh)::DownCast(myMesh);
185
186   //TopoDS_Shape myShape = mySMESHDSMesh->ShapeToMesh();
187
188   /****************************************************************************
189   *                       NOMBRES D'OBJETS MED                                *
190   ****************************************************************************/
191   fprintf(stdout,"\n(****************************)\n");
192   fprintf(stdout,"(* INFORMATIONS GENERALES : *)\n");
193   fprintf(stdout,"(****************************)\n");
194
195   /* lecture du nom et de la dimension du maillage */
196   /*!  fprintf(stdout,"%d %d\n",myFileId,numero);
197   ret = MEDmaaInfo(myFileId,numero,nommaa,&mdim);
198   fprintf(stdout,"%d\n",ret);
199   if (ret < 0)
200     {
201       fprintf(stderr,">> ERREUR : lecture du nom du maillage \n");
202       exit(EXIT_FAILURE);
203     }
204   fprintf(stdout,"- Nom du maillage : <<%s>>\n",nommaa);
205   fprintf(stdout,"- Dimension du maillage : %d\n",mdim);
206   */
207   /* Combien de noeuds ? */
208   nnoe = MEDnEntMaa(myFileId,nommaa,MED_COOR,MED_NOEUD,MED_POINT1,typ_con);
209   if (nnoe < 0)
210     {
211       fprintf(stderr,">> ERREUR : lecture du nombre de noeuds \n");
212       exit(EXIT_FAILURE);
213     }
214   fprintf(stdout,"- Nombre de noeuds : %d \n",nnoe);
215
216   /* Combien de mailles, faces ou aretes ? */
217   for (i=0;i<MED_NBR_GEOMETRIE_MAILLE;i++)
218     {
219       nmailles[i] = MEDnEntMaa(myFileId,nommaa,MED_CONN,MED_MAILLE,typmai[i],
220                                typ_con);
221       if (nmailles[i] < 0)
222         {
223           fprintf(stderr,">> ERREUR : lecture du nombre de mailles \n");
224           exit(EXIT_FAILURE);
225         }
226       fprintf (stdout,"- Nombre de mailles de type %s : %d \n",nommai[i],nmailles[i]);
227     }
228
229   for (i=0;i<MED_NBR_GEOMETRIE_FACE;i++)
230     {
231       nfaces[i] = MEDnEntMaa(myFileId,nommaa,MED_CONN,MED_FACE,typfac[i],
232                              typ_con);
233       if (nfaces[i] < 0)
234         {
235           fprintf(stderr,">> ERREUR : lecture du nombre de faces \n");
236           exit(EXIT_FAILURE);
237         }
238       fprintf (stdout,"- Nombre de faces de type %s : %d \n",nomfac[i],nfaces[i]);
239     }    
240
241   for (i=0;i<MED_NBR_GEOMETRIE_ARETE;i++)
242     {
243       naretes[i] = MEDnEntMaa(myFileId,nommaa,MED_CONN,MED_ARETE,typare[i],
244                               typ_con); 
245       if (naretes[i] < 0)
246         {
247           fprintf(stderr,">> ERREUR : lecture du nombre d'aretes \n");
248           exit(EXIT_FAILURE);
249         }
250       fprintf (stdout,"- Nombre d'aretes de type %s : %d \n",nomare[i],naretes[i]);
251     }
252
253   /* nombre de familles */
254   nfam = MEDnFam(myFileId,nommaa,0,MED_FAMILLE);
255   if (nfam < 0)
256     {
257       fprintf(stderr,">> ERREUR : lecture du nombre de familles \n");
258       exit(EXIT_FAILURE);
259     }   
260   fprintf(stdout,"- Nombre de familles : %d \n",nfam);
261
262   vector<int> family[nfam];
263
264   /****************************************************************************
265   *                       LECTURE DES NOEUDS                                  *
266   ****************************************************************************/
267   fprintf(stdout,"\n(************************)\n");
268   fprintf(stdout,"(* NOEUDS DU MAILLAGE : *)\n");
269   fprintf(stdout,"(************************)\n");
270
271   /* Allocations memoires */
272   /* table des coordonnees 
273      profil : (dimension * nombre de noeuds ) */
274   coo = (med_float*) malloc(sizeof(med_float)*nnoe*mdim);
275   /* table  des numeros, des numeros de familles des noeuds
276      profil : (nombre de noeuds) */
277   numnoe = (med_int*) malloc(sizeof(med_int)*nnoe);
278   nufano = (med_int*) malloc(sizeof(med_int)*nnoe);
279   /* table des noms des noeuds 
280      profil : (nnoe*MED_TAILLE_PNOM+1) */
281   nomnoe = (char*) malloc(MED_TAILLE_PNOM*nnoe+1);
282
283   /* lecture des noeuds : 
284      - coordonnees
285      - noms (optionnel dans un fichier MED) 
286      - numeros (optionnel dans un fichier MED) 
287      - numeros des familles */
288   ret = MEDnoeudsLire(myFileId,nommaa,mdim,coo,mode_coo,&rep,
289                       nomcoo,unicoo,nomnoe,&inonoe,numnoe,&inunoe,
290                       nufano,nnoe);
291   if (ret < 0)
292     strcpy(message,">> ERREUR : lecture des noeuds \n");
293
294   if (inunoe) {
295     for (int i=0;i<nnoe;i++) {
296       ok = mySMESHDSMesh->AddNodeWithID(coo[i*3],coo[i*3+1],coo[i*3+2],numnoe[i]);
297       //fprintf(Out,"%d %f %f %f\n",numnoe[i],coo[i*3],coo[i*3+1],coo[i*3+2]);
298     }
299   }
300   else {
301     for (int i=0;i<nnoe;i++) {
302       ok = mySMESHDSMesh->AddNodeWithID(coo[i*3],coo[i*3+1],coo[i*3+2],i+1);
303       //fprintf(Out,"%d %f %f %f\n",numnoe[i],coo[i*3],coo[i*3+1],i);
304       family[*(nufano+i)].push_back(numnoe[i]);
305     }
306   }
307
308   fprintf(stdout,"\n- Numeros des familles des noeuds : \n");
309   for (i=0;i<nnoe;i++)
310     fprintf(stdout," %d ",*(nufano+i));
311   fprintf(stdout,"\n");
312
313   /* liberation memoire */
314   free(coo);
315   free(nomnoe);
316   free(numnoe);
317   free(nufano);
318
319   /****************************************************************************
320   *                       LECTURE DES ELEMENTS                                *
321   ****************************************************************************/
322   fprintf(stdout,"\n(**************************)\n");
323   fprintf(stdout,"(* ELEMENTS DU MAILLAGE : *)\n");
324   fprintf(stdout,"(**************************)");
325   //fprintf(Out,"CELLS\n");
326   /* Lecture des connectivites, noms, numeros des mailles */
327   //printf("%d %d %d %d\n",nmailles[3],nmailles[4],nmailles[5],nmailles[9]);
328
329   if (ret == 0)
330     for (i=0;i<MED_NBR_GEOMETRIE_MAILLE;i++)
331       {
332         if (nmailles[i] > 0 && ret == 0)
333           {
334             /* dimension de la maille */
335             edim = typmai[i] / 100;
336             nsup = 0;
337             if (mdim  == 2 || mdim == 3)
338               if (edim == 1)
339                 nsup = 1;
340             if (mdim == 3)
341               if (edim == 2)
342                 nsup = 1;
343
344             taille = nsup+typmai[i]%100;
345             //taille = typmai[i]%100;
346             
347             /* allocation memoire */
348             connectivite = (med_int*)malloc(sizeof(med_int)*
349                                             taille*nmailles[i]);
350             nomele = (char*)malloc(sizeof(char)*MED_TAILLE_PNOM*
351                                    nmailles[i]+1);
352             numele = (med_int*)malloc(sizeof(med_int)*
353                                       nmailles[i]);
354             nufael = (med_int*)malloc(sizeof(med_int)*
355                                       nmailles[i]);
356             
357             /* lecture des données */
358             ret = MEDelementsLire(myFileId,nommaa,mdim,connectivite,mode_coo,
359                                   nomele,&inoele,numele,&inuele,nufael,
360                                   nmailles[i],MED_MAILLE,typmai[i],
361                                   typ_con);
362
363             switch (typmai[i])
364               {
365               case MED_TRIA3  : {
366                 if (inuele) {
367                   for (j=0;j<nmailles[i];j++) {
368                     elem_id=*(numele+j);
369                     ok = mySMESHDSMesh->AddFaceWithID(*(connectivite+j*(taille-nsup)),*(connectivite+j*(taille-nsup)+1),*(connectivite+j*(taille-nsup)+2),elem_id);
370                     //fprintf(Out,"%d %d %d %d\n",elem_id,*(connectivite+j*(taille-nsup)),*(connectivite+j*(taille-nsup)+1),*(connectivite+j*(taille-nsup)+2));
371                   }
372                 }
373                 else {
374                   for (j=0;j<nmailles[i];j++) {
375                     cmpt++;
376                     ok = mySMESHDSMesh->AddFaceWithID(*(connectivite+j*(taille)),*(connectivite+j*(taille)+1),*(connectivite+j*(taille)+2),cmpt);
377                     //fprintf(Out,"%d %d %d %d\n",j,*(connectivite+j*(taille)),*(connectivite+j*(taille)+1),*(connectivite+j*(taille)+2));
378                   }
379                 }
380
381                 break;
382               }
383               case MED_QUAD4  : {
384                 if (inuele) {
385                   for (j=0;j<nmailles[i];j++) {
386                     elem_id=*(numele+j);
387                     ok = mySMESHDSMesh->AddFaceWithID(*(connectivite+j*(taille-nsup)),*(connectivite+j*(taille-nsup)+1),*(connectivite+j*(taille-nsup)+2),*(connectivite+j*(taille-nsup)+3),elem_id);
388                     //fprintf(Out,"%d %d %d %d\n",elem_id,*(connectivite+j*(taille-nsup)),*(connectivite+j*(taille-nsup)+1),*(connectivite+j*(taille-nsup)+2),*(connectivite+j*(taille-nsup)+3));
389                   }
390                 }
391                 else {
392                   for (j=0;j<nmailles[i];j++) {
393                     cmpt++;
394                     ok = myMesh->AddFaceWithID(*(connectivite+j*(taille)),*(connectivite+j*(taille)+1),*(connectivite+j*(taille)+2),*(connectivite+j*(taille)+3),cmpt);
395                     //fprintf(Out,"%d %d %d %d\n",j,*(connectivite+j*(taille)),*(connectivite+j*(taille)+1),*(connectivite+j*(taille)+2),*(connectivite+j*(taille)+3));
396                   }
397                 }
398                 break;
399               }
400               case MED_HEXA8  : {
401                 if (inuele) {
402                   for (j=0;j<nmailles[i];j++) {
403                     elem_id=*(numele+j);
404                     ok = mySMESHDSMesh->AddVolumeWithID(*(connectivite+j*(taille-nsup)),*(connectivite+j*(taille-nsup)+1),*(connectivite+j*(taille-nsup)+2),*(connectivite+j*(taille-nsup)+3),*(connectivite+j*(taille-nsup)+4),*(connectivite+j*(taille-nsup)+5),*(connectivite+j*(taille-nsup)+6),*(connectivite+j*(taille-nsup)+7),elem_id);
405                     //fprintf(Out,"%d %d %d %d\n",elem_id,*(connectivite+j*(taille-nsup)),*(connectivite+j*(taille-nsup)+1),*(connectivite+j*(taille-nsup)+2),*(connectivite+j*(taille-nsup)+3),*(connectivite+j*(taille-nsup)+4),*(connectivite+j*(taille-nsup)+5),*(connectivite+j*(taille-nsup)+6),*(connectivite+j*(taille-nsup)+7));
406                   }
407                 }
408                 else {
409                   for (j=0;j<nmailles[i];j++) {
410                     cmpt++;
411                     ok = mySMESHDSMesh->AddVolumeWithID(*(connectivite+j*(taille)),*(connectivite+j*(taille)+1),*(connectivite+j*(taille)+2),*(connectivite+j*(taille)+3),*(connectivite+j*(taille)+4),*(connectivite+j*(taille)+5),*(connectivite+j*(taille)+6),*(connectivite+j*(taille)+7),cmpt);
412                     //fprintf(Out,"%d %d %d %d\n",j,*(connectivite+j*(taille)),*(connectivite+j*(taille)+1),*(connectivite+j*(taille)+2),*(connectivite+j*(taille)+3),*(connectivite+j*(taille)+4),*(connectivite+j*(taille)+5),*(connectivite+j*(taille)+6),*(connectivite+j*(taille)+7));
413                   }
414                 }
415                 break;
416               }
417               default : {
418                 break ;
419               }
420               }
421
422             fprintf(stdout,"\n  - Numéros de familles : \n");
423             for (j=0;j<nmailles[i];j++)
424               fprintf(stdout," %d ",*(nufael+j));
425             
426             /* liberation memoire */
427             free(connectivite);
428             free(nomele);
429             free(numele);
430             free(nufael);
431           }
432       }
433
434   /****************************************************************************
435    *                       LECTURE DES FAMILLES                                *
436    ****************************************************************************/
437   printf("\n(*************************)\n");
438   printf("(* FAMILLES DU MAILLAGE : *)\n");
439   printf("(*************************)\n");
440   if (ret == 0)
441     for (i=0;i<nfam;i++)
442       {
443         
444         /* nombre de groupes */
445         ngro = MEDnFam(myFileId,nommaa,i+1,MED_GROUPE);
446         if (ngro < 0)  
447           {
448             ret = -1;
449             strcpy(message,
450                    ">> ERREUR : lecture du nombre de groupes d'une famille \n");
451           }
452         
453         /* nombre d'attributs */
454         if (ret == 0)
455           {
456             natt = MEDnFam(myFileId,nommaa,i+1,MED_ATTR);
457             if (natt < 0)
458               {
459                 ret = -1;
460                 strcpy(message,
461                    ">> ERREUR : lecture du nombre d'attributs d'une famille\n");
462               }
463           }
464
465         if (ret == 0)
466           fprintf(stdout,"- Famille %d a %d attributs et %d groupes \n",i+1,natt,ngro); 
467
468         /* nom,numero,attributs,groupes */
469         if (ret == 0)
470           {
471             attide = (med_int*) malloc(sizeof(med_int)*natt);
472             attval = (med_int*) malloc(sizeof(med_int)*natt);       
473             attdes = (char *) malloc(MED_TAILLE_DESC*natt+1);
474             gro = (char*) malloc(MED_TAILLE_LNOM*ngro+1);
475             ret = MEDfamInfo(myFileId,nommaa,i+1,nomfam,&numfam,attide,attval,
476                              attdes,&natt,gro,&ngro);
477
478             fam = string(nomfam);
479             fam_type = fam.substr(1,1);
480             fam_id = fam.substr(2,1);
481             if ((fam_type==string("V"))||(fam_type==string("A"))||(fam_type==string("F")))
482               LinkMeshToShape(fam_type, fam_id, family[i]);
483
484             fprintf(stdout,"  - Famille de nom %s et de numero %d : \n",nomfam,numfam);
485             fprintf(stdout,"  - Attributs : \n");
486             for (j=0;j<natt;j++)
487               {
488                 strncpy(str1,attdes+j*MED_TAILLE_DESC,MED_TAILLE_DESC);
489                 str1[MED_TAILLE_DESC] = '\0';
490                 fprintf(stdout,"   ide = %d - val = %d - des = %s\n",*(attide+j),
491                        *(attval+j),str1);
492               }
493             free(attide);
494             free(attval);
495             free(attdes);
496             fprintf(stdout,"  - Groupes :\n");
497             for (j=0;j<ngro;j++)
498               {
499                 strncpy(str2,gro+j*MED_TAILLE_LNOM,MED_TAILLE_LNOM);
500                 str2[MED_TAILLE_LNOM] = '\0';
501                 fprintf(stdout,"   gro = %s\n",str2);
502               }
503             free(gro);
504           }
505       }
506
507   if (locally_managed)
508     ret = MEDfermer(myFileId);
509
510 }
511
512 void DriverMED_R_SMESHDS_Mesh::LinkMeshToShape(string fam_type, string fam_id, vector<int> myNodes) {
513
514   Handle(SMESHDS_Mesh) mySMESHDSMesh = Handle(SMESHDS_Mesh)::DownCast(myMesh);
515
516   int id = atoi(fam_id.c_str());
517   if (fam_type==string("V")) { //Linked to a vertex
518     for (int i=0;i<myNodes.size();i++) {
519       Handle(SMDS_MeshElement) elem = mySMESHDSMesh->FindNode(myNodes[i]);
520       const Handle(SMDS_MeshNode)& node = mySMESHDSMesh->GetNode(1,elem);
521       //const TopoDS_Vertex& S;//le recuperer !!!
522       //mySMESHDSMesh->SetNodeOnVertex (node,S);
523     }
524   }
525   else 
526   if (fam_type==string("E")) { //Linked to an edge
527     for (int i=0;i<myNodes.size();i++) {
528       Handle(SMDS_MeshElement) elem = mySMESHDSMesh->FindNode(myNodes[i]);
529       const Handle(SMDS_MeshNode)& node = mySMESHDSMesh->GetNode(1,elem);
530       //const TopoDS_Edge& S;//le recuperer !!!
531       //mySMESHDSMesh->SetNodeOnEdge (node,S);
532     }
533   }
534   else 
535   if (fam_type==string("F")) { //Linked to a face
536     for (int i=0;i<myNodes.size();i++) {
537       Handle(SMDS_MeshElement) elem = mySMESHDSMesh->FindNode(myNodes[i]);
538       const Handle(SMDS_MeshNode)& node = mySMESHDSMesh->GetNode(1,elem);
539       //const TopoDS_Face& S;//le recuperer !!!
540       //mySMESHDSMesh->SetNodeOnFace (node,S);
541     }
542   }
543
544 }
545