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