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