]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/INTERPOLATION/MEDMEM_WrapperCells.hxx
Salome HOME
update from the MedMemory V1.0.1
[modules/med.git] / src / MEDMEM / INTERPOLATION / MEDMEM_WrapperCells.hxx
1 #ifndef WRAPPERS_CELLS_HXX
2 #define WRAPPERS_CELLS_HXX
3
4 #include "stdio.h"
5 #include "stdlib.h"
6
7 #include <typeinfo>
8
9 #include <vector>
10 #include <map>
11
12 #ifndef FAUX
13 #define FAUX 0
14 #endif
15
16 #ifndef VRAI
17 #define VRAI 1
18 #endif
19
20 #ifndef UNDEFINED
21 #define UNDEFINED -1
22 #endif
23
24 #include "MEDMEM_define.hxx"
25
26 //////////////////////////////////////////////////////////////////
27 ///                                                            ///
28 ///                        DECLARATIONS                        ///
29 ///                                                            ///
30 //////////////////////////////////////////////////////////////////
31
32 /*********************************************************/
33 /*                                                       */
34 /*           Fonction Comparaison_Informe(...)           */
35 /*                                                       */
36 /*********************************************************/
37
38 int Comparaison_Informe(const vector<int> &v1,const vector<int> &v2);
39
40
41 /*********************************************************/
42 /*                                                       */
43 /*               Classe Wrapper_Maille                   */
44 /*                                                       */
45 /*********************************************************/
46
47 // REMARQUE : A REFAIRE COMPLETEMENT !
48
49 class Wrapper_Maille
50 {
51 protected :
52         int * sommets;
53 public :
54         Wrapper_Maille():sommets(NULL) {}
55         ~Wrapper_Maille() {}
56         inline const Wrapper_Maille & positionne(int * pos){sommets=pos;return *this;}
57         inline int operator[](int i) const {return sommets[i];} 
58         virtual int         DONNE_NBR_NOEUDS()                        const {cerr<<"APPEL D'UNE FONCTION VIRTUELLE DE LA CLASSE MERE WRAPPER_MAILLE => EXIT"<<endl;exit(-1);}
59         virtual int         DONNE_NBR_FACES()                         const {cerr<<"APPEL D'UNE FONCTION VIRTUELLE DE LA CLASSE MERE WRAPPER_MAILLE => EXIT"<<endl;exit(-1);}
60         virtual vector<int> DONNE_SIMPLEXE_BASE(int num_face)         const {cerr<<"APPEL D'UNE FONCTION VIRTUELLE DE LA CLASSE MERE WRAPPER_MAILLE => EXIT"<<endl;exit(-1);}
61         virtual vector<int> DONNE_FACE(int num_face)                  const {cerr<<"APPEL D'UNE FONCTION VIRTUELLE DE LA CLASSE MERE WRAPPER_MAILLE => EXIT"<<endl;exit(-1);}
62         virtual int         DONNE_PREMIER_NOEUD_DE_FACE(int num_face) const {cerr<<"APPEL D'UNE FONCTION VIRTUELLE DE LA CLASSE MERE WRAPPER_MAILLE => EXIT"<<endl;exit(-1);}
63 };
64
65 /*********************************************************/
66 /*                                                       */
67 /*            Dérivées de Wrapper_Maille                 */
68 /*                                                       */
69 /*********************************************************/
70
71 // class Wrapper_Maille_Seg2    ; // public Wrapper_Maille;
72 // class Wrapper_Maille_Seg3    ; // public Wrapper_Maille;
73 class Wrapper_Maille_Tria3   ; // public Wrapper_Maille;
74 class Wrapper_Maille_Tria6   ; // public Wrapper_Maille;
75 class Wrapper_Maille_Quad4   ; // public Wrapper_Maille;
76 class Wrapper_Maille_Quad8   ; // public Wrapper_Maille;
77 class Wrapper_Maille_Tetra4  ; // public Wrapper_Maille;
78 class Wrapper_Maille_Tetra10 ; // public Wrapper_Maille;
79 class Wrapper_Maille_Hexa8   ; // public Wrapper_Maille;
80 class Wrapper_Maille_Hexa20  ; // public Wrapper_Maille;
81 class Wrapper_Maille_Pyra5   ; // public Wrapper_Maille;
82 class Wrapper_Maille_Pyra13  ; // public Wrapper_Maille;
83 class Wrapper_Maille_Penta6  ; // public Wrapper_Maille;
84 class Wrapper_Maille_Penta15 ; // public Wrapper_Maille;
85
86 /*********************************************************/
87 /*                                                       */
88 /*            Classe Type_Wrapper_Maille                 */
89 /*                                                       */
90 /*********************************************************/
91
92 // Permet de switcher en fonction du type de maille
93
94 class Type_Wrapper_Maille
95 {
96 protected :
97         map<int,Wrapper_Maille *> contenu;
98 public :
99         ~Type_Wrapper_Maille();
100         Type_Wrapper_Maille();
101         inline Wrapper_Maille * operator[] (int i) {return contenu[i];}
102 };
103
104 /*********************************************************/
105 /*                                                       */
106 /*            Classe Wrapper_Nuage_Maille                */
107 /*                                                       */
108 /*********************************************************/
109
110 template <class FORME_SKYLINE> class Wrapper_Nuage_Maille
111 {
112 protected :
113         FORME_SKYLINE * mailles;
114         Type_Wrapper_Maille show;
115         int nbr_mailles;
116         vector<int> types;
117         vector< int* > premier_pointeur;
118 public :
119         Wrapper_Nuage_Maille():mailles(NULL) {}
120         Wrapper_Nuage_Maille(FORME_SKYLINE * fs);
121         ~Wrapper_Nuage_Maille() {}
122         // Méthodes de la politique
123         inline const Wrapper_Maille & operator[](int i);
124         inline int         SIZE() {return nbr_mailles;}
125         inline int         DONNE_NBR_FACES(int num_maille);
126         inline int         DONNE_NBR_NOEUDS(int num_maille);
127         inline vector<int> DONNE_SIMPLEXE_BASE(int num_maille,int num_face);
128         inline int         DONNE_PREMIER_NOEUD_DE_FACE(int num_maille,int num_face_loc);
129         inline vector<int> DONNE_FACE(int num_maille,int num_local_formant);
130         inline int         DONNE_NUM_LOC_FACE_EGALE_A_FORMANT(int num_maille_sec,const vector<int> &sommets_face);
131         inline int         DONNE_SOMMET_MAILLE(int num_maille,int num_som);
132         inline int         DONNE_TYPE_MAILLE(int num_maille) {return mailles->DONNE_TYPE_MAILLE(num_maille);}
133 };
134
135 //////////////////////////////////////////////////////////////////
136 ///                                                            ///
137 ///                            CODE                            ///
138 ///                                                            ///
139 //////////////////////////////////////////////////////////////////
140
141 /*********************************************************/
142 /*                                                       */
143 /*           Fonction Comparaison_Informe(...)           */
144 /*                                                       */
145 /*********************************************************/
146
147 int Comparaison_Informe(const vector<int> &v1,const vector<int> &v2)
148         {
149         int s1=v1.size();
150         int s2=v2.size();
151         if (s1!=s2) return FAUX;
152         int i1,i2;
153         int test;
154         for (i1=0;i1<s1;i1++)
155                 {
156                 test=1;
157                 for (i2=0;(i2<s2)&&(test);i2++)
158                         {
159                         if (v1[i1]==v2[i2]) test=0;
160                         }
161                 if (test) return FAUX;
162                 }
163         return VRAI;
164         }
165         
166 /*********************************************************/
167 /*                                                       */
168 /*            Classe Wrapper_Nuage_Maille                */
169 /*                                                       */
170 /*********************************************************/     
171         
172 template <class FORME_SKYLINE>  Wrapper_Nuage_Maille<FORME_SKYLINE>::Wrapper_Nuage_Maille(FORME_SKYLINE * fs):mailles(fs)
173                 {
174                 int i;
175                 nbr_mailles=mailles->SIZE();
176                 types.resize(nbr_mailles);
177                 premier_pointeur.resize(nbr_mailles);
178                 for (i=0;i<nbr_mailles;i++) 
179                         {
180                         types[i]=mailles->DONNE_TYPE_MAILLE(i);
181                         premier_pointeur[i]=mailles->DONNE_PREMIER_POINTEUR(i);
182                         }
183                 show[types[0]]->positionne(premier_pointeur[0]);
184                 }
185 template <class FORME_SKYLINE> const Wrapper_Maille & Wrapper_Nuage_Maille<FORME_SKYLINE>::operator[](int i)
186                 {
187                 return show[types[i]]->positionne(premier_pointeur[i]);
188                 }
189 template <class FORME_SKYLINE>  inline int Wrapper_Nuage_Maille<FORME_SKYLINE>::DONNE_SOMMET_MAILLE(int num_maille,int num_som)
190                 {
191                 return (*this)[num_maille][num_som];
192                 }
193
194 template <class FORME_SKYLINE>  inline int Wrapper_Nuage_Maille<FORME_SKYLINE>::DONNE_NUM_LOC_FACE_EGALE_A_FORMANT(int num_maille,const vector<int> &sommets_face)
195         {
196         vector<int> face_loc;
197         int num_face;
198         int test=FAUX;
199         for (num_face=0;num_face<DONNE_NBR_FACES(num_maille);num_face++)
200                 {
201                 face_loc=DONNE_FACE(num_maille,num_face);
202                 if (Comparaison_Informe(face_loc,sommets_face)) return num_face;
203                 }
204         return UNDEFINED;
205         }
206 template <class FORME_SKYLINE> int Wrapper_Nuage_Maille<FORME_SKYLINE>::DONNE_NBR_NOEUDS(int num_maille)
207                 {
208                 return (*this)[num_maille].DONNE_NBR_NOEUDS();
209                 }
210 template <class FORME_SKYLINE> int Wrapper_Nuage_Maille<FORME_SKYLINE>::DONNE_NBR_FACES(int num_maille)
211                 {
212                 return (*this)[num_maille].DONNE_NBR_FACES();
213                 }
214 template <class FORME_SKYLINE> vector<int> Wrapper_Nuage_Maille<FORME_SKYLINE>::DONNE_SIMPLEXE_BASE(int num_maille,int num_face)
215                 {
216                 return (*this)[num_maille].DONNE_SIMPLEXE_BASE(num_face);
217                 }
218 template <class FORME_SKYLINE> vector<int> Wrapper_Nuage_Maille<FORME_SKYLINE>::DONNE_FACE(int num_maille,int num_face)
219                 {
220                 return (*this)[num_maille].DONNE_FACE(num_face);
221                 }
222 template <class FORME_SKYLINE> int Wrapper_Nuage_Maille<FORME_SKYLINE>::DONNE_PREMIER_NOEUD_DE_FACE(int num_maille,int num_face)
223                 {
224                 return (*this)[num_maille].DONNE_PREMIER_NOEUD_DE_FACE(num_face);
225                 }
226
227 /*********************************************************/
228 /*                                                       */
229 /*           Classe Wrapper_Maille_Seg2                  */
230 /*                                                       */
231 /*********************************************************/
232         
233 /*
234 class Wrapper_Maille_Seg2    : public Wrapper_Maille
235 {
236 public :
237         inline int DONNE_NBR_FACES() const {return 2;}
238         inline int DONNE_NBR_NOEUDS() const {return 2;}
239 };
240 //*/
241
242 /*********************************************************/
243 /*                                                       */
244 /*           Classe Wrapper_Maille_Seg3                  */
245 /*                                                       */
246 /*********************************************************/
247
248 /*
249 class Wrapper_Maille_Seg3    : public Wrapper_Maille
250 {
251 public :
252         inline int DONNE_NBR_FACES() const {return 2;}
253         inline int DONNE_NBR_NOEUDS() const {return 3;}
254 };
255 //*/
256
257 /*********************************************************/
258 /*                                                       */
259 /*           Classe Wrapper_Maille_Tria3                 */
260 /*                                                       */
261 /*********************************************************/
262
263 class Wrapper_Maille_Tria3 : public Wrapper_Maille
264 {
265 public :
266         inline int DONNE_NBR_FACES() const {return 3;}
267         inline int DONNE_NBR_NOEUDS() const {return 3;}
268         inline int DONNE_PREMIER_NOEUD_DE_FACE(int num_face) const
269                 {
270                 switch (num_face)
271                         {
272                         case 0 : return sommets[0];
273                         case 1 : return sommets[1];
274                         case 2 : return sommets[2];
275                         }
276                 }
277         inline vector<int> DONNE_FACE(int num_face) const
278                 {
279                 vector<int> retour(2);
280                 switch (num_face) 
281                         {
282                         case 0 : retour[0]=sommets[0];retour[1]=sommets[1];break;
283                         case 1 : retour[0]=sommets[1];retour[1]=sommets[2];break;
284                         case 2 : retour[0]=sommets[2];retour[1]=sommets[0];break;
285                         }
286                 return retour;
287                 }
288         inline vector<int> DONNE_SIMPLEXE_BASE(int num_face) const
289                 {
290                 vector<int> retour(3);
291                 switch (num_face) 
292                         {
293                         case 0 : retour[0]=sommets[2];retour[1]=sommets[0];retour[2]=sommets[1];break;
294                         case 1 : retour[0]=sommets[0];retour[1]=sommets[1];retour[2]=sommets[2];break;
295                         case 2 : retour[0]=sommets[1];retour[1]=sommets[2];retour[2]=sommets[0];break;
296                         }
297                 return retour;
298                 }
299 };
300
301 /*********************************************************/
302 /*                                                       */
303 /*           Classe Wrapper_Maille_Tria6                 */
304 /*                                                       */
305 /*********************************************************/
306
307 class Wrapper_Maille_Tria6 : public Wrapper_Maille
308 {
309 public :
310         inline int DONNE_NBR_FACES() const {return 3;}
311         inline int DONNE_NBR_NOEUDS() const {return 6;}
312         inline int DONNE_PREMIER_NOEUD_DE_FACE(int num_face) const
313                 {
314                 switch (num_face)
315                         {
316                         case 0 : return sommets[0];
317                         case 1 : return sommets[1];
318                         case 2 : return sommets[2];
319                         }
320                 }
321         inline vector<int> DONNE_FACE(int num_face) const
322                 {
323                 vector<int> retour(2);
324                 switch (num_face) 
325                         {
326                         case 0 : retour[0]=sommets[0];retour[1]=sommets[1];break;
327                         case 1 : retour[0]=sommets[1];retour[1]=sommets[2];break;
328                         case 2 : retour[0]=sommets[2];retour[1]=sommets[0];break;
329                         }
330                 return retour;
331                 }
332         inline vector<int> DONNE_SIMPLEXE_BASE(int num_face) const
333                 {
334                 vector<int> retour(3);
335                 switch (num_face) 
336                         {
337                         case 0 : retour[0]=sommets[2];retour[1]=sommets[0];retour[2]=sommets[1];break;
338                         case 1 : retour[0]=sommets[0];retour[1]=sommets[1];retour[2]=sommets[2];break;
339                         case 2 : retour[0]=sommets[1];retour[1]=sommets[2];retour[2]=sommets[0];break;
340                         }
341                 return retour;
342                 }
343 };
344
345 /*********************************************************/
346 /*                                                       */
347 /*           Classe Wrapper_Maille_Quad4                 */
348 /*                                                       */
349 /*********************************************************/
350
351 class Wrapper_Maille_Quad4 : public Wrapper_Maille
352 {
353 public :
354         inline int DONNE_NBR_FACES() const {return 4;}
355         inline int DONNE_NBR_NOEUDS() const {return 4;}
356         inline int DONNE_PREMIER_NOEUD_DE_FACE(int num_face) const
357                 {
358                 switch (num_face)
359                         {
360                         case 0 : return sommets[0];
361                         case 1 : return sommets[1];
362                         case 2 : return sommets[2];
363                         case 3 : return sommets[3];
364                         }
365                 }
366         inline vector<int> DONNE_FACE(int num_face) const
367                 {
368                 vector<int> retour(2);
369                 switch (num_face) 
370                         {
371                         case 0 : retour[0]=sommets[0];retour[1]=sommets[1];break;
372                         case 1 : retour[0]=sommets[1];retour[1]=sommets[2];break;
373                         case 2 : retour[0]=sommets[2];retour[1]=sommets[3];break;
374                         case 3 : retour[0]=sommets[3];retour[1]=sommets[0];break;
375                         }
376                 return retour;
377                 }
378         inline vector<int> DONNE_SIMPLEXE_BASE(int num_face) const
379                 {
380                 vector<int> retour(3);
381                 switch (num_face) 
382                         {
383                         case 0 : retour[0]=sommets[2];retour[1]=sommets[0];retour[2]=sommets[1];break;
384                         case 1 : retour[0]=sommets[3];retour[1]=sommets[1];retour[2]=sommets[2];break;
385                         case 2 : retour[0]=sommets[0];retour[1]=sommets[2];retour[2]=sommets[3];break;
386                         case 3 : retour[0]=sommets[1];retour[1]=sommets[0];retour[3]=sommets[0];break;
387                         }
388                 return retour;
389                 }
390 };
391
392
393 /*********************************************************/
394 /*                                                       */
395 /*           Classe Wrapper_Maille_Quad8                 */
396 /*                                                       */
397 /*********************************************************/
398
399 class Wrapper_Maille_Quad8 : public Wrapper_Maille
400 {
401 public :
402         inline int DONNE_NBR_FACES() const {return 4;}
403         inline int DONNE_NBR_NOEUDS() const {return 8;}
404         inline int DONNE_PREMIER_NOEUD_DE_FACE(int num_face) const
405                 {
406                 switch (num_face)
407                         {
408                         case 0 : return sommets[0];
409                         case 1 : return sommets[1];
410                         case 2 : return sommets[2];
411                         case 3 : return sommets[3];
412                         }
413                 }
414         inline vector<int> DONNE_FACE(int num_face) const
415                 {
416                 vector<int> retour(2);
417                 switch (num_face) 
418                         {
419                         case 0 : retour[0]=sommets[0];retour[1]=sommets[1];break;
420                         case 1 : retour[0]=sommets[1];retour[1]=sommets[2];break;
421                         case 2 : retour[0]=sommets[2];retour[1]=sommets[3];break;
422                         case 3 : retour[0]=sommets[3];retour[1]=sommets[0];break;
423                         }
424                 return retour;
425                 }
426         inline vector<int> DONNE_SIMPLEXE_BASE(int num_face) const
427                 {
428                 vector<int> retour(3);
429                 switch (num_face) 
430                         {
431                         case 0 : retour[0]=sommets[2];retour[1]=sommets[0];retour[2]=sommets[1];break;
432                         case 1 : retour[0]=sommets[3];retour[1]=sommets[1];retour[2]=sommets[2];break;
433                         case 2 : retour[0]=sommets[0];retour[1]=sommets[2];retour[2]=sommets[3];break;
434                         case 3 : retour[0]=sommets[1];retour[1]=sommets[0];retour[3]=sommets[0];break;
435                         }
436                 return retour;
437                 }
438 };
439
440 /*********************************************************/
441 /*                                                       */
442 /*           Classe Wrapper_Maille_Tetra4                */
443 /*                                                       */
444 /*********************************************************/
445
446 class Wrapper_Maille_Tetra4 : public Wrapper_Maille
447 {
448 public :
449         inline int DONNE_NBR_FACES() const {return 4;}
450         inline int DONNE_NBR_NOEUDS() const {return 4;}
451         inline int DONNE_PREMIER_NOEUD_DE_FACE(int num_face) const
452                 {
453                 switch (num_face)
454                         {
455                         case 0 : return sommets[0];
456                         case 1 : return sommets[0];
457                         case 2 : return sommets[1];
458                         case 3 : return sommets[2];
459                         }
460                 }
461         inline vector<int> DONNE_FACE(int num_face) const
462                 {
463                 vector<int> retour(3);
464                 switch (num_face) 
465                         {
466                         case 0 : retour[0]=sommets[0];retour[1]=sommets[1];retour[2]=sommets[2];break;
467                         case 1 : retour[0]=sommets[0];retour[1]=sommets[3];retour[2]=sommets[1];break;
468                         case 2 : retour[0]=sommets[1];retour[1]=sommets[3];retour[2]=sommets[2];break;
469                         case 3 : retour[0]=sommets[2];retour[1]=sommets[3];retour[2]=sommets[0];break;
470                         }
471                 return retour;
472                 }
473         inline vector<int> DONNE_SIMPLEXE_BASE(int num_face) const
474                 {
475                 vector<int> retour(4);
476                 switch (num_face) 
477                         {
478                         case 0 : retour[0]=sommets[3];retour[1]=sommets[0];retour[2]=sommets[1];retour[3]=sommets[2];break;
479                         case 1 : retour[0]=sommets[2];retour[1]=sommets[0];retour[2]=sommets[3];retour[3]=sommets[1];break;
480                         case 2 : retour[0]=sommets[0];retour[1]=sommets[1];retour[2]=sommets[3];retour[3]=sommets[2];break;
481                         case 3 : retour[0]=sommets[1];retour[1]=sommets[2];retour[2]=sommets[3];retour[3]=sommets[0];break;
482                         }
483                 return retour;
484                 }
485 };
486
487 /*********************************************************/
488 /*                                                       */
489 /*          Classe Wrapper_Maille_Tetra10                */
490 /*                                                       */
491 /*********************************************************/
492
493 class Wrapper_Maille_Tetra10 : public Wrapper_Maille
494 {
495 public :
496         inline int DONNE_NBR_FACES() const {return 4;}
497         inline int DONNE_NBR_NOEUDS() const {return 10;}
498         inline int DONNE_PREMIER_NOEUD_DE_FACE(int num_face) const
499                 {
500                 switch (num_face)
501                         {
502                         case 0 : return sommets[0];
503                         case 1 : return sommets[0];
504                         case 2 : return sommets[1];
505                         case 3 : return sommets[2];
506                         }
507                 }
508         inline vector<int> DONNE_FACE(int num_face) const
509                 {
510                 vector<int> retour(3);
511                 switch (num_face) 
512                         {
513                         case 0 : retour[0]=sommets[0];retour[1]=sommets[1];retour[2]=sommets[2];break;
514                         case 1 : retour[0]=sommets[0];retour[1]=sommets[3];retour[2]=sommets[1];break;
515                         case 2 : retour[0]=sommets[1];retour[1]=sommets[3];retour[2]=sommets[2];break;
516                         case 3 : retour[0]=sommets[2];retour[1]=sommets[3];retour[2]=sommets[0];break;
517                         }
518                 return retour;
519                 }
520         inline vector<int> DONNE_SIMPLEXE_BASE(int num_face) const
521                 {
522                 vector<int> retour(4);
523                 switch (num_face) 
524                         {
525                         case 0 : retour[0]=sommets[3];retour[1]=sommets[0];retour[2]=sommets[1];retour[3]=sommets[2];break;
526                         case 1 : retour[0]=sommets[2];retour[1]=sommets[0];retour[2]=sommets[3];retour[3]=sommets[1];break;
527                         case 2 : retour[0]=sommets[0];retour[1]=sommets[1];retour[2]=sommets[3];retour[3]=sommets[2];break;
528                         case 3 : retour[0]=sommets[1];retour[1]=sommets[2];retour[2]=sommets[3];retour[3]=sommets[0];break;
529                         }
530                 return retour;
531                 }
532 };
533
534 /*********************************************************/
535 /*                                                       */
536 /*           Classe Wrapper_Maille_Hexa8                 */
537 /*                                                       */
538 /*********************************************************/
539
540 class Wrapper_Maille_Hexa8 : public Wrapper_Maille
541 {
542 public :
543         inline int DONNE_NBR_FACES() const {return 6;}
544         inline int DONNE_NBR_NOEUDS() const {return 8;}
545         inline int DONNE_PREMIER_NOEUD_DE_FACE(int num_face) const
546                 {
547                 switch (num_face)
548                         {
549                         case 0 : return sommets[0];
550                         case 1 : return sommets[4];
551                         case 2 : return sommets[0];
552                         case 3 : return sommets[1];
553                         case 4 : return sommets[2];
554                         case 5 : return sommets[3];
555                         }
556                 }
557         inline vector<int> DONNE_FACE(int num_face) const
558                 {
559                 vector<int> retour(4);
560                 switch (num_face) 
561                         {
562                         case 0 : retour[0]=sommets[0];retour[1]=sommets[1];retour[2]=sommets[2];retour[3]=sommets[3];break;
563                         case 1 : retour[0]=sommets[4];retour[1]=sommets[5];retour[2]=sommets[6];retour[3]=sommets[7];break;
564                         case 2 : retour[0]=sommets[0];retour[1]=sommets[4];retour[2]=sommets[5];retour[3]=sommets[1];break;
565                         case 3 : retour[0]=sommets[1];retour[1]=sommets[5];retour[2]=sommets[6];retour[3]=sommets[2];break;
566                         case 4 : retour[0]=sommets[2];retour[1]=sommets[6];retour[2]=sommets[7];retour[3]=sommets[3];break;
567                         case 5 : retour[0]=sommets[3];retour[1]=sommets[7];retour[2]=sommets[4];retour[3]=sommets[0];break;
568         
569                         }
570                 return retour;
571                 }
572         inline vector<int> DONNE_SIMPLEXE_BASE(int num_face) const
573                 {
574                 vector<int> retour(4);
575                 switch (num_face) 
576                         {
577                         case 0 : retour[0]=sommets[5];retour[1]=sommets[0];retour[2]=sommets[1];retour[3]=sommets[2];break;
578                         case 1 : retour[0]=sommets[0];retour[1]=sommets[7];retour[2]=sommets[6];retour[3]=sommets[5];break;
579                         case 2 : retour[0]=sommets[3];retour[1]=sommets[0];retour[2]=sommets[4];retour[3]=sommets[5];break;
580                         case 3 : retour[0]=sommets[4];retour[1]=sommets[1];retour[2]=sommets[5];retour[3]=sommets[6];break;
581                         case 4 : retour[0]=sommets[1];retour[1]=sommets[2];retour[2]=sommets[6];retour[3]=sommets[3];break;
582                         case 5 : retour[0]=sommets[2];retour[1]=sommets[3];retour[2]=sommets[7];retour[3]=sommets[0];break;
583         
584                         }
585                 return retour;
586                 }
587 };
588
589 /*********************************************************/
590 /*                                                       */
591 /*           Classe Wrapper_Maille_Hexa20                */
592 /*                                                       */
593 /*********************************************************/
594
595 class Wrapper_Maille_Hexa20 : public Wrapper_Maille
596 {
597 public :
598         inline int DONNE_NBR_FACES() const {return 6;}
599         inline int DONNE_NBR_NOEUDS() const {return 20;}
600         inline int DONNE_PREMIER_NOEUD_DE_FACE(int num_face) const
601                 {
602                 switch (num_face)
603                         {
604                         case 0 : return sommets[0];
605                         case 1 : return sommets[4];
606                         case 2 : return sommets[0];
607                         case 3 : return sommets[1];
608                         case 4 : return sommets[2];
609                         case 5 : return sommets[3];
610                         }
611                 }
612         inline vector<int> DONNE_FACE(int num_face) const
613                 {
614                 vector<int> retour(4);
615                 switch (num_face) 
616                         {
617                         case 0 : retour[0]=sommets[0];retour[1]=sommets[1];retour[2]=sommets[2];retour[3]=sommets[3];break;
618                         case 1 : retour[0]=sommets[4];retour[1]=sommets[5];retour[2]=sommets[6];retour[3]=sommets[7];break;
619                         case 2 : retour[0]=sommets[0];retour[1]=sommets[4];retour[2]=sommets[5];retour[3]=sommets[1];break;
620                         case 3 : retour[0]=sommets[1];retour[1]=sommets[5];retour[2]=sommets[6];retour[3]=sommets[2];break;
621                         case 4 : retour[0]=sommets[2];retour[1]=sommets[6];retour[2]=sommets[7];retour[3]=sommets[3];break;
622                         case 5 : retour[0]=sommets[3];retour[1]=sommets[7];retour[2]=sommets[4];retour[3]=sommets[0];break;
623                         }
624                 return retour;
625                 }
626         inline vector<int> DONNE_SIMPLEXE_BASE(int num_face) const
627                 {
628                 vector<int> retour(4);
629                 switch (num_face) 
630                         {
631                         case 0 : retour[0]=sommets[5];retour[1]=sommets[0];retour[2]=sommets[1];retour[3]=sommets[2];break;
632                         case 1 : retour[0]=sommets[0];retour[1]=sommets[7];retour[2]=sommets[6];retour[3]=sommets[5];break;
633                         case 2 : retour[0]=sommets[3];retour[1]=sommets[0];retour[2]=sommets[4];retour[3]=sommets[5];break;
634                         case 3 : retour[0]=sommets[4];retour[1]=sommets[1];retour[2]=sommets[5];retour[3]=sommets[6];break;
635                         case 4 : retour[0]=sommets[1];retour[1]=sommets[2];retour[2]=sommets[6];retour[3]=sommets[3];break;
636                         case 5 : retour[0]=sommets[2];retour[1]=sommets[3];retour[2]=sommets[7];retour[3]=sommets[0];break;     
637                         }
638                 return retour;
639                 }
640 };
641
642 /*********************************************************/
643 /*                                                       */
644 /*           Classe Wrapper_Maille_Pyra5                 */
645 /*                                                       */
646 /*********************************************************/
647
648 class Wrapper_Maille_Pyra5 : public Wrapper_Maille
649 {
650 public :
651         inline int DONNE_NBR_FACES() const {return 5;}
652         inline int DONNE_NBR_NOEUDS() const {return 5;}
653         inline int DONNE_PREMIER_NOEUD_DE_FACE(int num_face) const
654                 {
655                 switch (num_face)
656                         {
657                         case 0 : return sommets[0];
658                         case 1 : return sommets[0];
659                         case 2 : return sommets[1];
660                         case 3 : return sommets[2];
661                         case 4 : return sommets[3];
662                         }
663                 }
664         inline vector<int> DONNE_FACE(int num_face) const
665                 {
666                 vector<int> retour;
667                 switch (num_face) 
668                         {
669                         case 0 : retour.resize(4);retour[0]=sommets[0];retour[1]=sommets[1];retour[2]=sommets[2];retour[3]=sommets[3];break;
670                         case 1 : retour.resize(3);retour[0]=sommets[0];retour[1]=sommets[4];retour[2]=sommets[1];break;
671                         case 2 : retour.resize(3);retour[0]=sommets[1];retour[1]=sommets[4];retour[2]=sommets[2];break;
672                         case 3 : retour.resize(3);retour[0]=sommets[2];retour[1]=sommets[4];retour[2]=sommets[3];break;
673                         case 4 : retour.resize(3);retour[0]=sommets[3];retour[1]=sommets[4];retour[2]=sommets[0];break;
674                         }
675                 return retour;
676                 }
677
678         inline vector<int> DONNE_SIMPLEXE_BASE(int num_face) const
679                 {
680                 vector<int> retour(4);
681                 switch (num_face) 
682                         {
683                         case 0 : retour[0]=sommets[4];retour[1]=sommets[0];retour[2]=sommets[1];retour[3]=sommets[2];break;
684                         case 1 : retour[0]=sommets[3];retour[1]=sommets[0];retour[2]=sommets[4];retour[3]=sommets[1];break;
685                         case 2 : retour[0]=sommets[0];retour[1]=sommets[1];retour[2]=sommets[4];retour[3]=sommets[2];break;
686                         case 3 : retour[0]=sommets[1];retour[1]=sommets[2];retour[2]=sommets[4];retour[3]=sommets[3];break;
687                         case 4 : retour[0]=sommets[2];retour[1]=sommets[0];retour[2]=sommets[3];retour[3]=sommets[4];break;
688                         }
689                 return retour;
690                 }
691 };
692
693 /*********************************************************/
694 /*                                                       */
695 /*           Classe Wrapper_Maille_Pyra13                */
696 /*                                                       */
697 /*********************************************************/
698
699 class Wrapper_Maille_Pyra13 : public Wrapper_Maille
700 {
701 public :
702         inline int DONNE_NBR_FACES() const {return 5;}
703         inline int DONNE_NBR_NOEUDS() const {return 13;}
704         inline int DONNE_PREMIER_NOEUD_DE_FACE(int num_face) const
705                 {
706                 switch (num_face)
707                         {
708                         case 0 : return sommets[0];
709                         case 1 : return sommets[0];
710                         case 2 : return sommets[1];
711                         case 3 : return sommets[2];
712                         case 4 : return sommets[3];
713                         }
714                 }
715         inline vector<int> DONNE_FACE(int num_face) const
716                 {
717                 vector<int> retour;
718                 switch (num_face) 
719                         {
720                         case 0 : retour.resize(4);retour[0]=sommets[0];retour[1]=sommets[1];retour[2]=sommets[2];retour[3]=sommets[3];break;
721                         case 1 : retour.resize(3);retour[0]=sommets[0];retour[1]=sommets[4];retour[2]=sommets[1];break;
722                         case 2 : retour.resize(3);retour[0]=sommets[1];retour[1]=sommets[4];retour[2]=sommets[2];break;
723                         case 3 : retour.resize(3);retour[0]=sommets[2];retour[1]=sommets[4];retour[2]=sommets[3];break;
724                         case 4 : retour.resize(3);retour[0]=sommets[3];retour[1]=sommets[4];retour[2]=sommets[0];break;
725                         }
726                 return retour;
727                 }
728         inline vector<int> DONNE_SIMPLEXE_BASE(int num_face) const
729                 {
730                 vector<int> retour(4);
731                 switch (num_face) 
732                         {
733                         case 0 : retour[0]=sommets[4];retour[1]=sommets[0];retour[2]=sommets[1];retour[3]=sommets[2];break;
734                         case 1 : retour[0]=sommets[3];retour[1]=sommets[0];retour[2]=sommets[4];retour[3]=sommets[1];break;
735                         case 2 : retour[0]=sommets[0];retour[1]=sommets[1];retour[2]=sommets[4];retour[3]=sommets[2];break;
736                         case 3 : retour[0]=sommets[1];retour[1]=sommets[2];retour[2]=sommets[4];retour[3]=sommets[3];break;
737                         case 4 : retour[0]=sommets[2];retour[1]=sommets[0];retour[2]=sommets[3];retour[3]=sommets[4];break;
738                         }
739                 }
740 };
741
742 /*********************************************************/
743 /*                                                       */
744 /*           Classe Wrapper_Maille_Penta6                */
745 /*                                                       */
746 /*********************************************************/
747
748 class Wrapper_Maille_Penta6 : public Wrapper_Maille
749 {
750 public :
751         inline int DONNE_NBR_FACES() const {return 5;}
752         inline int DONNE_NBR_NOEUDS() const {return 6;}
753         inline int DONNE_PREMIER_NOEUD_DE_FACE(int num_face) const
754                 {
755                 switch (num_face)
756                         {
757                         case 0 : return sommets[0];
758                         case 1 : return sommets[3];
759                         case 2 : return sommets[0];
760                         case 3 : return sommets[1];
761                         case 4 : return sommets[2];
762                         }
763                 }
764         inline vector<int> DONNE_FACE(int num_face) const
765                 {
766                 vector<int> retour;
767                 switch (num_face) 
768                         {
769                         case 0 : retour.resize(3);retour[0]=sommets[0];retour[1]=sommets[1];retour[2]=sommets[2];break;
770                         case 1 : retour.resize(3);retour[0]=sommets[3];retour[1]=sommets[4];retour[2]=sommets[5];break;
771                         case 2 : retour.resize(4);retour[0]=sommets[0];retour[1]=sommets[3];retour[2]=sommets[4];retour[3]=sommets[1];break;
772                         case 3 : retour.resize(4);retour[0]=sommets[1];retour[1]=sommets[4];retour[2]=sommets[5];retour[3]=sommets[2];break;
773                         case 4 : retour.resize(4);retour[0]=sommets[2];retour[1]=sommets[5];retour[2]=sommets[3];retour[3]=sommets[1];break;
774                         }
775                 return retour;
776                 }
777
778         inline vector<int> DONNE_SIMPLEXE_BASE(int num_face) const
779                 {
780                 vector<int> retour(4);
781                 switch (num_face) 
782                         {
783                         case 0 : retour[0]=sommets[3];retour[1]=sommets[0];retour[2]=sommets[1];retour[3]=sommets[2];break;
784                         case 1 : retour[0]=sommets[2];retour[1]=sommets[3];retour[2]=sommets[4];retour[3]=sommets[5];break;
785                         case 2 : retour[0]=sommets[5];retour[1]=sommets[0];retour[2]=sommets[3];retour[3]=sommets[1];break;
786                         case 3 : retour[0]=sommets[0];retour[1]=sommets[1];retour[2]=sommets[4];retour[3]=sommets[2];break;
787                         case 4 : retour[0]=sommets[1];retour[1]=sommets[2];retour[2]=sommets[5];retour[3]=sommets[0];break;
788                         }
789                 return retour;
790                 }
791 };
792
793 /*********************************************************/
794 /*                                                       */
795 /*           Classe Wrapper_Maille_Penta15               */
796 /*                                                       */
797 /*********************************************************/
798
799 class Wrapper_Maille_Penta15 : public Wrapper_Maille
800 {
801 public :
802         inline int DONNE_NBR_FACES() const {return 5;}
803         inline int DONNE_NBR_NOEUDS() const {return 15;}
804         inline int DONNE_PREMIER_NOEUD_DE_FACE(int num_face) const
805                 {
806                 switch (num_face)
807                         {
808                         case 0 : return sommets[0];
809                         case 1 : return sommets[3];
810                         case 2 : return sommets[0];
811                         case 3 : return sommets[1];
812                         case 4 : return sommets[2];
813                         }
814                 }
815         inline vector<int> DONNE_FACE(int num_face) const
816                 {
817                 vector<int> retour;
818                 switch (num_face) 
819                         {
820                         case 0 : retour.resize(3);retour[0]=sommets[0];retour[1]=sommets[1];retour[2]=sommets[2];break;
821                         case 1 : retour.resize(3);retour[0]=sommets[3];retour[1]=sommets[4];retour[2]=sommets[5];break;
822                         case 2 : retour.resize(4);retour[0]=sommets[0];retour[1]=sommets[3];retour[2]=sommets[4];retour[3]=sommets[1];break;
823                         case 3 : retour.resize(4);retour[0]=sommets[1];retour[1]=sommets[4];retour[2]=sommets[5];retour[3]=sommets[2];break;
824                         case 4 : retour.resize(4);retour[0]=sommets[2];retour[1]=sommets[5];retour[2]=sommets[3];retour[3]=sommets[1];break;
825                         }
826                 return retour;
827                 }
828
829         inline vector<int> DONNE_SIMPLEXE_BASE(int num_face) const
830                 {
831                 vector<int> retour(4);
832                 switch (num_face) 
833                         {
834                         case 0 : retour[0]=sommets[3];retour[1]=sommets[0];retour[2]=sommets[1];retour[3]=sommets[2];break;
835                         case 1 : retour[0]=sommets[2];retour[1]=sommets[3];retour[2]=sommets[4];retour[3]=sommets[5];break;
836                         case 2 : retour[0]=sommets[5];retour[1]=sommets[0];retour[2]=sommets[3];retour[3]=sommets[1];break;
837                         case 3 : retour[0]=sommets[0];retour[1]=sommets[1];retour[2]=sommets[4];retour[3]=sommets[2];break;
838                         case 4 : retour[0]=sommets[1];retour[1]=sommets[2];retour[2]=sommets[5];retour[3]=sommets[0];break;
839                         }
840                 return retour;
841                 }
842 };
843
844 /*********************************************************/
845 /*                                                       */
846 /*            Classe Type_Wrapper_Maille                 */
847 /*                                                       */
848 /*********************************************************/
849
850 Type_Wrapper_Maille::~Type_Wrapper_Maille()
851         {
852         // delete contenu[MED_SEG2   ];
853         // delete contenu[MED_SEG3   ];
854         delete contenu[MED_TRIA3  ];
855         delete contenu[MED_TRIA6  ];
856         delete contenu[MED_QUAD4  ];
857         delete contenu[MED_QUAD8  ];
858         delete contenu[MED_TETRA4 ];
859         delete contenu[MED_TETRA10];
860         delete contenu[MED_HEXA8  ];
861         delete contenu[MED_HEXA20 ];
862         delete contenu[MED_PYRA5  ];
863         delete contenu[MED_PYRA13 ];
864         delete contenu[MED_PENTA6 ];
865         delete contenu[MED_PENTA15];
866         }
867
868 Type_Wrapper_Maille::Type_Wrapper_Maille()
869         {
870         // contenu[MED_SEG2   ]= new Wrapper_Maille_Seg2    ();
871         // contenu[MED_SEG3   ]= new Wrapper_Maille_Seg3    ();
872         contenu[MED_TRIA3  ]= new Wrapper_Maille_Tria3   ();
873         contenu[MED_TRIA6  ]= new Wrapper_Maille_Tria6   ();
874         contenu[MED_QUAD4  ]= new Wrapper_Maille_Quad4   ();
875         contenu[MED_QUAD8  ]= new Wrapper_Maille_Quad8   ();
876         contenu[MED_TETRA4 ]= new Wrapper_Maille_Tetra4  ();
877         contenu[MED_TETRA10]= new Wrapper_Maille_Tetra10 ();
878         contenu[MED_HEXA8  ]= new Wrapper_Maille_Hexa8   ();
879         contenu[MED_HEXA20 ]= new Wrapper_Maille_Hexa20  ();
880         contenu[MED_PYRA5  ]= new Wrapper_Maille_Pyra5   ();
881         contenu[MED_PYRA13 ]= new Wrapper_Maille_Pyra13  ();
882         contenu[MED_PENTA6 ]= new Wrapper_Maille_Penta6  ();
883         contenu[MED_PENTA15]= new Wrapper_Maille_Penta15 ();
884         }
885
886
887 #endif