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