Salome HOME
update after merging trhe branches CEA_V3_0_x, OCC_V3_1_0_a1_x, and the main
[modules/med.git] / src / MEDMEM / MEDMEM_CellModel.cxx
1 /*
2  File MEDMEM_CellModel.cxx
3  $Header$
4 */
5
6 #include "MEDMEM_CellModel.hxx"
7
8 using namespace std;
9 using namespace MEDMEM;
10 using namespace MED_EN;
11
12 CELLMODEL::CELLMODEL(medGeometryElement t)
13 {
14   // init first all to nothing
15   _dimension=0 ;
16   _numberOfNodes=0 ;
17   _numberOfVertexes=0 ;
18   _numberOfConstituentsDimension=0 ;
19   _numberOfConstituents=(int*)NULL ;
20   _numberOfNodeOfEachConstituent=(int**)NULL ;
21   _constituents=(int***)NULL ; 
22   //_numberOfonstituentsType=(int*)NULL ;
23   _constituentsType=(medGeometryElement**)NULL ;
24   
25   MESSAGE("CELLMODEL : constructeur pour le type " << t);
26   switch (t)
27     {
28     case MED_POINT1  : {
29       _name="MED_POINT1";
30       _type=t;
31       _dimension=0;
32       _numberOfVertexes=1;
33       _numberOfNodes=1;
34       // nothing else : POINT are none constituent
35       break;
36     }
37     case MED_SEG2    : {
38       _name="MED_SEG2" ;
39       _type=t;
40       _dimension=1;
41       _numberOfVertexes=2;
42       _numberOfNodes=2;
43       // constituent are POINT1 and we have no need to define _constituents vector
44       _numberOfConstituentsDimension=1 ;
45       _numberOfConstituents=new int[1] ;
46       _numberOfConstituents[0]=2 ;
47       _numberOfNodeOfEachConstituent=new int*[1] ;
48       _numberOfNodeOfEachConstituent[0]=new int[2] ;
49       _numberOfNodeOfEachConstituent[0][0]=1 ;
50       _numberOfNodeOfEachConstituent[0][1]=1 ;
51
52       _constituents = new int**[1] ;
53       _constituents[0] = new int*[2] ;
54       _constituents[0][0] = new int[1] ;
55       _constituents[0][0][0] = 1 ;
56       _constituents[0][1] = new int[1] ;
57       _constituents[0][1][0] = 2 ;
58
59       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[2] ;
60       tmpConstituentsType1[0] = MED_POINT1 ;
61       tmpConstituentsType1[1] = MED_POINT1 ;
62       _constituentsType = new medGeometryElement*[1] ;
63       _constituentsType[0]=tmpConstituentsType1 ;
64       break;
65     }
66     case MED_SEG3    : {
67       _name="MED_SEG3" ;
68       _type=t;
69       _dimension=1;
70       _numberOfVertexes=2;
71       _numberOfNodes=3;
72       // constituent are POINT1 and we have no need to define _constituents vector
73       _numberOfConstituentsDimension=1 ;
74       _numberOfConstituents=new int[1] ;
75       _numberOfConstituents[0]=3 ;
76       _numberOfNodeOfEachConstituent=new int*[1] ;
77       _numberOfNodeOfEachConstituent[0]=new int[3] ;
78       _numberOfNodeOfEachConstituent[0][0]=1 ;
79       _numberOfNodeOfEachConstituent[0][1]=1 ;
80       _numberOfNodeOfEachConstituent[0][2]=1 ;
81
82       _constituents = new int**[1] ;
83       _constituents[0] = new int*[3] ;
84       _constituents[0][0] = new int[1] ;
85       _constituents[0][0][0] = 1 ;
86       _constituents[0][1] = new int[1] ;
87       _constituents[0][1][0] = 2 ;
88       _constituents[0][2] = new int[1] ;
89       _constituents[0][2][0] = 3 ;
90
91       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[3] ;
92       tmpConstituentsType1[0] = MED_POINT1 ;
93       tmpConstituentsType1[1] = MED_POINT1 ;
94       tmpConstituentsType1[2] = MED_POINT1 ;
95       _constituentsType = new medGeometryElement*[1] ;
96       _constituentsType[0]=tmpConstituentsType1 ;
97       break;
98     }
99     case MED_TRIA3   : {
100       _name="MED_TRIA3" ;
101       _type=t;
102       _dimension=2;
103       _numberOfVertexes=3;
104       _numberOfNodes=3;
105
106       _numberOfConstituentsDimension=1 ;
107       _numberOfConstituents=new int[1] ;
108       _numberOfConstituents[0]=3 ;
109       _numberOfNodeOfEachConstituent=new int*[1] ;
110       _numberOfNodeOfEachConstituent[0]=new int[3] ;
111       _numberOfNodeOfEachConstituent[0][0]=2 ;
112       _numberOfNodeOfEachConstituent[0][1]=2 ;
113       _numberOfNodeOfEachConstituent[0][2]=2 ;
114
115       int* _edge1=new int[2];
116       _edge1[0]=1;
117       _edge1[1]=2;
118       int* _edge2=new int[2];
119       _edge2[0]=2;
120       _edge2[1]=3;
121       int* _edge3=new int[2];
122       _edge3[0]=3;
123       _edge3[1]=1;
124       int ** tmpConstituents1 = new int*[3];
125       tmpConstituents1[0]=_edge1 ;
126       tmpConstituents1[1]=_edge2 ;
127       tmpConstituents1[2]=_edge3 ;
128       _constituents = new int**[1] ;
129       _constituents[0]=tmpConstituents1 ;
130
131       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[3] ;
132       tmpConstituentsType1[0] = MED_SEG2 ;
133       tmpConstituentsType1[1] = MED_SEG2 ;
134       tmpConstituentsType1[2] = MED_SEG2 ;
135 //        medGeometryElement * tmpConstituentsType2 = new medGeometryElement[3] ;
136 //        tmpConstituentsType2[0] = MED_POINT1 ;
137 //        tmpConstituentsType2[1] = MED_POINT1 ;
138 //        tmpConstituentsType2[2] = MED_POINT1 ;
139 //        _constituentsType = new medGeometryElement*[2] ;
140       _constituentsType = new medGeometryElement*[1] ;
141       _constituentsType[0]=tmpConstituentsType1 ;
142 //        _constituentsType[1]=tmpConstituentsType2 ;
143       // Well, point are defined, but could not be acces because we have 
144       // only 1 numberOfConstituentsDimension !
145
146       break;
147     }
148     case MED_TRIA6   : {
149       _name="MED_TRIA6" ;
150       _type=t;
151       _dimension=2;
152       _numberOfVertexes=3;
153       _numberOfNodes=6;
154       _numberOfConstituentsDimension=1 ;
155       _numberOfConstituents=new int[1] ;
156       _numberOfConstituents[0]=3 ;
157       _numberOfNodeOfEachConstituent=new int*[1] ;
158       _numberOfNodeOfEachConstituent[0]=new int[3] ;
159       _numberOfNodeOfEachConstituent[0][0]=3 ;
160       _numberOfNodeOfEachConstituent[0][1]=3 ;
161       _numberOfNodeOfEachConstituent[0][2]=3 ;
162
163       int* _edge1=new int[3];
164       _edge1[0]=1;
165       _edge1[1]=2;
166       _edge1[2]=4;
167       int* _edge2=new int[3];
168       _edge2[0]=2;
169       _edge2[1]=3;
170       _edge2[2]=5;
171       int* _edge3=new int[3];
172       _edge3[0]=3;
173       _edge3[1]=1;
174       _edge3[2]=6;
175       int ** tmpConstituents1 = new int*[3];
176       tmpConstituents1[0]=_edge1 ;
177       tmpConstituents1[1]=_edge2 ;
178       tmpConstituents1[2]=_edge3 ;
179       _constituents = new int**[1] ;
180       _constituents[0]=tmpConstituents1 ;
181       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[3] ;
182       tmpConstituentsType1[0] = MED_SEG3 ;
183       tmpConstituentsType1[1] = MED_SEG3 ;
184       tmpConstituentsType1[2] = MED_SEG3 ;
185 //        medGeometryElement * tmpConstituentsType2 = new medGeometryElement[6] ;
186 //        tmpConstituentsType2[0] = MED_POINT1 ;
187 //        tmpConstituentsType2[1] = MED_POINT1 ;
188 //        tmpConstituentsType2[2] = MED_POINT1 ;
189 //        tmpConstituentsType2[3] = MED_POINT1 ;
190 //        tmpConstituentsType2[4] = MED_POINT1 ;
191 //        tmpConstituentsType2[5] = MED_POINT1 ;
192 //        _constituentsType = new medGeometryElement*[2] ;
193       _constituentsType = new medGeometryElement*[1] ;
194       _constituentsType[0]=tmpConstituentsType1 ;
195 //        _constituentsType[1]=tmpConstituentsType2 ;
196       // Well, point are defined, but could not be acces because we have 
197       // only 1 numberOfConstituentsDimension !
198
199       break;
200     }
201     case MED_QUAD4   : {
202       _name="MED_QUAD4" ;
203       _type=t;
204       _dimension=2;
205       _numberOfVertexes=4;
206       _numberOfNodes=4;
207       _numberOfConstituentsDimension=1 ;
208       _numberOfConstituents=new int[1] ;
209       _numberOfConstituents[0]=4 ;
210       _numberOfNodeOfEachConstituent=new int*[1] ;
211       _numberOfNodeOfEachConstituent[0]=new int[4] ;
212       _numberOfNodeOfEachConstituent[0][0]=2 ;
213       _numberOfNodeOfEachConstituent[0][1]=2 ;
214       _numberOfNodeOfEachConstituent[0][2]=2 ;
215       _numberOfNodeOfEachConstituent[0][3]=2 ;
216
217       int* _edge1=new int[2];
218       _edge1[0]=1;
219       _edge1[1]=2;
220       int* _edge2=new int[2];
221       _edge2[0]=2;
222       _edge2[1]=3;
223       int* _edge3=new int[2];
224       _edge3[0]=3;
225       _edge3[1]=4;
226       int* _edge4=new int[2];
227       _edge4[0]=4;
228       _edge4[1]=1;
229       int ** tmpConstituents1 = new int*[4];
230       tmpConstituents1[0]=_edge1 ;
231       tmpConstituents1[1]=_edge2 ;
232       tmpConstituents1[2]=_edge3 ;
233       tmpConstituents1[3]=_edge4 ;
234       _constituents = new int**[1] ;
235       _constituents[0]=tmpConstituents1 ;
236       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
237       tmpConstituentsType1[0] = MED_SEG2 ;
238       tmpConstituentsType1[1] = MED_SEG2 ;
239       tmpConstituentsType1[2] = MED_SEG2 ;
240       tmpConstituentsType1[3] = MED_SEG2 ;
241 //        medGeometryElement * tmpConstituentsType2 = new medGeometryElement[4] ;
242 //        tmpConstituentsType2[0] = MED_POINT1 ;
243 //        tmpConstituentsType2[1] = MED_POINT1 ;
244 //        tmpConstituentsType2[2] = MED_POINT1 ;
245 //        tmpConstituentsType2[3] = MED_POINT1 ;
246 //        _constituentsType = new medGeometryElement*[2] ;
247       _constituentsType = new medGeometryElement*[1] ;
248       _constituentsType[0]=tmpConstituentsType1 ;
249 //        _constituentsType[1]=tmpConstituentsType2 ;
250       // Well, point are defined, but could not be acces because we have 
251       // only 1 numberOfConstituentsDimension !
252
253       break;
254     }
255     case MED_QUAD8   : {
256       _name="MED_QUAD8" ;
257       _type=t;
258       _dimension=2;
259       _numberOfVertexes=4;
260       _numberOfNodes=8;
261       _numberOfConstituentsDimension=1 ;
262       _numberOfConstituents=new int[1] ;
263       _numberOfConstituents[0]=4 ;
264       _numberOfNodeOfEachConstituent=new int*[1] ;
265       _numberOfNodeOfEachConstituent[0]=new int[4] ;
266       _numberOfNodeOfEachConstituent[0][0]=3 ;
267       _numberOfNodeOfEachConstituent[0][1]=3 ;
268       _numberOfNodeOfEachConstituent[0][2]=3 ;
269       _numberOfNodeOfEachConstituent[0][3]=3 ;
270
271       int* _edge1=new int[3];
272       _edge1[0]=1;
273       _edge1[1]=2;
274       _edge1[2]=5;
275       int* _edge2=new int[3];
276       _edge2[0]=2;
277       _edge2[1]=3;
278       _edge2[2]=6;
279       int* _edge3=new int[3];
280       _edge3[0]=3;
281       _edge3[1]=4;
282       _edge3[2]=7;
283       int* _edge4=new int[3];
284       _edge4[0]=4;
285       _edge4[1]=1;
286       _edge4[2]=8;
287       int ** tmpConstituents1 = new int*[4];
288       tmpConstituents1[0]=_edge1 ;
289       tmpConstituents1[1]=_edge2 ;
290       tmpConstituents1[2]=_edge3 ;
291       tmpConstituents1[3]=_edge4 ;
292       _constituents = new int**[1] ;
293       _constituents[0]=tmpConstituents1 ;
294       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
295       tmpConstituentsType1[0] = MED_SEG3 ;
296       tmpConstituentsType1[1] = MED_SEG3 ;
297       tmpConstituentsType1[2] = MED_SEG3 ;
298       tmpConstituentsType1[3] = MED_SEG3 ;
299 //        medGeometryElement * tmpConstituentsType2 = new medGeometryElement[8] ;
300 //        tmpConstituentsType2[0] = MED_POINT1 ;
301 //        tmpConstituentsType2[1] = MED_POINT1 ;
302 //        tmpConstituentsType2[2] = MED_POINT1 ;
303 //        tmpConstituentsType2[3] = MED_POINT1 ;
304 //        tmpConstituentsType2[4] = MED_POINT1 ;
305 //        tmpConstituentsType2[5] = MED_POINT1 ;
306 //        tmpConstituentsType2[6] = MED_POINT1 ;
307 //        tmpConstituentsType2[7] = MED_POINT1 ;
308 //        _constituentsType = new medGeometryElement*[2] ;
309       _constituentsType = new medGeometryElement*[1] ;
310       _constituentsType[0]=tmpConstituentsType1 ;
311 //        _constituentsType[1]=tmpConstituentsType2 ;
312       // Well, point are defined, but could not be acces because we have 
313       // only 1 numberOfConstituentsDimension !
314
315       break;
316     }
317     case MED_TETRA4  : {
318       _name="MED_TETRA4" ;
319       _type=t;
320       _dimension=3;
321       _numberOfVertexes=4;
322       _numberOfNodes=4;
323       _numberOfConstituentsDimension=2 ;
324       _numberOfConstituents=new int[2] ;
325       _numberOfConstituents[0]=4 ;
326       _numberOfConstituents[1]=6 ;
327       _numberOfNodeOfEachConstituent=new int*[2] ;
328       _numberOfNodeOfEachConstituent[0]=new int[4] ;
329       _numberOfNodeOfEachConstituent[0][0]=3 ;
330       _numberOfNodeOfEachConstituent[0][1]=3 ;
331       _numberOfNodeOfEachConstituent[0][2]=3 ;
332       _numberOfNodeOfEachConstituent[0][3]=3 ;
333       _numberOfNodeOfEachConstituent[1]=new int[6] ;
334       _numberOfNodeOfEachConstituent[1][0]=2 ;
335       _numberOfNodeOfEachConstituent[1][1]=2 ;
336       _numberOfNodeOfEachConstituent[1][2]=2 ;
337       _numberOfNodeOfEachConstituent[1][3]=2 ;
338       _numberOfNodeOfEachConstituent[1][4]=2 ;
339       _numberOfNodeOfEachConstituent[1][5]=2 ;
340
341       int* _face1=new int[3];
342       _face1[0]=1;
343       _face1[1]=2;
344       _face1[2]=3;
345       int* _face2=new int[3];
346       _face2[0]=1;
347       _face2[1]=4;
348       _face2[2]=2;
349       int* _face3=new int[3];
350       _face3[0]=2;
351       _face3[1]=4;
352       _face3[2]=3;
353       int* _face4=new int[3];
354       _face4[0]=3;
355       _face4[1]=4;
356       _face4[2]=1;
357       int* _edge1=new int[2];
358       _edge1[0]=1;
359       _edge1[1]=2;
360       int* _edge2=new int[2];
361       _edge2[0]=2;
362       _edge2[1]=3;
363       int* _edge3=new int[2];
364       _edge3[0]=3;
365       _edge3[1]=1;
366       int* _edge4=new int[2];
367       _edge4[0]=1;
368       _edge4[1]=4;
369       int* _edge5=new int[2];
370       _edge5[0]=2;
371       _edge5[1]=4;
372       int* _edge6=new int[2];
373       _edge6[0]=3;
374       _edge6[1]=4;
375       int ** tmpConstituents1 = new int*[4];
376       tmpConstituents1[0]=_face1 ;
377       tmpConstituents1[1]=_face2 ;
378       tmpConstituents1[2]=_face3 ;
379       tmpConstituents1[3]=_face4 ;
380       int ** tmpConstituents2 = new int*[6];
381       tmpConstituents2[0]=_edge1 ;
382       tmpConstituents2[1]=_edge2 ;
383       tmpConstituents2[2]=_edge3 ;
384       tmpConstituents2[3]=_edge4 ;
385       tmpConstituents2[4]=_edge5 ;
386       tmpConstituents2[5]=_edge6 ;
387       _constituents = new int**[2] ;
388       _constituents[0]=tmpConstituents1 ;
389       _constituents[1]=tmpConstituents2 ;
390       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
391       tmpConstituentsType1[0] = MED_TRIA3 ;
392       tmpConstituentsType1[1] = MED_TRIA3 ;
393       tmpConstituentsType1[2] = MED_TRIA3 ;
394       tmpConstituentsType1[3] = MED_TRIA3 ;
395       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[6] ;
396       tmpConstituentsType2[0] = MED_SEG2 ;
397       tmpConstituentsType2[1] = MED_SEG2 ;
398       tmpConstituentsType2[2] = MED_SEG2 ;
399       tmpConstituentsType2[3] = MED_SEG2 ;
400       tmpConstituentsType2[4] = MED_SEG2 ;
401       tmpConstituentsType2[5] = MED_SEG2 ;
402       _constituentsType = new medGeometryElement*[2] ;
403       _constituentsType[0]=tmpConstituentsType1 ;
404       _constituentsType[1]=tmpConstituentsType2 ;
405       break;
406     }
407     case MED_TETRA10 : {
408       _name="MED_TETRA10" ;
409       _type=t;
410       _dimension=3;
411       _numberOfVertexes=4;
412       _numberOfNodes=10;
413       _numberOfConstituentsDimension=2 ;
414       _numberOfConstituents=new int[2] ;
415       _numberOfConstituents[0]=4 ;
416       _numberOfConstituents[1]=6 ;
417       _numberOfNodeOfEachConstituent=new int*[2] ;
418       _numberOfNodeOfEachConstituent[0]=new int[4] ;
419       _numberOfNodeOfEachConstituent[0][0]=6 ;
420       _numberOfNodeOfEachConstituent[0][1]=6 ;
421       _numberOfNodeOfEachConstituent[0][2]=6 ;
422       _numberOfNodeOfEachConstituent[0][3]=6 ;
423       _numberOfNodeOfEachConstituent[1]=new int[6] ;
424       _numberOfNodeOfEachConstituent[1][0]=3 ;
425       _numberOfNodeOfEachConstituent[1][1]=3 ;
426       _numberOfNodeOfEachConstituent[1][2]=3 ;
427       _numberOfNodeOfEachConstituent[1][3]=3 ;
428       _numberOfNodeOfEachConstituent[1][4]=3 ;
429       _numberOfNodeOfEachConstituent[1][5]=3 ;
430
431       int* _face1=new int[6];
432       _face1[0]=1;
433       _face1[1]=2;
434       _face1[2]=3;
435       _face1[3]=5;
436       _face1[4]=6;
437       _face1[5]=7;
438       int* _face2=new int[6];
439       _face2[0]=1;
440       _face2[1]=4;
441       _face2[2]=2;
442       _face2[3]=8;
443       _face2[4]=9;
444       _face2[5]=5;
445       int* _face3=new int[6];
446       _face3[0]=2;
447       _face3[1]=4;
448       _face3[2]=3;
449       _face3[3]=9;
450       _face3[4]=10;
451       _face3[5]=6;
452       int* _face4=new int[6];
453       _face4[0]=3;
454       _face4[1]=4;
455       _face4[2]=1;
456       _face4[3]=10;
457       _face4[4]=8;
458       _face4[5]=7;
459       int* _edge1=new int[3];
460       _edge1[0]=1;
461       _edge1[1]=2;
462       _edge1[2]=5;
463       int* _edge2=new int[3];
464       _edge2[0]=2;
465       _edge2[1]=3;
466       _edge2[2]=6;
467       int* _edge3=new int[3];
468       _edge3[0]=3;
469       _edge3[1]=1;
470       _edge3[2]=7;
471       int* _edge4=new int[3];
472       _edge4[0]=1;
473       _edge4[1]=4;
474       _edge4[2]=8;
475       int* _edge5=new int[3];
476       _edge5[0]=2;
477       _edge5[1]=4;
478       _edge5[2]=9;
479       int* _edge6=new int[3];
480       _edge6[0]=3;
481       _edge6[1]=4;
482       _edge6[2]=10;
483       int ** tmpConstituents1 = new int*[4];
484       tmpConstituents1[0]=_face1 ;
485       tmpConstituents1[1]=_face2 ;
486       tmpConstituents1[2]=_face3 ;
487       tmpConstituents1[3]=_face4 ;
488       int ** tmpConstituents2 = new int*[6];
489       tmpConstituents2[0]=_edge1 ;
490       tmpConstituents2[1]=_edge2 ;
491       tmpConstituents2[2]=_edge3 ;
492       tmpConstituents2[3]=_edge4 ;
493       tmpConstituents2[4]=_edge5 ;
494       tmpConstituents2[5]=_edge6 ;
495       _constituents = new int**[2] ;
496       _constituents[0]=tmpConstituents1 ;
497       _constituents[1]=tmpConstituents2 ;
498       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
499       tmpConstituentsType1[0] = MED_TRIA6 ;
500       tmpConstituentsType1[1] = MED_TRIA6 ;
501       tmpConstituentsType1[2] = MED_TRIA6 ;
502       tmpConstituentsType1[3] = MED_TRIA6 ;
503       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[6] ;
504       tmpConstituentsType2[0] = MED_SEG3 ;
505       tmpConstituentsType2[1] = MED_SEG3 ;
506       tmpConstituentsType2[2] = MED_SEG3 ;
507       tmpConstituentsType2[3] = MED_SEG3 ;
508       tmpConstituentsType2[4] = MED_SEG3 ;
509       tmpConstituentsType2[5] = MED_SEG3 ;
510       _constituentsType = new medGeometryElement*[2] ;
511       _constituentsType[0]=tmpConstituentsType1 ;
512       _constituentsType[1]=tmpConstituentsType2 ;
513     break;
514     }
515     case MED_HEXA8   : {
516       _name="MED_HEXA8" ;
517       _type=t;
518       _dimension=3;
519       _numberOfVertexes=8;
520       _numberOfNodes=8;
521       _numberOfConstituentsDimension=2 ;
522       _numberOfConstituents=new int[2] ;
523       _numberOfConstituents[0]=6 ;
524       _numberOfConstituents[1]=12 ;
525       _numberOfNodeOfEachConstituent=new int*[2] ;
526       _numberOfNodeOfEachConstituent[0]=new int[6] ;
527       _numberOfNodeOfEachConstituent[0][0]=4 ;
528       _numberOfNodeOfEachConstituent[0][1]=4 ;
529       _numberOfNodeOfEachConstituent[0][2]=4 ;
530       _numberOfNodeOfEachConstituent[0][3]=4 ;
531       _numberOfNodeOfEachConstituent[0][4]=4 ;
532       _numberOfNodeOfEachConstituent[0][5]=4 ;
533       _numberOfNodeOfEachConstituent[1]=new int[12] ;
534       _numberOfNodeOfEachConstituent[1][0]=2 ;
535       _numberOfNodeOfEachConstituent[1][1]=2 ;
536       _numberOfNodeOfEachConstituent[1][2]=2 ;
537       _numberOfNodeOfEachConstituent[1][3]=2 ;
538       _numberOfNodeOfEachConstituent[1][4]=2 ;
539       _numberOfNodeOfEachConstituent[1][5]=2 ;
540       _numberOfNodeOfEachConstituent[1][6]=2 ;
541       _numberOfNodeOfEachConstituent[1][7]=2 ;
542       _numberOfNodeOfEachConstituent[1][8]=2 ;
543       _numberOfNodeOfEachConstituent[1][9]=2 ;
544       _numberOfNodeOfEachConstituent[1][10]=2 ;
545       _numberOfNodeOfEachConstituent[1][11]=2 ;
546
547       int* _edge1=new int[2];
548       _edge1[0]=1;
549       _edge1[1]=2;
550       int* _edge2=new int[2];
551       _edge2[0]=2;
552       _edge2[1]=3;
553       int* _edge3=new int[2];
554       _edge3[0]=3;
555       _edge3[1]=4;
556       int* _edge4=new int[2];
557       _edge4[0]=4;
558       _edge4[1]=1;
559       int* _edge5=new int[2];
560       _edge5[0]=5;
561       _edge5[1]=6;
562       int* _edge6=new int[2];
563       _edge6[0]=6;
564       _edge6[1]=7;
565       int* _edge7=new int[2];
566       _edge7[0]=7;
567       _edge7[1]=8;
568       int* _edge8=new int[2];
569       _edge8[0]=8;
570       _edge8[1]=5;
571       int* _edge9=new int[2];
572       _edge9[0]=1;
573       _edge9[1]=5;
574       int* _edge10=new int[2];
575       _edge10[0]=2;
576       _edge10[1]=6;
577       int* _edge11=new int[2];
578       _edge11[0]=3;
579       _edge11[1]=7;
580       int* _edge12=new int[2];
581       _edge12[0]=4;
582       _edge12[1]=8;
583       int* _face1=new int[4];
584       _face1[0]=1;
585       _face1[1]=2;
586       _face1[2]=3;
587       _face1[3]=4;
588       int* _face2=new int[4];
589       _face2[0]=5;
590       _face2[1]=8;
591       _face2[2]=7;
592       _face2[3]=6;
593       int* _face3=new int[4];
594       _face3[0]=1;
595       _face3[1]=5;
596       _face3[2]=6;
597       _face3[3]=2;
598       int* _face4=new int[4];
599       _face4[0]=2;
600       _face4[1]=6;
601       _face4[2]=7;
602       _face4[3]=3;
603       int* _face5=new int[4];
604       _face5[0]=3;
605       _face5[1]=7;
606       _face5[2]=8;
607       _face5[3]=4;
608      int* _face6=new int[4];
609       _face6[0]=4;
610       _face6[1]=8;
611       _face6[2]=5;
612       _face6[3]=1;
613       int ** tmpConstituents1 = new int*[6];
614       tmpConstituents1[0]=_face1 ;
615       tmpConstituents1[1]=_face2 ;
616       tmpConstituents1[2]=_face3 ;
617       tmpConstituents1[3]=_face4 ;
618       tmpConstituents1[4]=_face5 ;
619       tmpConstituents1[5]=_face6 ;
620       int ** tmpConstituents2 = new int*[12];
621       tmpConstituents2[0]=_edge1 ;
622       tmpConstituents2[1]=_edge2 ;
623       tmpConstituents2[2]=_edge3 ;
624       tmpConstituents2[3]=_edge4 ;
625       tmpConstituents2[4]=_edge5 ;
626       tmpConstituents2[5]=_edge6 ;
627       tmpConstituents2[6]=_edge7 ;
628       tmpConstituents2[7]=_edge8 ;
629       tmpConstituents2[8]=_edge9 ;
630       tmpConstituents2[9]=_edge10;
631       tmpConstituents2[10]=_edge11;
632       tmpConstituents2[11]=_edge12;
633       _constituents = new int**[2] ;
634       _constituents[0]=tmpConstituents1 ;
635       _constituents[1]=tmpConstituents2 ;
636       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[6] ;
637       tmpConstituentsType1[0] = MED_QUAD4 ;
638       tmpConstituentsType1[1] = MED_QUAD4 ;
639       tmpConstituentsType1[2] = MED_QUAD4 ;
640       tmpConstituentsType1[3] = MED_QUAD4 ;
641       tmpConstituentsType1[4] = MED_QUAD4 ;
642       tmpConstituentsType1[5] = MED_QUAD4 ;
643       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[12] ;
644       tmpConstituentsType2[0] = MED_SEG2 ;
645       tmpConstituentsType2[1] = MED_SEG2 ;
646       tmpConstituentsType2[2] = MED_SEG2 ;
647       tmpConstituentsType2[3] = MED_SEG2 ;
648       tmpConstituentsType2[4] = MED_SEG2 ;
649       tmpConstituentsType2[5] = MED_SEG2 ;
650       tmpConstituentsType2[6] = MED_SEG2 ;
651       tmpConstituentsType2[7] = MED_SEG2 ;
652       tmpConstituentsType2[8] = MED_SEG2 ;
653       tmpConstituentsType2[9] = MED_SEG2 ;
654       tmpConstituentsType2[10] = MED_SEG2 ;
655       tmpConstituentsType2[11] = MED_SEG2 ;
656       _constituentsType = new medGeometryElement*[2] ;
657       _constituentsType[0]=tmpConstituentsType1 ;
658       _constituentsType[1]=tmpConstituentsType2 ;
659       break;
660     }
661     case MED_HEXA20  : {
662       _name="MED_HEXA20" ;
663       _type=t;
664       _dimension=3;
665       _numberOfVertexes=8;
666       _numberOfNodes=20;
667       _numberOfConstituentsDimension=2 ;
668       _numberOfConstituents=new int[2] ;
669       _numberOfConstituents[0]=6 ;
670       _numberOfConstituents[1]=12 ;
671       _numberOfNodeOfEachConstituent=new int*[2] ;
672       _numberOfNodeOfEachConstituent[0]=new int[6] ;
673       _numberOfNodeOfEachConstituent[0][0]=8 ;
674       _numberOfNodeOfEachConstituent[0][1]=8 ;
675       _numberOfNodeOfEachConstituent[0][2]=8 ;
676       _numberOfNodeOfEachConstituent[0][3]=8 ;
677       _numberOfNodeOfEachConstituent[0][4]=8 ;
678       _numberOfNodeOfEachConstituent[0][5]=8 ;
679       _numberOfNodeOfEachConstituent[1]=new int[12] ;
680       _numberOfNodeOfEachConstituent[1][0]=3 ;
681       _numberOfNodeOfEachConstituent[1][1]=3 ;
682       _numberOfNodeOfEachConstituent[1][2]=3 ;
683       _numberOfNodeOfEachConstituent[1][3]=3 ;
684       _numberOfNodeOfEachConstituent[1][4]=3 ;
685       _numberOfNodeOfEachConstituent[1][5]=3 ;
686       _numberOfNodeOfEachConstituent[1][6]=3 ;
687       _numberOfNodeOfEachConstituent[1][7]=3 ;
688       _numberOfNodeOfEachConstituent[1][8]=3 ;
689       _numberOfNodeOfEachConstituent[1][9]=3 ;
690       _numberOfNodeOfEachConstituent[1][10]=3 ;
691       _numberOfNodeOfEachConstituent[1][11]=3 ;
692
693       int* _edge1=new int[3];
694       _edge1[0]=1;
695       _edge1[1]=2;
696       _edge1[2]=9;
697       int* _edge2=new int[3];
698       _edge2[0]=2;
699       _edge2[1]=3;
700       _edge2[2]=10;
701       int* _edge3=new int[3];
702       _edge3[0]=3;
703       _edge3[1]=4;
704       _edge3[2]=11;
705       int* _edge4=new int[3];
706       _edge4[0]=4;
707       _edge4[1]=1;
708       _edge4[2]=12;
709       int* _edge5=new int[3];
710       _edge5[0]=5;
711       _edge5[1]=6;
712       _edge5[2]=13;
713       int* _edge6=new int[3];
714       _edge6[0]=6;
715       _edge6[1]=7;
716       _edge6[2]=14;
717       int* _edge7=new int[3];
718       _edge7[0]=7;
719       _edge7[1]=8;
720       _edge7[2]=15;
721       int* _edge8=new int[3];
722       _edge8[0]=8;
723       _edge8[1]=5;
724       _edge8[2]=16;
725       int* _edge9=new int[3];
726       _edge9[0]=1;
727       _edge9[1]=5;
728       _edge9[2]=17;
729       int* _edge10=new int[3];
730       _edge10[0]=2;
731       _edge10[1]=6;
732       _edge10[2]=18;
733       int* _edge11=new int[3];
734       _edge11[0]=3;
735       _edge11[1]=7;
736       _edge11[2]=19;
737       int* _edge12=new int[3];
738       _edge12[0]=4;
739       _edge12[1]=8;
740       _edge12[2]=20;
741       int* _face1=new int[8];
742       _face1[0]=1;
743       _face1[1]=2;
744       _face1[2]=3;
745       _face1[3]=4;
746       _face1[4]=9;
747       _face1[5]=10;
748       _face1[6]=11;
749       _face1[7]=12;
750       int* _face2=new int[8];
751       _face2[0]=5;
752       _face2[1]=8;
753       _face2[2]=7;
754       _face2[3]=6;
755       _face2[4]=16;
756       _face2[5]=15;
757       _face2[6]=14;
758       _face2[7]=13;
759       int* _face3=new int[8];
760       _face3[0]=1;
761       _face3[1]=5;
762       _face3[2]=6;
763       _face3[3]=2;
764       _face3[4]=17;
765       _face3[5]=13;
766       _face3[6]=18;
767       _face3[7]=9;
768       int* _face4=new int[8];
769       _face4[0]=2;
770       _face4[1]=6;
771       _face4[2]=7;
772       _face4[3]=3;
773       _face4[4]=18;
774       _face4[5]=14;
775       _face4[6]=19;
776       _face4[7]=10;
777       int* _face5=new int[8];
778       _face5[0]=3;
779       _face5[1]=7;
780       _face5[2]=8;
781       _face5[3]=4;
782       _face5[4]=19;
783       _face5[5]=15;
784       _face5[6]=20;
785       _face5[7]=11;
786      int* _face6=new int[8];
787       _face6[0]=4;
788       _face6[1]=8;
789       _face6[2]=5;
790       _face6[3]=1;
791       _face6[4]=20;
792       _face6[5]=16;
793       _face6[6]=17;
794       _face6[7]=12;
795       int ** tmpConstituents1 = new int*[6];
796       tmpConstituents1[0]=_face1 ;
797       tmpConstituents1[1]=_face2 ;
798       tmpConstituents1[2]=_face3 ;
799       tmpConstituents1[3]=_face4 ;
800       tmpConstituents1[4]=_face5 ;
801       tmpConstituents1[5]=_face6 ;
802       int ** tmpConstituents2 = new int*[12];
803       tmpConstituents2[0]=_edge1 ;
804       tmpConstituents2[1]=_edge2 ;
805       tmpConstituents2[2]=_edge3 ;
806       tmpConstituents2[3]=_edge4 ;
807       tmpConstituents2[4]=_edge5 ;
808       tmpConstituents2[5]=_edge6 ;
809       tmpConstituents2[6]=_edge7 ;
810       tmpConstituents2[7]=_edge8 ;
811       tmpConstituents2[8]=_edge9 ;
812       tmpConstituents2[9]=_edge10;
813       tmpConstituents2[10]=_edge11;
814       tmpConstituents2[11]=_edge12;
815       _constituents = new int**[2] ;
816       _constituents[0]=tmpConstituents1 ;
817       _constituents[1]=tmpConstituents2 ;
818       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[6] ;
819       tmpConstituentsType1[0] = MED_QUAD8 ;
820       tmpConstituentsType1[1] = MED_QUAD8 ;
821       tmpConstituentsType1[2] = MED_QUAD8 ;
822       tmpConstituentsType1[3] = MED_QUAD8 ;
823       tmpConstituentsType1[4] = MED_QUAD8 ;
824       tmpConstituentsType1[5] = MED_QUAD8 ;
825       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[12] ;
826       tmpConstituentsType2[0] = MED_SEG3 ;
827       tmpConstituentsType2[1] = MED_SEG3 ;
828       tmpConstituentsType2[2] = MED_SEG3 ;
829       tmpConstituentsType2[3] = MED_SEG3 ;
830       tmpConstituentsType2[4] = MED_SEG3 ;
831       tmpConstituentsType2[5] = MED_SEG3 ;
832       tmpConstituentsType2[6] = MED_SEG3 ;
833       tmpConstituentsType2[7] = MED_SEG3 ;
834       tmpConstituentsType2[8] = MED_SEG3 ;
835       tmpConstituentsType2[9] = MED_SEG3 ;
836       tmpConstituentsType2[10] = MED_SEG3 ;
837       tmpConstituentsType2[11] = MED_SEG3 ;
838       _constituentsType = new medGeometryElement*[2] ;
839       _constituentsType[0]=tmpConstituentsType1 ;
840       _constituentsType[1]=tmpConstituentsType2 ;
841       break;
842     }
843     case MED_PENTA6  : {
844       _name="MED_PENTA6" ;
845       _type=t;
846       _dimension=3;
847       _numberOfVertexes=6;
848       _numberOfNodes=6;
849
850       _numberOfConstituentsDimension=2 ;
851       _numberOfConstituents=new int[2] ;
852       _numberOfConstituents[0]=5 ;
853       _numberOfConstituents[1]=9 ;
854       _numberOfNodeOfEachConstituent=new int*[2] ;
855       _numberOfNodeOfEachConstituent[0]=new int[5] ;
856       _numberOfNodeOfEachConstituent[0][0]=3 ;
857       _numberOfNodeOfEachConstituent[0][1]=3 ;
858       _numberOfNodeOfEachConstituent[0][2]=4 ;
859       _numberOfNodeOfEachConstituent[0][3]=4 ;
860       _numberOfNodeOfEachConstituent[0][4]=4 ;
861       _numberOfNodeOfEachConstituent[1]=new int[9] ;
862       _numberOfNodeOfEachConstituent[1][0]=2 ;
863       _numberOfNodeOfEachConstituent[1][1]=2 ;
864       _numberOfNodeOfEachConstituent[1][2]=2 ;
865       _numberOfNodeOfEachConstituent[1][3]=2 ;
866       _numberOfNodeOfEachConstituent[1][4]=2 ;
867       _numberOfNodeOfEachConstituent[1][5]=2 ;
868       _numberOfNodeOfEachConstituent[1][6]=2 ;
869       _numberOfNodeOfEachConstituent[1][7]=2 ;
870       _numberOfNodeOfEachConstituent[1][8]=2 ;
871
872       int* _edge1=new int[2];
873       _edge1[0]=1;
874       _edge1[1]=2;
875       int* _edge2=new int[2];
876       _edge2[0]=2;
877       _edge2[1]=3;
878       int* _edge3=new int[2];
879       _edge3[0]=3;
880       _edge3[1]=1;
881       int* _edge4=new int[2];
882       _edge4[0]=4;
883       _edge4[1]=5;
884       int* _edge5=new int[2];
885       _edge5[0]=5;
886       _edge5[1]=6;
887       int* _edge6=new int[2];
888       _edge6[0]=6;
889       _edge6[1]=4;
890       int* _edge7=new int[2];
891       _edge7[0]=1;
892       _edge7[1]=4;
893       int* _edge8=new int[2];
894       _edge8[0]=2;
895       _edge8[1]=5;
896       int* _edge9=new int[2];
897       _edge9[0]=3;
898       _edge9[1]=6;
899       int* _face1=new int[3];
900       _face1[0]=1;
901       _face1[1]=2;
902       _face1[2]=3;
903       int* _face2=new int[3];
904       _face2[0]=4;
905       _face2[1]=6;
906       _face2[2]=5;
907       int* _face3=new int[4];
908       _face3[0]=1;
909       _face3[1]=4;
910       _face3[2]=5;
911       _face3[3]=2;
912       int* _face4=new int[4];
913       _face4[0]=2;
914       _face4[1]=5;
915       _face4[2]=6;
916       _face4[3]=3;
917       int* _face5=new int[4];
918       _face5[0]=3;
919       _face5[1]=6;
920       _face5[2]=4;
921       _face5[3]=1;
922       int ** tmpConstituents1 = new int*[5];
923       tmpConstituents1[0]=_face1 ;
924       tmpConstituents1[1]=_face2 ;
925       tmpConstituents1[2]=_face3 ;
926       tmpConstituents1[3]=_face4 ;
927       tmpConstituents1[4]=_face5 ;
928       int ** tmpConstituents2 = new int*[9];
929       tmpConstituents2[0]=_edge1 ;
930       tmpConstituents2[1]=_edge2 ;
931       tmpConstituents2[2]=_edge3 ;
932       tmpConstituents2[3]=_edge4 ;
933       tmpConstituents2[4]=_edge5 ;
934       tmpConstituents2[5]=_edge6 ;
935       tmpConstituents2[6]=_edge7 ;
936       tmpConstituents2[7]=_edge8 ;
937       tmpConstituents2[8]=_edge9 ;
938       _constituents = new int**[2] ;
939       _constituents[0]=tmpConstituents1 ;
940       _constituents[1]=tmpConstituents2 ;
941       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
942       tmpConstituentsType1[0] = MED_TRIA3 ;
943       tmpConstituentsType1[1] = MED_TRIA3 ;
944       tmpConstituentsType1[2] = MED_QUAD4 ;
945       tmpConstituentsType1[3] = MED_QUAD4 ;
946       tmpConstituentsType1[4] = MED_QUAD4 ;
947       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[9] ;
948       tmpConstituentsType2[0] = MED_SEG2 ;
949       tmpConstituentsType2[1] = MED_SEG2 ;
950       tmpConstituentsType2[2] = MED_SEG2 ;
951       tmpConstituentsType2[3] = MED_SEG2 ;
952       tmpConstituentsType2[4] = MED_SEG2 ;
953       tmpConstituentsType2[5] = MED_SEG2 ;
954       tmpConstituentsType2[6] = MED_SEG2 ;
955       tmpConstituentsType2[7] = MED_SEG2 ;
956       tmpConstituentsType2[8] = MED_SEG2 ;
957       _constituentsType = new medGeometryElement*[2] ;
958       _constituentsType[0]=tmpConstituentsType1 ;
959       _constituentsType[1]=tmpConstituentsType2 ;
960       break;
961     }
962     case MED_PENTA15 : {
963       _name="MED_PENTA15" ;
964       _type=t;
965       _dimension=3;
966       _numberOfVertexes=6;
967       _numberOfNodes=15;
968       _numberOfConstituentsDimension=2 ;
969       _numberOfConstituents=new int[2] ;
970       _numberOfConstituents[0]=5 ;
971       _numberOfConstituents[1]=9 ;
972       _numberOfNodeOfEachConstituent=new int*[2] ;
973       _numberOfNodeOfEachConstituent[0]=new int[5] ;
974       _numberOfNodeOfEachConstituent[0][0]=6 ;
975       _numberOfNodeOfEachConstituent[0][1]=6 ;
976       _numberOfNodeOfEachConstituent[0][2]=8 ;
977       _numberOfNodeOfEachConstituent[0][3]=8 ;
978       _numberOfNodeOfEachConstituent[0][4]=8 ;
979       _numberOfNodeOfEachConstituent[1]=new int[9] ;
980       _numberOfNodeOfEachConstituent[1][0]=3 ;
981       _numberOfNodeOfEachConstituent[1][1]=3 ;
982       _numberOfNodeOfEachConstituent[1][2]=3 ;
983       _numberOfNodeOfEachConstituent[1][3]=3 ;
984       _numberOfNodeOfEachConstituent[1][4]=3 ;
985       _numberOfNodeOfEachConstituent[1][5]=3 ;
986       _numberOfNodeOfEachConstituent[1][6]=3 ;
987       _numberOfNodeOfEachConstituent[1][7]=3 ;
988       _numberOfNodeOfEachConstituent[1][8]=3 ;
989
990       int* _edge1=new int[3];
991       _edge1[0]=1;
992       _edge1[1]=2;
993       _edge1[2]=7;
994       int* _edge2=new int[3];
995       _edge2[0]=2;
996       _edge2[1]=3;
997       _edge2[2]=8;
998       int* _edge3=new int[3];
999       _edge3[0]=3;
1000       _edge3[1]=1;
1001       _edge3[2]=9;
1002       int* _edge4=new int[3];
1003       _edge4[0]=4;
1004       _edge4[1]=5;
1005       _edge4[2]=10;
1006       int* _edge5=new int[3];
1007       _edge5[0]=5;
1008       _edge5[1]=6;
1009       _edge5[2]=11;
1010       int* _edge6=new int[3];
1011       _edge6[0]=6;
1012       _edge6[1]=4;
1013       _edge6[2]=12;
1014       int* _edge7=new int[3];
1015       _edge7[0]=1;
1016       _edge7[1]=4;
1017       _edge7[2]=13;
1018       int* _edge8=new int[3];
1019       _edge8[0]=2;
1020       _edge8[1]=5;
1021       _edge8[2]=14;
1022       int* _edge9=new int[3];
1023       _edge9[0]=3;
1024       _edge9[1]=6;
1025       _edge9[2]=15;
1026       int* _face1=new int[6];
1027       _face1[0]=1;
1028       _face1[1]=2;
1029       _face1[2]=3;
1030       _face1[3]=7;
1031       _face1[4]=8;
1032       _face1[5]=9;
1033       int* _face2=new int[6];
1034       _face2[0]=4;
1035       _face2[1]=5;
1036       _face2[2]=6;
1037       _face2[3]=12;
1038       _face2[4]=11;
1039       _face2[5]=10;
1040       int* _face3=new int[8];
1041       _face3[0]=1;
1042       _face3[1]=4;
1043       _face3[2]=5;
1044       _face3[3]=2;
1045       _face3[4]=13;
1046       _face3[5]=10;
1047       _face3[6]=14;
1048       _face3[7]=7;
1049       int* _face4=new int[8];
1050       _face4[0]=2;
1051       _face4[1]=5;
1052       _face4[2]=6;
1053       _face4[3]=3;
1054       _face4[4]=14;
1055       _face4[5]=11;
1056       _face4[6]=15;
1057       _face4[7]=8;
1058       int* _face5=new int[8];
1059       _face5[0]=3;
1060       _face5[1]=6;
1061       _face5[2]=4;
1062       _face5[3]=1;
1063       _face5[4]=15;
1064       _face5[5]=12;
1065       _face5[6]=13;
1066       _face5[7]=9;
1067       int ** tmpConstituents1 = new int*[5];
1068       tmpConstituents1[0]=_face1 ;
1069       tmpConstituents1[1]=_face2 ;
1070       tmpConstituents1[2]=_face3 ;
1071       tmpConstituents1[3]=_face4 ;
1072       tmpConstituents1[4]=_face5 ;
1073       int ** tmpConstituents2 = new int*[9];
1074       tmpConstituents2[0]=_edge1 ;
1075       tmpConstituents2[1]=_edge2 ;
1076       tmpConstituents2[2]=_edge3 ;
1077       tmpConstituents2[3]=_edge4 ;
1078       tmpConstituents2[4]=_edge5 ;
1079       tmpConstituents2[5]=_edge6 ;
1080       tmpConstituents2[6]=_edge7 ;
1081       tmpConstituents2[7]=_edge8 ;
1082       tmpConstituents2[8]=_edge9 ;
1083       _constituents = new int**[2] ;
1084       _constituents[0]=tmpConstituents1 ;
1085       _constituents[1]=tmpConstituents2 ;
1086       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
1087       tmpConstituentsType1[0] = MED_TRIA6 ;
1088       tmpConstituentsType1[1] = MED_TRIA6 ;
1089       tmpConstituentsType1[2] = MED_QUAD8 ;
1090       tmpConstituentsType1[3] = MED_QUAD8 ;
1091       tmpConstituentsType1[4] = MED_QUAD8 ;
1092       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[9] ;
1093       tmpConstituentsType2[0] = MED_SEG3 ;
1094       tmpConstituentsType2[1] = MED_SEG3 ;
1095       tmpConstituentsType2[2] = MED_SEG3 ;
1096       tmpConstituentsType2[3] = MED_SEG3 ;
1097       tmpConstituentsType2[4] = MED_SEG3 ;
1098       tmpConstituentsType2[5] = MED_SEG3 ;
1099       tmpConstituentsType2[6] = MED_SEG3 ;
1100       tmpConstituentsType2[7] = MED_SEG3 ;
1101       tmpConstituentsType2[8] = MED_SEG3 ;
1102       _constituentsType = new medGeometryElement*[2] ;
1103       _constituentsType[0]=tmpConstituentsType1 ;
1104       _constituentsType[1]=tmpConstituentsType2 ;
1105       break ;
1106     }
1107     case MED_PYRA5   : {
1108       _name="MED_PYRA5" ;
1109       _type=t;
1110       _dimension=3;
1111       _numberOfVertexes=5;
1112       _numberOfNodes=5;
1113       _numberOfConstituentsDimension=2 ;
1114       _numberOfConstituents=new int[2] ;
1115       _numberOfConstituents[0]=5 ;
1116       _numberOfConstituents[1]=8 ;
1117       _numberOfNodeOfEachConstituent=new int*[2] ;
1118       _numberOfNodeOfEachConstituent[0]=new int[5] ;
1119       _numberOfNodeOfEachConstituent[0][0]=4 ;
1120       _numberOfNodeOfEachConstituent[0][1]=3 ;
1121       _numberOfNodeOfEachConstituent[0][2]=3 ;
1122       _numberOfNodeOfEachConstituent[0][3]=3 ;
1123       _numberOfNodeOfEachConstituent[0][4]=3 ;
1124       _numberOfNodeOfEachConstituent[1]=new int[8] ;
1125       _numberOfNodeOfEachConstituent[1][0]=2 ;
1126       _numberOfNodeOfEachConstituent[1][1]=2 ;
1127       _numberOfNodeOfEachConstituent[1][2]=2 ;
1128       _numberOfNodeOfEachConstituent[1][3]=2 ;
1129       _numberOfNodeOfEachConstituent[1][4]=2 ;
1130       _numberOfNodeOfEachConstituent[1][5]=2 ;
1131       _numberOfNodeOfEachConstituent[1][6]=2 ;
1132       _numberOfNodeOfEachConstituent[1][7]=2 ;
1133
1134       int* _edge1=new int[2];
1135       _edge1[0]=1;
1136       _edge1[1]=2;
1137       int* _edge2=new int[2];
1138       _edge2[0]=2;
1139       _edge2[1]=3;
1140       int* _edge3=new int[2];
1141       _edge3[0]=3;
1142       _edge3[1]=4;
1143       int* _edge4=new int[2];
1144       _edge4[0]=4;
1145       _edge4[1]=1;
1146       int* _edge5=new int[2];
1147       _edge5[0]=1;
1148       _edge5[1]=5;
1149       int* _edge6=new int[2];
1150       _edge6[0]=2;
1151       _edge6[1]=5;
1152       int* _edge7=new int[2];
1153       _edge7[0]=3;
1154       _edge7[1]=5;
1155       int* _edge8=new int[2];
1156       _edge8[0]=4;
1157       _edge8[1]=5;
1158       int* _face1=new int[4];
1159       _face1[0]=1;
1160       _face1[1]=2;
1161       _face1[2]=3;
1162       _face1[3]=4;
1163       int* _face2=new int[3];
1164       _face2[0]=1;
1165       _face2[1]=5;
1166       _face2[2]=2;
1167       int* _face3=new int[3];
1168       _face3[0]=2;
1169       _face3[1]=5;
1170       _face3[2]=3;
1171       int* _face4=new int[3];
1172       _face4[0]=3;
1173       _face4[1]=5;
1174       _face4[2]=4;
1175       int* _face5=new int[3];
1176       _face5[0]=4;
1177       _face5[1]=5;
1178       _face5[2]=1;
1179       int ** tmpConstituents1 = new int*[5];
1180       tmpConstituents1[0]=_face1 ;
1181       tmpConstituents1[1]=_face2 ;
1182       tmpConstituents1[2]=_face3 ;
1183       tmpConstituents1[3]=_face4 ;
1184       tmpConstituents1[4]=_face5 ;
1185       int ** tmpConstituents2 = new int*[8];
1186       tmpConstituents2[0]=_edge1 ;
1187       tmpConstituents2[1]=_edge2 ;
1188       tmpConstituents2[2]=_edge3 ;
1189       tmpConstituents2[3]=_edge4 ;
1190       tmpConstituents2[4]=_edge5 ;
1191       tmpConstituents2[5]=_edge6 ;
1192       tmpConstituents2[6]=_edge7 ;
1193       tmpConstituents2[7]=_edge8 ;
1194       _constituents = new int**[2] ;
1195       _constituents[0]=tmpConstituents1 ;
1196       _constituents[1]=tmpConstituents2 ;
1197       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
1198       tmpConstituentsType1[0] = MED_QUAD4 ;
1199       tmpConstituentsType1[1] = MED_TRIA3 ;
1200       tmpConstituentsType1[2] = MED_TRIA3 ;
1201       tmpConstituentsType1[3] = MED_TRIA3 ;
1202       tmpConstituentsType1[4] = MED_TRIA3 ;
1203       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[8] ;
1204       tmpConstituentsType2[0] = MED_SEG2 ;
1205       tmpConstituentsType2[1] = MED_SEG2 ;
1206       tmpConstituentsType2[2] = MED_SEG2 ;
1207       tmpConstituentsType2[3] = MED_SEG2 ;
1208       tmpConstituentsType2[4] = MED_SEG2 ;
1209       tmpConstituentsType2[5] = MED_SEG2 ;
1210       tmpConstituentsType2[6] = MED_SEG2 ;
1211       tmpConstituentsType2[7] = MED_SEG2 ;
1212       _constituentsType = new medGeometryElement*[2] ;
1213       _constituentsType[0]=tmpConstituentsType1 ;
1214       _constituentsType[1]=tmpConstituentsType2 ;
1215       break;
1216     }
1217     case MED_PYRA13  : {
1218       _name="MED_PYRA13" ;
1219       _type=t;
1220       _dimension=3;
1221       _numberOfVertexes=5;
1222       _numberOfNodes=13;
1223       _numberOfConstituentsDimension=2 ;
1224       _numberOfConstituents=new int[2] ;
1225       _numberOfConstituents[0]=5 ;
1226       _numberOfConstituents[1]=8 ;
1227       _numberOfNodeOfEachConstituent=new int*[2] ;
1228       _numberOfNodeOfEachConstituent[0]=new int[5] ;
1229       _numberOfNodeOfEachConstituent[0][0]=8 ;
1230       _numberOfNodeOfEachConstituent[0][1]=6 ;
1231       _numberOfNodeOfEachConstituent[0][2]=6 ;
1232       _numberOfNodeOfEachConstituent[0][3]=6 ;
1233       _numberOfNodeOfEachConstituent[0][4]=6 ;
1234       _numberOfNodeOfEachConstituent[1]=new int[8] ;
1235       _numberOfNodeOfEachConstituent[1][0]=3 ;
1236       _numberOfNodeOfEachConstituent[1][1]=3 ;
1237       _numberOfNodeOfEachConstituent[1][2]=3 ;
1238       _numberOfNodeOfEachConstituent[1][3]=3 ;
1239       _numberOfNodeOfEachConstituent[1][4]=3 ;
1240       _numberOfNodeOfEachConstituent[1][5]=3 ;
1241       _numberOfNodeOfEachConstituent[1][6]=3 ;
1242       _numberOfNodeOfEachConstituent[1][7]=3 ;
1243
1244       int* _edge1=new int[3];
1245       _edge1[0]=1;
1246       _edge1[1]=2;
1247       _edge1[2]=6;
1248       int* _edge2=new int[3];
1249       _edge2[0]=2;
1250       _edge2[1]=3;
1251       _edge2[2]=7;
1252       int* _edge3=new int[3];
1253       _edge3[0]=3;
1254       _edge3[1]=4;
1255       _edge3[2]=8;
1256       int* _edge4=new int[3];
1257       _edge4[0]=4;
1258       _edge4[1]=1;
1259       _edge4[2]=9;
1260       int* _edge5=new int[3];
1261       _edge5[0]=1;
1262       _edge5[1]=5;
1263       _edge5[2]=10;
1264       int* _edge6=new int[3];
1265       _edge6[0]=2;
1266       _edge6[1]=5;
1267       _edge6[2]=11;
1268       int* _edge7=new int[3];
1269       _edge7[0]=3;
1270       _edge7[1]=5;
1271       _edge7[2]=12;
1272       int* _edge8=new int[3];
1273       _edge8[0]=4;
1274       _edge8[1]=5;
1275       _edge8[2]=13;
1276       int* _face1=new int[8];
1277       _face1[0]=1;
1278       _face1[1]=2;
1279       _face1[2]=3;
1280       _face1[3]=4;
1281       _face1[4]=6;
1282       _face1[5]=7;
1283       _face1[6]=8;
1284       _face1[7]=9;
1285       int* _face2=new int[6];
1286       _face2[0]=1;
1287       _face2[1]=5;
1288       _face2[2]=2;
1289       _face2[3]=10;
1290       _face2[4]=11;
1291       _face2[5]=6;
1292       int* _face3=new int[6];
1293       _face3[0]=2;
1294       _face3[1]=5;
1295       _face3[2]=3;
1296       _face3[3]=11;
1297       _face3[4]=12;
1298       _face3[5]=7;
1299       int* _face4=new int[6];
1300       _face4[0]=3;
1301       _face4[1]=5;
1302       _face4[2]=4;
1303       _face4[3]=12;
1304       _face4[4]=13;
1305       _face4[5]=8;
1306       int* _face5=new int[6];
1307       _face5[0]=4;
1308       _face5[1]=5;
1309       _face5[2]=1;
1310       _face5[3]=13;
1311       _face5[4]=10;
1312       _face5[5]=9;
1313       int ** tmpConstituents1 = new int*[5];
1314       tmpConstituents1[0]=_face1 ;
1315       tmpConstituents1[1]=_face2 ;
1316       tmpConstituents1[2]=_face3 ;
1317       tmpConstituents1[3]=_face4 ;
1318       tmpConstituents1[4]=_face5 ;
1319       int ** tmpConstituents2 = new int*[8];
1320       tmpConstituents2[0]=_edge1 ;
1321       tmpConstituents2[1]=_edge2 ;
1322       tmpConstituents2[2]=_edge3 ;
1323       tmpConstituents2[3]=_edge4 ;
1324       tmpConstituents2[4]=_edge5 ;
1325       tmpConstituents2[5]=_edge6 ;
1326       tmpConstituents2[6]=_edge7 ;
1327       tmpConstituents2[7]=_edge8 ;
1328       _constituents = new int**[2] ;
1329       _constituents[0]=tmpConstituents1 ;
1330       _constituents[1]=tmpConstituents2 ;
1331       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
1332       tmpConstituentsType1[0] = MED_QUAD8 ;
1333       tmpConstituentsType1[1] = MED_TRIA6 ;
1334       tmpConstituentsType1[2] = MED_TRIA6 ;
1335       tmpConstituentsType1[3] = MED_TRIA6 ;
1336       tmpConstituentsType1[4] = MED_TRIA6 ;
1337       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[8] ;
1338       tmpConstituentsType2[0] = MED_SEG3 ;
1339       tmpConstituentsType2[1] = MED_SEG3 ;
1340       tmpConstituentsType2[2] = MED_SEG3 ;
1341       tmpConstituentsType2[3] = MED_SEG3 ;
1342       tmpConstituentsType2[4] = MED_SEG3 ;
1343       tmpConstituentsType2[5] = MED_SEG3 ;
1344       tmpConstituentsType2[6] = MED_SEG3 ;
1345       tmpConstituentsType2[7] = MED_SEG3 ;
1346       _constituentsType = new medGeometryElement*[2] ;
1347       _constituentsType[0]=tmpConstituentsType1 ;
1348       _constituentsType[1]=tmpConstituentsType2 ;
1349       break;
1350     }
1351 //      default : 
1352 //        _type=0;
1353 //        break;
1354     }
1355 }
1356
1357 ostream & MEDMEM::operator<<(ostream &os,const CELLMODEL &my)
1358 {
1359   os << "Cell Model :" << endl ;
1360   os << "  - name               : " << my._name << endl;
1361   os << "  - type               : " << (int)my._type << endl;
1362   os << "  - dimension          : " << my._dimension << endl;
1363   os << "  - number of nodes    : " << my._numberOfNodes << endl ;
1364   os << "  - number of vertexes : " << my._numberOfVertexes << endl ;
1365
1366   os << "  - number of Constituents Dimension : " << my._numberOfConstituentsDimension << endl ;
1367
1368   for(int i=0;i<my._numberOfConstituentsDimension;i++)
1369     {
1370
1371       os << "  - for dimension (-" << i+1 << ") : " << endl ;
1372       os << "    - number of Constituents for this Dimension : " << my._numberOfConstituents[i] << endl ;
1373
1374       for(int j=0;j<my._numberOfConstituents[i];j++)
1375         {
1376           os << "    - number of node for this constituent : " << my._numberOfNodeOfEachConstituent[i][j] << endl ;
1377           os << "      - constituents " << j+1 << " of type "<< my._constituentsType[i][j] <<" : " ;
1378           for(int k=0;k<my._numberOfNodeOfEachConstituent[i][j];k++)
1379             os << my._constituents[i][j][k] << " " ;
1380           os << endl ;
1381         }
1382     }
1383   return os;
1384 }
1385 /*
1386 */
1387
1388 // Return number of constituents type (which dimension is _dimension-1).
1389 int CELLMODEL::getNumberOfConstituentsType() const
1390 {
1391   set<medGeometryElement> constituentsTypes ;
1392 //   if (_constituentsType.size() > 0 ) {
1393 //     vector<medGeometryElement> constituentsType = _constituentsType[0] ;
1394 //     vector<medGeometryElement>::iterator itvec ;
1395 //     for(itvec=constituentsType.begin();itvec!=constituentsType.end();itvec++)
1396 //       constituentsTypes.insert(*itvec);
1397 //   }
1398   return constituentsTypes.size() ;
1399 }
1400
1401   // Return all types of constituents which dimension is (_dimension-1).
1402 set<medGeometryElement>  CELLMODEL::getAllConstituentsType() const
1403 {
1404   set<medGeometryElement> constituentsTypes ;
1405 //   if (_constituentsType.size() > 0 ) {
1406 //     vector<medGeometryElement> constituentsType = _constituentsType[0] ;
1407 //     vector<medGeometryElement>::iterator itvec ;
1408 //     for(itvec=constituentsType.begin();itvec!=constituentsType.end();itvec++)
1409 //       constituentsTypes.insert(*itvec);
1410 //   }
1411   return constituentsTypes ;
1412 }
1413
1414   // Return number of constituents foreach type (which dimension is _dimension-1).
1415 map<medGeometryElement,int>  CELLMODEL::getNumberOfConstituentsForeachType() const
1416 {
1417   map<medGeometryElement,int> numberOfConstituentsForeachType ;
1418 //   map<medGeometryElement,int>::iterator itmap ;
1419 //   if (_constituentsType.size() > 0 ) {
1420 //     vector<medGeometryElement> constituentsType = _constituentsType[0] ;
1421 //     vector<medGeometryElement>::iterator itvec ;
1422 //     for(itvec=constituentsType.begin();itvec!=constituentsType.end();itvec++) {
1423 //       itmap = numberOfConstituentsForeachType.find(*itvec);
1424 //       if (itmap==numberOfConstituentsForeachType.end()) // new element
1425 //      numberOfConstituentsForeachType[*itvec]=1 ;
1426 //       else
1427 //      numberOfConstituentsForeachType[*itvec]++ ;
1428 //     }
1429 //   }
1430   return numberOfConstituentsForeachType ;
1431 }
1432
1433 void CELLMODEL::init(const CELLMODEL &m)
1434 {
1435   _name=m._name ;
1436   _type= m._type ;
1437   _dimension = m._dimension ;
1438   _numberOfNodes = m._numberOfNodes ;
1439   _numberOfVertexes = m._numberOfVertexes ;
1440   
1441   _numberOfConstituentsDimension = m._numberOfConstituentsDimension ;
1442   
1443   _numberOfConstituents = new int[_numberOfConstituentsDimension] ;
1444   for(int i=0; i<_numberOfConstituentsDimension; i++)
1445     _numberOfConstituents[i]=m._numberOfConstituents[i] ;
1446   
1447   _numberOfNodeOfEachConstituent = new int*[_numberOfConstituentsDimension] ;
1448   for(int i=0; i<_numberOfConstituentsDimension; i++) {
1449     int numberOf = _numberOfConstituents[i] ;
1450     int * newArray = new int[numberOf] ;
1451     int * oldArray = m._numberOfNodeOfEachConstituent[i] ;
1452     for(int j=0; j<numberOf; j++)
1453       newArray[j] = oldArray[j] ;
1454     _numberOfNodeOfEachConstituent[i] = newArray ;
1455   }
1456   _constituents = new int**[_numberOfConstituentsDimension] ;
1457   _constituentsType = new medGeometryElement*[_numberOfConstituentsDimension] ;
1458   for(int i=0; i<_numberOfConstituentsDimension; i++) {
1459     int numberOf = _numberOfConstituents[i] ;
1460     int ** tmpArray = new int*[numberOf] ;
1461     medGeometryElement * newArrayType = new medGeometryElement[numberOf] ;
1462     medGeometryElement * oldArrayType = m._constituentsType[i] ;
1463     
1464     for(int j=0; j<numberOf; j++) {
1465       int numberOf2 = _numberOfNodeOfEachConstituent[i][j] ;
1466       int * newArray = new int[numberOf2] ;
1467       int * oldArray = m._constituents[i][j] ;
1468       for(int k=0; k<numberOf2; k++)
1469         newArray[k] = oldArray[k] ;
1470       tmpArray[j] = newArray ;
1471       newArrayType[j] = oldArrayType[j] ;
1472     }
1473     _constituents[i] = tmpArray ;
1474     _constituentsType[i] = newArrayType ;
1475   }
1476   
1477 }
1478 void CELLMODEL::clean()
1479 {
1480   for(int i=0; i<_numberOfConstituentsDimension; i++) {
1481     int numberOf = _numberOfConstituents[i] ;
1482     for(int j=0; j<numberOf; j++) {
1483       if (NULL!=_constituents[i][j])
1484         delete[] _constituents[i][j] ;
1485     }
1486     if (NULL!=_constituentsType[i])
1487       delete[] _constituentsType[i] ;
1488     if (NULL!=_constituents[i])
1489       delete[] _constituents[i] ;
1490     if (NULL!=_numberOfNodeOfEachConstituent[i])
1491       delete[] _numberOfNodeOfEachConstituent[i] ;
1492   }
1493   if (NULL!=_numberOfConstituents)
1494     delete[]_numberOfConstituents ;
1495   if (NULL!=_constituentsType)
1496     delete[] _constituentsType ;
1497   if (NULL!=_constituents)
1498     delete[] _constituents ;
1499   if (NULL!=_numberOfNodeOfEachConstituent)
1500     delete[] _numberOfNodeOfEachConstituent ;
1501 }