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