Salome HOME
NRI : Update 1.1a and New organisation.
[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 //       vector<medGeometryElement> vector_type(2,MED_POINT1) ;
43 //       vector<medGeometryElement> __constituents_type[]={vector_type};
44 //       vector< vector<medGeometryElement> > _constituents_type(__constituents_type,__constituents_type+1) ;
45 //       _constituentsType = _constituents_type ;
46       //_constituentsType[2][1]={{MED_POINT1,MED_POINT1}} ;
47       _numberOfConstituentsDimension=1 ;
48       _numberOfConstituents=new int[1] ;
49       _numberOfConstituents[0]=2 ;
50       _numberOfNodeOfEachConstituent=new (int*)[1] ;
51       _numberOfNodeOfEachConstituent[0]=new (int)[2] ;
52       _numberOfNodeOfEachConstituent[0][0]=1 ;
53       _numberOfNodeOfEachConstituent[0][1]=1 ;
54
55       _constituents = new (int**)[1] ;
56       _constituents[0] = new (int*)[2] ;
57       _constituents[0][0] = new int[1] ;
58       _constituents[0][0][0] = 1 ;
59       _constituents[0][1] = new int[1] ;
60       _constituents[0][1][0] = 2 ;
61
62       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[2] ;
63       tmpConstituentsType1[0] = MED_POINT1 ;
64       tmpConstituentsType1[1] = MED_POINT1 ;
65       _constituentsType = new medGeometryElement*[1] ;
66       _constituentsType[0]=tmpConstituentsType1 ;
67       break;
68     }
69     case MED_SEG3    : {
70       _name="MED_SEG3" ;
71       _type=t;
72       _dimension=1;
73       _numberOfVertexes=2;
74       _numberOfNodes=3;
75       // constituent are POINT1 and we have no need to define _constituents vector
76 //       vector<medGeometryElement> vector_type(3,MED_POINT1) ;
77 //       vector<medGeometryElement> __constituents_type[]={vector_type};
78 //       vector< vector<medGeometryElement> > _constituents_type(__constituents_type,__constituents_type+1) ;
79 //       _constituentsType = _constituents_type ;
80       _numberOfConstituentsDimension=1 ;
81       _numberOfConstituents=new int[1] ;
82       _numberOfConstituents[0]=3 ;
83       _numberOfNodeOfEachConstituent=new (int*)[1] ;
84       _numberOfNodeOfEachConstituent[0]=new (int)[3] ;
85       _numberOfNodeOfEachConstituent[0][0]=1 ;
86       _numberOfNodeOfEachConstituent[0][1]=1 ;
87       _numberOfNodeOfEachConstituent[0][2]=1 ;
88
89       _constituents = new (int**)[1] ;
90       _constituents[0] = new (int*)[3] ;
91       _constituents[0][0] = new int[1] ;
92       _constituents[0][0][0] = 1 ;
93       _constituents[0][1] = new int[1] ;
94       _constituents[0][1][0] = 2 ;
95       _constituents[0][2] = new int[1] ;
96       _constituents[0][2][0] = 3 ;
97
98       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[3] ;
99       tmpConstituentsType1[0] = MED_POINT1 ;
100       tmpConstituentsType1[1] = MED_POINT1 ;
101       tmpConstituentsType1[2] = MED_POINT1 ;
102       _constituentsType = new medGeometryElement*[1] ;
103       _constituentsType[0]=tmpConstituentsType1 ;
104       break;
105     }
106     case MED_TRIA3   : {
107       _name="MED_TRIA3" ;
108       _type=t;
109       _dimension=2;
110       _numberOfVertexes=3;
111       _numberOfNodes=3;
112
113       _numberOfConstituentsDimension=1 ;
114       _numberOfConstituents=new int[1] ;
115       _numberOfConstituents[0]=3 ;
116       _numberOfNodeOfEachConstituent=new (int*)[1] ;
117       _numberOfNodeOfEachConstituent[0]=new (int)[3] ;
118       _numberOfNodeOfEachConstituent[0][0]=2 ;
119       _numberOfNodeOfEachConstituent[0][1]=2 ;
120       _numberOfNodeOfEachConstituent[0][2]=2 ;
121
122       int* _edge1=new int[2];
123       _edge1[0]=1;
124       _edge1[1]=2;
125       int* _edge2=new int[2];
126       _edge2[0]=2;
127       _edge2[1]=3;
128       int* _edge3=new int[2];
129       _edge3[0]=3;
130       _edge3[1]=1;
131       int ** tmpConstituents1 = new (int*)[3];
132       tmpConstituents1[0]=_edge1 ;
133       tmpConstituents1[1]=_edge2 ;
134       tmpConstituents1[2]=_edge3 ;
135       _constituents = new int**[1] ;
136       _constituents[0]=tmpConstituents1 ;
137
138       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[3] ;
139       tmpConstituentsType1[0] = MED_SEG2 ;
140       tmpConstituentsType1[1] = MED_SEG2 ;
141       tmpConstituentsType1[2] = MED_SEG2 ;
142       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[3] ;
143       tmpConstituentsType2[0] = MED_POINT1 ;
144       tmpConstituentsType2[1] = MED_POINT1 ;
145       tmpConstituentsType2[2] = MED_POINT1 ;
146       _constituentsType = new medGeometryElement*[2] ;
147       _constituentsType[0]=tmpConstituentsType1 ;
148       _constituentsType[1]=tmpConstituentsType2 ;
149       // Well, point are defined, but could not be acces because we have 
150       // only 1 numberOfConstituentsDimension !
151
152       break;
153     }
154     case MED_TRIA6   : {
155       _name="MED_TRIA6" ;
156       _type=t;
157       _dimension=2;
158       _numberOfVertexes=3;
159       _numberOfNodes=6;
160 //       int _edge1[]={1,2,4} ;
161 //       int _edge2[]={2,3,5} ;
162 //       int _edge3[]={3,1,6} ;
163 //       vector<int> edge1(_edge1,_edge1+3) ;
164 //       vector<int> edge2(_edge2,_edge2+3) ;
165 //       vector<int> edge3(_edge3,_edge3+3) ;
166 //       vector<int> _vector_edge[]={edge1,edge2,edge3};
167 //       vector< vector<int> > vector_edge(_vector_edge,_vector_edge+3) ;
168 //       vector< vector<int> > __constituents__[]={vector_edge};
169 //       vector< vector< vector<int> > > _constituents_(__constituents__,__constituents__+1) ;
170 //       _constituents = _constituents_ ;
171       _numberOfConstituentsDimension=1 ;
172       _numberOfConstituents=new int[1] ;
173       _numberOfConstituents[0]=3 ;
174       _numberOfNodeOfEachConstituent=new (int*)[1] ;
175       _numberOfNodeOfEachConstituent[0]=new (int)[3] ;
176       _numberOfNodeOfEachConstituent[0][0]=3 ;
177       _numberOfNodeOfEachConstituent[0][1]=3 ;
178       _numberOfNodeOfEachConstituent[0][2]=3 ;
179
180       int* _edge1=new int[3];
181       _edge1[0]=1;
182       _edge1[1]=2;
183       _edge1[2]=4;
184       int* _edge2=new int[3];
185       _edge2[0]=2;
186       _edge2[1]=3;
187       _edge2[2]=5;
188       int* _edge3=new int[3];
189       _edge3[0]=3;
190       _edge3[1]=1;
191       _edge3[2]=6;
192       int ** tmpConstituents1 = new (int*)[3];
193       tmpConstituents1[0]=_edge1 ;
194       tmpConstituents1[1]=_edge2 ;
195       tmpConstituents1[2]=_edge3 ;
196       _constituents = new int**[1] ;
197       _constituents[0]=tmpConstituents1 ;
198 //       vector<medGeometryElement> vector_edge_type(3,MED_SEG3) ;
199 //       vector<medGeometryElement> vector_type(6,MED_POINT1) ;
200 //       vector<medGeometryElement> __constituents_type[]={vector_edge_type,vector_type};
201 //       vector< vector<medGeometryElement> > _constituents_type(__constituents_type,__constituents_type+2) ;
202 //       _constituentsType = _constituents_type ;
203       //_constituentsType={{MED_SEG3,MED_SEG3,MED_SEG3},{MED_POINT1,MED_POINT1,MED_POINT1,MED_POINT1,MED_POINT1,MED_POINT1}} ;      
204       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[3] ;
205       tmpConstituentsType1[0] = MED_SEG3 ;
206       tmpConstituentsType1[1] = MED_SEG3 ;
207       tmpConstituentsType1[2] = MED_SEG3 ;
208       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[6] ;
209       tmpConstituentsType2[0] = MED_POINT1 ;
210       tmpConstituentsType2[1] = MED_POINT1 ;
211       tmpConstituentsType2[2] = MED_POINT1 ;
212       tmpConstituentsType2[3] = MED_POINT1 ;
213       tmpConstituentsType2[4] = MED_POINT1 ;
214       tmpConstituentsType2[5] = MED_POINT1 ;
215       _constituentsType = new medGeometryElement*[2] ;
216       _constituentsType[0]=tmpConstituentsType1 ;
217       _constituentsType[1]=tmpConstituentsType2 ;
218       // Well, point are defined, but could not be acces because we have 
219       // only 1 numberOfConstituentsDimension !
220
221       break;
222     }
223     case MED_QUAD4   : {
224       _name="MED_QUAD4" ;
225       _type=t;
226       _dimension=2;
227       _numberOfVertexes=4;
228       _numberOfNodes=4;
229 //       int _edge1[]={1,2} ;
230 //       int _edge2[]={2,3} ;
231 //       int _edge3[]={3,4} ;
232 //       int _edge4[]={4,1} ;
233 //       vector<int> edge1(_edge1,_edge1+2) ;
234 //       vector<int> edge2(_edge2,_edge2+2) ;
235 //       vector<int> edge3(_edge3,_edge3+2) ;
236 //       vector<int> edge4(_edge4,_edge4+2) ;
237 //       vector<int> _vector_edge[]={edge1,edge2,edge3,edge4};
238 //       vector< vector<int> > vector_edge(_vector_edge,_vector_edge+4) ;
239 //       vector< vector<int> > __constituents__[]={vector_edge};
240 //       vector< vector< vector<int> > > _constituents_(__constituents__,__constituents__+1) ;
241 //       _constituents = _constituents_ ;
242       //_constituents={{{1,2},{2,3},{3,4},{4,1}}} ;
243       _numberOfConstituentsDimension=1 ;
244       _numberOfConstituents=new int[1] ;
245       _numberOfConstituents[0]=4 ;
246       _numberOfNodeOfEachConstituent=new (int*)[1] ;
247       _numberOfNodeOfEachConstituent[0]=new (int)[4] ;
248       _numberOfNodeOfEachConstituent[0][0]=2 ;
249       _numberOfNodeOfEachConstituent[0][1]=2 ;
250       _numberOfNodeOfEachConstituent[0][2]=2 ;
251       _numberOfNodeOfEachConstituent[0][3]=2 ;
252
253       int* _edge1=new int[2];
254       _edge1[0]=1;
255       _edge1[1]=2;
256       int* _edge2=new int[2];
257       _edge2[0]=2;
258       _edge2[1]=3;
259       int* _edge3=new int[2];
260       _edge3[0]=3;
261       _edge3[1]=4;
262       int* _edge4=new int[2];
263       _edge4[0]=4;
264       _edge4[1]=1;
265       int ** tmpConstituents1 = new (int*)[4];
266       tmpConstituents1[0]=_edge1 ;
267       tmpConstituents1[1]=_edge2 ;
268       tmpConstituents1[2]=_edge3 ;
269       tmpConstituents1[3]=_edge4 ;
270       _constituents = new int**[1] ;
271       _constituents[0]=tmpConstituents1 ;
272 //       vector<medGeometryElement> vector_edge_type(4,MED_SEG2) ;
273 //       vector<medGeometryElement> vector_type(4,MED_POINT1) ;
274 //       vector<medGeometryElement> __constituents_type[]={vector_edge_type,vector_type};
275 //       vector< vector<medGeometryElement> > _constituents_type(__constituents_type,__constituents_type+2) ;
276 //       _constituentsType = _constituents_type ;
277       //_constituentsType={{MED_SEG2,MED_SEG2,MED_SEG2,MED_SEG2},{MED_POINT1,MED_POINT1,MED_POINT1,MED_POINT1}} ;      
278       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
279       tmpConstituentsType1[0] = MED_SEG2 ;
280       tmpConstituentsType1[1] = MED_SEG2 ;
281       tmpConstituentsType1[2] = MED_SEG2 ;
282       tmpConstituentsType1[3] = MED_SEG2 ;
283       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[4] ;
284       tmpConstituentsType2[0] = MED_POINT1 ;
285       tmpConstituentsType2[1] = MED_POINT1 ;
286       tmpConstituentsType2[2] = MED_POINT1 ;
287       tmpConstituentsType2[3] = MED_POINT1 ;
288       _constituentsType = new medGeometryElement*[2] ;
289       _constituentsType[0]=tmpConstituentsType1 ;
290       _constituentsType[1]=tmpConstituentsType2 ;
291       // Well, point are defined, but could not be acces because we have 
292       // only 1 numberOfConstituentsDimension !
293
294       break;
295     }
296     case MED_QUAD8   : {
297       _name="MED_QUAD8" ;
298       _type=t;
299       _dimension=2;
300       _numberOfVertexes=4;
301       _numberOfNodes=8;
302 //       int _edge1[]={1,2,5} ;
303 //       int _edge2[]={2,3,6} ;
304 //       int _edge3[]={3,4,7} ;
305 //       int _edge4[]={4,1,8} ;
306 //       vector<int> edge1(_edge1,_edge1+3) ;
307 //       vector<int> edge2(_edge2,_edge2+3) ;
308 //       vector<int> edge3(_edge3,_edge3+3) ;
309 //       vector<int> edge4(_edge4,_edge4+3) ;
310 //       vector<int> _vector_edge[]={edge1,edge2,edge3,edge4};
311 //       vector< vector<int> > vector_edge(_vector_edge,_vector_edge+4) ;
312 //       vector< vector<int> > __constituents__[]={vector_edge};
313 //       vector< vector< vector<int> > > _constituents_(__constituents__,__constituents__+1) ;
314 //       _constituents = _constituents_ ;
315       //_constituents={{{1,2,5},{2,3,6},{3,4,7},{4,1,8}}} ;
316       _numberOfConstituentsDimension=1 ;
317       _numberOfConstituents=new int[1] ;
318       _numberOfConstituents[0]=4 ;
319       _numberOfNodeOfEachConstituent=new (int*)[1] ;
320       _numberOfNodeOfEachConstituent[0]=new (int)[4] ;
321       _numberOfNodeOfEachConstituent[0][0]=3 ;
322       _numberOfNodeOfEachConstituent[0][1]=3 ;
323       _numberOfNodeOfEachConstituent[0][2]=3 ;
324       _numberOfNodeOfEachConstituent[0][3]=3 ;
325
326       int* _edge1=new int[3];
327       _edge1[0]=1;
328       _edge1[1]=2;
329       _edge1[2]=5;
330       int* _edge2=new int[3];
331       _edge2[0]=2;
332       _edge2[1]=3;
333       _edge2[2]=6;
334       int* _edge3=new int[3];
335       _edge3[0]=3;
336       _edge3[1]=4;
337       _edge3[2]=7;
338       int* _edge4=new int[3];
339       _edge4[0]=4;
340       _edge4[1]=1;
341       _edge4[2]=8;
342       int ** tmpConstituents1 = new (int*)[4];
343       tmpConstituents1[0]=_edge1 ;
344       tmpConstituents1[1]=_edge2 ;
345       tmpConstituents1[2]=_edge3 ;
346       tmpConstituents1[3]=_edge4 ;
347       _constituents = new int**[1] ;
348       _constituents[0]=tmpConstituents1 ;
349 //       vector<medGeometryElement> vector_edge_type(4,MED_SEG3) ;
350 //       vector<medGeometryElement> vector_type(8,MED_POINT1) ;
351 //       vector<medGeometryElement> __constituents_type[]={vector_edge_type,vector_type};
352 //       vector< vector<medGeometryElement> > _constituents_type(__constituents_type,__constituents_type+2) ;
353 //       _constituentsType = _constituents_type ;
354       //_constituentsType={{MED_SEG3,MED_SEG3,MED_SEG3,MED_SEG3},{MED_POINT1,MED_POINT1,MED_POINT1,MED_POINT1,MED_POINT1,MED_POINT1,MED_POINT1,MED_POINT1} ;
355       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
356       tmpConstituentsType1[0] = MED_SEG3 ;
357       tmpConstituentsType1[1] = MED_SEG3 ;
358       tmpConstituentsType1[2] = MED_SEG3 ;
359       tmpConstituentsType1[3] = MED_SEG3 ;
360       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[4] ;
361       tmpConstituentsType2[0] = MED_POINT1 ;
362       tmpConstituentsType2[1] = MED_POINT1 ;
363       tmpConstituentsType2[2] = MED_POINT1 ;
364       tmpConstituentsType2[3] = MED_POINT1 ;
365       tmpConstituentsType2[4] = MED_POINT1 ;
366       tmpConstituentsType2[5] = MED_POINT1 ;
367       tmpConstituentsType2[6] = MED_POINT1 ;
368       tmpConstituentsType2[7] = MED_POINT1 ;
369       _constituentsType = new medGeometryElement*[2] ;
370       _constituentsType[0]=tmpConstituentsType1 ;
371       _constituentsType[1]=tmpConstituentsType2 ;
372       // Well, point are defined, but could not be acces because we have 
373       // only 1 numberOfConstituentsDimension !
374
375       break;
376     }
377     case MED_TETRA4  : {
378       _name="MED_TETRA4" ;
379       _type=t;
380       _dimension=3;
381       _numberOfVertexes=4;
382       _numberOfNodes=4;
383 //       int _edge1[]={1,2} ;
384 //       int _edge2[]={2,3} ;
385 //       int _edge3[]={3,1} ;
386 //       int _edge4[]={1,4} ;
387 //       int _edge5[]={2,4} ;
388 //       int _edge6[]={3,4} ;
389 //       vector<int> edge1(_edge1,_edge1+2) ;
390 //       vector<int> edge2(_edge2,_edge2+2) ;
391 //       vector<int> edge3(_edge3,_edge3+2) ;
392 //       vector<int> edge4(_edge4,_edge4+2) ;
393 //       vector<int> edge5(_edge5,_edge5+2) ;
394 //       vector<int> edge6(_edge6,_edge6+2) ;
395 //       vector<int> _vector_edge[]={edge1,edge2,edge3,edge4,edge5,edge6};
396 //       vector< vector<int> > vector_edge(_vector_edge,_vector_edge+6) ;
397 //       int _face1[]={1,2,3} ;
398 //       int _face2[]={1,4,2} ;
399 //       int _face3[]={2,4,3} ;
400 //       int _face4[]={3,4,1} ;
401 //       vector<int> face1(_face1,_face1+3) ;
402 //       vector<int> face2(_face2,_face2+3) ;
403 //       vector<int> face3(_face3,_face3+3) ;
404 //       vector<int> face4(_face4,_face4+3) ;
405 //       vector<int> _vector_face[] = {face1,face2,face3,face4} ;
406 //       vector< vector<int> > vector_face(_vector_face,_vector_face+4) ;
407 //       vector< vector<int> > __constituents__[]={vector_face,vector_edge};
408 //       vector< vector< vector<int> > > _constituents_(__constituents__,__constituents__+2) ;
409 //       _constituents = _constituents_ ;
410       //_constituents={{{1,2,3},{1,4,2},{2,4,3},{3,4,1}},{{1,2},{2,3},{3,1},{1,4},{2,4},{3,4}}} ;
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]=3 ;
418       _numberOfNodeOfEachConstituent[0][1]=3 ;
419       _numberOfNodeOfEachConstituent[0][2]=3 ;
420       _numberOfNodeOfEachConstituent[0][3]=3 ;
421       _numberOfNodeOfEachConstituent[1]=new (int)[6] ;
422       _numberOfNodeOfEachConstituent[1][0]=2 ;
423       _numberOfNodeOfEachConstituent[1][1]=2 ;
424       _numberOfNodeOfEachConstituent[1][2]=2 ;
425       _numberOfNodeOfEachConstituent[1][3]=2 ;
426       _numberOfNodeOfEachConstituent[1][4]=2 ;
427       _numberOfNodeOfEachConstituent[1][5]=2 ;
428
429       int* _face1=new int[3];
430       _face1[0]=1;
431       _face1[1]=2;
432       _face1[2]=3;
433       int* _face2=new int[3];
434       _face2[0]=1;
435       _face2[1]=4;
436       _face2[2]=2;
437       int* _face3=new int[3];
438       _face3[0]=2;
439       _face3[1]=4;
440       _face3[2]=3;
441       int* _face4=new int[3];
442       _face4[0]=3;
443       _face4[1]=4;
444       _face4[2]=1;
445       int* _edge1=new int[2];
446       _edge1[0]=1;
447       _edge1[1]=2;
448       int* _edge2=new int[2];
449       _edge2[0]=2;
450       _edge2[1]=3;
451       int* _edge3=new int[2];
452       _edge3[0]=3;
453       _edge3[1]=1;
454       int* _edge4=new int[2];
455       _edge4[0]=1;
456       _edge4[1]=4;
457       int* _edge5=new int[2];
458       _edge5[0]=2;
459       _edge5[1]=4;
460       int* _edge6=new int[2];
461       _edge6[0]=3;
462       _edge6[1]=4;
463       int ** tmpConstituents1 = new (int*)[4];
464       tmpConstituents1[0]=_face1 ;
465       tmpConstituents1[1]=_face2 ;
466       tmpConstituents1[2]=_face3 ;
467       tmpConstituents1[3]=_face4 ;
468       int ** tmpConstituents2 = new (int*)[6];
469       tmpConstituents2[0]=_edge1 ;
470       tmpConstituents2[1]=_edge2 ;
471       tmpConstituents2[2]=_edge3 ;
472       tmpConstituents2[3]=_edge4 ;
473       tmpConstituents2[4]=_edge5 ;
474       tmpConstituents2[5]=_edge6 ;
475       _constituents = new int**[2] ;
476       _constituents[0]=tmpConstituents1 ;
477       _constituents[1]=tmpConstituents2 ;
478 //       vector<medGeometryElement> vector_edge_type(6,MED_SEG2) ;
479 //       vector<medGeometryElement> vector_face_type(4,MED_TRIA3) ;
480 //       vector<medGeometryElement> __constituents_type[]={vector_face_type,vector_edge_type};
481 //       vector< vector<medGeometryElement> > _constituents_type(__constituents_type,__constituents_type+2) ;
482 //       _constituentsType = _constituents_type ;
483       //_constituentsType={{MED_TRIA3,MED_TRIA3,MED_TRIA3,MED_TRIA3}{MED_SEG2,MED_SEG2,MED_SEG2,MED_SEG2,MED_SEG2,MED_SEG2}} ;
484       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
485       tmpConstituentsType1[0] = MED_TRIA3 ;
486       tmpConstituentsType1[1] = MED_TRIA3 ;
487       tmpConstituentsType1[2] = MED_TRIA3 ;
488       tmpConstituentsType1[3] = MED_TRIA3 ;
489       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[6] ;
490       tmpConstituentsType2[0] = MED_SEG2 ;
491       tmpConstituentsType2[1] = MED_SEG2 ;
492       tmpConstituentsType2[2] = MED_SEG2 ;
493       tmpConstituentsType2[3] = MED_SEG2 ;
494       tmpConstituentsType2[4] = MED_SEG2 ;
495       tmpConstituentsType2[5] = MED_SEG2 ;
496       _constituentsType = new medGeometryElement*[2] ;
497       _constituentsType[0]=tmpConstituentsType1 ;
498       _constituentsType[1]=tmpConstituentsType2 ;
499       break;
500     }
501     case MED_TETRA10 : {
502       _name="MED_TETRA10" ;
503       _type=t;
504       _dimension=3;
505       _numberOfVertexes=4;
506       _numberOfNodes=10;
507 //       int _edge1[]={1,2,5} ;
508 //       int _edge2[]={2,3,6} ;
509 //       int _edge3[]={3,1,7} ;
510 //       int _edge4[]={1,4,8} ;
511 //       int _edge5[]={2,4,9} ;
512 //       int _edge6[]={3,4,10} ;
513 //       vector<int> edge1(_edge1,_edge1+3) ;
514 //       vector<int> edge2(_edge2,_edge2+3) ;
515 //       vector<int> edge3(_edge3,_edge3+3) ;
516 //       vector<int> edge4(_edge4,_edge4+3) ;
517 //       vector<int> edge5(_edge5,_edge5+3) ;
518 //       vector<int> edge6(_edge6,_edge6+3) ;
519 //       vector<int> _vector_edge[]={edge1,edge2,edge3,edge4,edge5,edge6};
520 //       vector< vector<int> > vector_edge(_vector_edge,_vector_edge+6) ;
521 //       int _face1[]={1,2,3,5,6,7} ;
522 //       int _face2[]={1,4,2,8,9,5} ;
523 //       int _face3[]={2,4,3,9,10,6} ;
524 //       int _face4[]={3,4,1,10,8,7} ;
525 //       vector<int> face1(_face1,_face1+6) ;
526 //       vector<int> face2(_face2,_face2+6) ;
527 //       vector<int> face3(_face3,_face3+6) ;
528 //       vector<int> face4(_face4,_face4+6) ;
529 //       vector<int> _vector_face[] = {face1,face2,face3,face4} ;
530 //       vector< vector<int> > vector_face(_vector_face,_vector_face+4) ;
531 //       vector< vector<int> > __constituents__[]={vector_face,vector_edge};
532 //       vector< vector< vector<int> > > _constituents_(__constituents__,__constituents__+2) ;
533 //       _constituents = _constituents_ ;
534       //_constituents={{{1,2,3,5,6,7},{1,4,2,8,9,5},{2,4,3,9,10,6},{3,4,1,10,8,7}},{{1,2,5},{2,3,6},{3,1,7},{1,4,8},{2,4,9},{3,4,10}}} ;
535       _numberOfConstituentsDimension=2 ;
536       _numberOfConstituents=new int[2] ;
537       _numberOfConstituents[0]=4 ;
538       _numberOfConstituents[1]=6 ;
539       _numberOfNodeOfEachConstituent=new (int*)[2] ;
540       _numberOfNodeOfEachConstituent[0]=new (int)[4] ;
541       _numberOfNodeOfEachConstituent[0][0]=6 ;
542       _numberOfNodeOfEachConstituent[0][1]=6 ;
543       _numberOfNodeOfEachConstituent[0][2]=6 ;
544       _numberOfNodeOfEachConstituent[0][3]=6 ;
545       _numberOfNodeOfEachConstituent[1]=new (int)[6] ;
546       _numberOfNodeOfEachConstituent[1][0]=3 ;
547       _numberOfNodeOfEachConstituent[1][1]=3 ;
548       _numberOfNodeOfEachConstituent[1][2]=3 ;
549       _numberOfNodeOfEachConstituent[1][3]=3 ;
550       _numberOfNodeOfEachConstituent[1][4]=3 ;
551       _numberOfNodeOfEachConstituent[1][5]=3 ;
552
553       int* _face1=new int[6];
554       _face1[0]=1;
555       _face1[1]=2;
556       _face1[2]=3;
557       _face1[3]=5;
558       _face1[4]=6;
559       _face1[5]=7;
560       int* _face2=new int[6];
561       _face2[0]=1;
562       _face2[1]=4;
563       _face2[2]=2;
564       _face2[3]=8;
565       _face2[4]=9;
566       _face2[5]=5;
567       int* _face3=new int[6];
568       _face3[0]=2;
569       _face3[1]=4;
570       _face3[2]=3;
571       _face3[3]=9;
572       _face3[4]=10;
573       _face3[5]=6;
574       int* _face4=new int[6];
575       _face4[0]=3;
576       _face4[1]=4;
577       _face4[2]=1;
578       _face4[3]=10;
579       _face4[4]=8;
580       _face4[5]=7;
581       int* _edge1=new int[3];
582       _edge1[0]=1;
583       _edge1[1]=2;
584       _edge1[2]=5;
585       int* _edge2=new int[3];
586       _edge2[0]=2;
587       _edge2[1]=3;
588       _edge2[2]=6;
589       int* _edge3=new int[3];
590       _edge3[0]=3;
591       _edge3[1]=1;
592       _edge3[2]=7;
593       int* _edge4=new int[3];
594       _edge4[0]=1;
595       _edge4[1]=4;
596       _edge4[2]=8;
597       int* _edge5=new int[3];
598       _edge5[0]=2;
599       _edge5[1]=4;
600       _edge5[2]=9;
601       int* _edge6=new int[3];
602       _edge6[0]=3;
603       _edge6[1]=4;
604       _edge6[2]=10;
605       int ** tmpConstituents1 = new (int*)[4];
606       tmpConstituents1[0]=_face1 ;
607       tmpConstituents1[1]=_face2 ;
608       tmpConstituents1[2]=_face3 ;
609       tmpConstituents1[3]=_face4 ;
610       int ** tmpConstituents2 = new (int*)[6];
611       tmpConstituents2[0]=_edge1 ;
612       tmpConstituents2[1]=_edge2 ;
613       tmpConstituents2[2]=_edge3 ;
614       tmpConstituents2[3]=_edge4 ;
615       tmpConstituents2[4]=_edge5 ;
616       tmpConstituents2[5]=_edge6 ;
617       _constituents = new int**[2] ;
618       _constituents[0]=tmpConstituents1 ;
619       _constituents[1]=tmpConstituents2 ;
620 //       vector<medGeometryElement> vector_edge_type(6,MED_SEG3) ;
621 //       vector<medGeometryElement> vector_face_type(4,MED_TRIA6) ;
622 //       vector<medGeometryElement> __constituents_type[]={vector_face_type,vector_edge_type};
623 //       vector< vector<medGeometryElement> > _constituents_type(__constituents_type,__constituents_type+2) ;
624 //       _constituentsType = _constituents_type ;
625       //_constituentsType={{MED_TRIA6,MED_TRIA6,MED_TRIA6,MED_TRIA6}{MED_SEG3,MED_SEG3,MED_SEG3,MED_SEG3,MED_SEG3,MED_SEG3}} ;
626       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
627       tmpConstituentsType1[0] = MED_TRIA6 ;
628       tmpConstituentsType1[1] = MED_TRIA6 ;
629       tmpConstituentsType1[2] = MED_TRIA6 ;
630       tmpConstituentsType1[3] = MED_TRIA6 ;
631       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[6] ;
632       tmpConstituentsType2[0] = MED_SEG3 ;
633       tmpConstituentsType2[1] = MED_SEG3 ;
634       tmpConstituentsType2[2] = MED_SEG3 ;
635       tmpConstituentsType2[3] = MED_SEG3 ;
636       tmpConstituentsType2[4] = MED_SEG3 ;
637       tmpConstituentsType2[5] = MED_SEG3 ;
638       _constituentsType = new medGeometryElement*[2] ;
639       _constituentsType[0]=tmpConstituentsType1 ;
640       _constituentsType[1]=tmpConstituentsType2 ;
641     break;
642     }
643     case MED_HEXA8   : {
644       _name="MED_HEXA8" ;
645       _type=t;
646       _dimension=3;
647       _numberOfVertexes=8;
648       _numberOfNodes=8;
649 //       int _edge1[]={1,2} ;
650 //       int _edge2[]={2,3} ;
651 //       int _edge3[]={3,4} ;
652 //       int _edge4[]={4,1} ;
653 //       int _edge5[]={5,6} ;
654 //       int _edge6[]={6,7} ;
655 //       int _edge7[]={7,8} ;
656 //       int _edge8[]={8,5} ;
657 //       int _edge9[]={1,5} ;
658 //       int _edge10[]={2,6} ;
659 //       int _edge11[]={3,7} ;
660 //       int _edge12[]={4,8} ;
661 //       vector<int> edge1(_edge1,_edge1+2) ;
662 //       vector<int> edge2(_edge2,_edge2+2) ;
663 //       vector<int> edge3(_edge3,_edge3+2) ;
664 //       vector<int> edge4(_edge4,_edge4+2) ;
665 //       vector<int> edge5(_edge5,_edge5+2) ;
666 //       vector<int> edge6(_edge6,_edge6+2) ;
667 //       vector<int> edge7(_edge7,_edge7+2) ;
668 //       vector<int> edge8(_edge8,_edge8+2) ;
669 //       vector<int> edge9(_edge9,_edge9+2) ;
670 //       vector<int> edge10(_edge10,_edge10+2) ;
671 //       vector<int> edge11(_edge11,_edge11+2) ;
672 //       vector<int> edge12(_edge12,_edge12+2) ;
673 //       vector<int> _vector_edge[]={edge1,edge2,edge3,edge4,edge5,edge6,edge7,edge8,edge9,edge10,edge11,edge12};
674 //       vector< vector<int> > vector_edge(_vector_edge,_vector_edge+12) ;
675       _numberOfConstituentsDimension=2 ;
676       _numberOfConstituents=new int[2] ;
677       _numberOfConstituents[0]=6 ;
678       _numberOfConstituents[1]=12 ;
679       _numberOfNodeOfEachConstituent=new (int*)[2] ;
680       _numberOfNodeOfEachConstituent[0]=new (int)[6] ;
681       _numberOfNodeOfEachConstituent[0][0]=4 ;
682       _numberOfNodeOfEachConstituent[0][1]=4 ;
683       _numberOfNodeOfEachConstituent[0][2]=4 ;
684       _numberOfNodeOfEachConstituent[0][3]=4 ;
685       _numberOfNodeOfEachConstituent[0][4]=4 ;
686       _numberOfNodeOfEachConstituent[0][5]=4 ;
687       _numberOfNodeOfEachConstituent[1]=new (int)[12] ;
688       _numberOfNodeOfEachConstituent[1][0]=2 ;
689       _numberOfNodeOfEachConstituent[1][1]=2 ;
690       _numberOfNodeOfEachConstituent[1][2]=2 ;
691       _numberOfNodeOfEachConstituent[1][3]=2 ;
692       _numberOfNodeOfEachConstituent[1][4]=2 ;
693       _numberOfNodeOfEachConstituent[1][5]=2 ;
694       _numberOfNodeOfEachConstituent[1][6]=2 ;
695       _numberOfNodeOfEachConstituent[1][7]=2 ;
696       _numberOfNodeOfEachConstituent[1][8]=2 ;
697       _numberOfNodeOfEachConstituent[1][9]=2 ;
698       _numberOfNodeOfEachConstituent[1][10]=2 ;
699       _numberOfNodeOfEachConstituent[1][11]=2 ;
700
701       int* _edge1=new int[2];
702       _edge1[0]=1;
703       _edge1[1]=2;
704       int* _edge2=new int[2];
705       _edge2[0]=2;
706       _edge2[1]=3;
707       int* _edge3=new int[2];
708       _edge3[0]=3;
709       _edge3[1]=4;
710       int* _edge4=new int[2];
711       _edge4[0]=4;
712       _edge4[1]=1;
713       int* _edge5=new int[2];
714       _edge5[0]=5;
715       _edge5[1]=6;
716       int* _edge6=new int[2];
717       _edge6[0]=6;
718       _edge6[1]=7;
719       int* _edge7=new int[2];
720       _edge7[0]=7;
721       _edge7[1]=8;
722       int* _edge8=new int[2];
723       _edge8[0]=8;
724       _edge8[1]=5;
725       int* _edge9=new int[2];
726       _edge9[0]=1;
727       _edge9[1]=5;
728       int* _edge10=new int[2];
729       _edge10[0]=2;
730       _edge10[1]=6;
731       int* _edge11=new int[2];
732       _edge11[0]=3;
733       _edge11[1]=7;
734       int* _edge12=new int[2];
735       _edge12[0]=4;
736       _edge12[1]=8;
737 //       int _face1[]={1,2,3,4} ;
738 //       int _face2[]={5,8,7,6} ;
739 //       int _face3[]={1,5,6,2} ;
740 //       int _face4[]={2,6,7,3} ;
741 //       int _face5[]={3,7,8,4} ;
742 //       int _face6[]={4,8,5,1} ;
743 //       vector<int> face1(_face1,_face1+4) ;
744 //       vector<int> face2(_face2,_face2+4) ;
745 //       vector<int> face3(_face3,_face3+4) ;
746 //       vector<int> face4(_face4,_face4+4) ;
747 //       vector<int> face5(_face5,_face5+4) ;
748 //       vector<int> face6(_face6,_face6+4) ;
749 //       vector<int> _vector_face[] = {face1,face2,face3,face4,face5,face6} ;
750 //       vector< vector<int> > vector_face(_vector_face,_vector_face+6) ;
751 //       vector< vector<int> > __constituents__[]={vector_face,vector_edge};
752 //       vector< vector< vector<int> > > _constituents_(__constituents__,__constituents__+2) ;
753 //       _constituents = _constituents_ ;
754       int* _face1=new int[4];
755       _face1[0]=1;
756       _face1[1]=2;
757       _face1[2]=3;
758       _face1[3]=4;
759       int* _face2=new int[4];
760       _face2[0]=5;
761       _face2[1]=8;
762       _face2[2]=7;
763       _face2[3]=6;
764       int* _face3=new int[4];
765       _face3[0]=1;
766       _face3[1]=5;
767       _face3[2]=6;
768       _face3[3]=2;
769       int* _face4=new int[4];
770       _face4[0]=2;
771       _face4[1]=6;
772       _face4[2]=7;
773       _face4[3]=3;
774       int* _face5=new int[4];
775       _face5[0]=3;
776       _face5[1]=7;
777       _face5[2]=8;
778       _face5[3]=4;
779      int* _face6=new int[4];
780       _face6[0]=4;
781       _face6[1]=8;
782       _face6[2]=5;
783       _face6[3]=1;
784       int ** tmpConstituents1 = new (int*)[6];
785       tmpConstituents1[0]=_face1 ;
786       tmpConstituents1[1]=_face2 ;
787       tmpConstituents1[2]=_face3 ;
788       tmpConstituents1[3]=_face4 ;
789       tmpConstituents1[4]=_face5 ;
790       tmpConstituents1[5]=_face6 ;
791       int ** tmpConstituents2 = new (int*)[12];
792       tmpConstituents2[0]=_edge1 ;
793       tmpConstituents2[1]=_edge2 ;
794       tmpConstituents2[2]=_edge3 ;
795       tmpConstituents2[3]=_edge4 ;
796       tmpConstituents2[4]=_edge5 ;
797       tmpConstituents2[5]=_edge6 ;
798       tmpConstituents2[6]=_edge7 ;
799       tmpConstituents2[7]=_edge8 ;
800       tmpConstituents2[8]=_edge9 ;
801       tmpConstituents2[9]=_edge10;
802       tmpConstituents2[10]=_edge11;
803       tmpConstituents2[11]=_edge12;
804       _constituents = new int**[2] ;
805       _constituents[0]=tmpConstituents1 ;
806       _constituents[1]=tmpConstituents2 ;
807 //       vector<medGeometryElement> vector_edge_type(12,MED_SEG2) ;
808 //       vector<medGeometryElement> vector_face_type(6,MED_QUAD4) ;
809 //       vector<medGeometryElement> __constituents_type[]={vector_face_type,vector_edge_type};
810 //       vector< vector<medGeometryElement> > _constituents_type(__constituents_type,__constituents_type+2);
811 //       _constituentsType = _constituents_type ;
812       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[6] ;
813       tmpConstituentsType1[0] = MED_QUAD4 ;
814       tmpConstituentsType1[1] = MED_QUAD4 ;
815       tmpConstituentsType1[2] = MED_QUAD4 ;
816       tmpConstituentsType1[3] = MED_QUAD4 ;
817       tmpConstituentsType1[4] = MED_QUAD4 ;
818       tmpConstituentsType1[5] = MED_QUAD4 ;
819       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[12] ;
820       tmpConstituentsType2[0] = MED_SEG2 ;
821       tmpConstituentsType2[1] = MED_SEG2 ;
822       tmpConstituentsType2[2] = MED_SEG2 ;
823       tmpConstituentsType2[3] = MED_SEG2 ;
824       tmpConstituentsType2[4] = MED_SEG2 ;
825       tmpConstituentsType2[5] = MED_SEG2 ;
826       tmpConstituentsType2[6] = MED_SEG2 ;
827       tmpConstituentsType2[7] = MED_SEG2 ;
828       tmpConstituentsType2[8] = MED_SEG2 ;
829       tmpConstituentsType2[9] = MED_SEG2 ;
830       tmpConstituentsType2[10] = MED_SEG2 ;
831       tmpConstituentsType2[11] = MED_SEG2 ;
832       _constituentsType = new medGeometryElement*[2] ;
833       _constituentsType[0]=tmpConstituentsType1 ;
834       _constituentsType[1]=tmpConstituentsType2 ;
835       break;
836     }
837     case MED_HEXA20  : {
838       _name="MED_HEXA20" ;
839       _type=t;
840       _dimension=3;
841       _numberOfVertexes=8;
842       _numberOfNodes=20;
843
844 //       int _edge1[]={1,2,9} ;
845 //       int _edge2[]={2,3,10} ;
846 //       int _edge3[]={3,4,11} ;
847 //       int _edge4[]={4,1,12} ;
848 //       int _edge5[]={5,6,13} ;
849 //       int _edge6[]={6,7,14};
850 //       int _edge7[]={7,8,15} ; 
851 //       int _edge8[]={8,5,16} ;
852 //       int _edge9[]={1,5,17} ;
853 //       int _edge10[]={2,6,18} ;
854 //       int _edge11[]={3,7,19} ;
855 //       int _edge12[]={4,8,20} ;
856
857 //       vector<int> edge1(_edge1,_edge1+3) ;
858 //       vector<int> edge2(_edge2,_edge2+3) ;
859 //       vector<int> edge3(_edge3,_edge3+3) ;
860 //       vector<int> edge4(_edge4,_edge4+3) ;
861 //       vector<int> edge5(_edge5,_edge5+3) ;
862 //       vector<int> edge6(_edge6,_edge6+3) ;
863 //       vector<int> edge7(_edge7,_edge7+3) ;
864 //       vector<int> edge8(_edge8,_edge8+3) ;
865 //       vector<int> edge9(_edge9,_edge9+3) ;
866 //       vector<int> edge10(_edge10,_edge10+3) ;
867 //       vector<int> edge11(_edge11,_edge11+3) ;
868 //       vector<int> edge12(_edge12,_edge12+3) ;       
869 //       vector<int> _vector_edge[]={edge1,edge2,edge3,edge4,edge5,edge6,edge7,edge8,edge9,edge10, edge11,edge12};
870 //       vector< vector<int> > vector_edge(_vector_edge,_vector_edge+12) ;
871
872 //       int _face1[]={1,2,3,4,9,10,11,12} ;
873 //       int _face2[]={5,8,7,6,16,15,14,13} ;
874 //       int _face3[]={1,5,6,2,17,13,18,9} ;
875 //       int _face4[]={2,6,7,3,18,14,19,10} ;
876 //       int _face5[]={3,7,8,4,19,15,20,11} ;
877 //       int _face6[]={4,8,5,1,20,16,17,12} ;
878 //       vector<int> face1(_face1,_face1+8);
879 //       vector<int> face2(_face2,_face2+8);
880 //       vector<int> face3(_face3,_face3+8);
881 //       vector<int> face4(_face4,_face4+8);
882 //       vector<int> face5(_face5,_face5+8);
883 //       vector<int> face6(_face6,_face6+8);
884 //       vector<int> _vector_face[]= {face1,face2,face3,face4,face5,face6} ;
885 //       vector< vector<int> > vector_face(_vector_face,_vector_face+6);
886
887 //       vector< vector<int> > __constituents__[]={vector_face,vector_edge};
888 //       vector< vector< vector<int> > > _constituents_(__constituents__,__constituents__+2) ; 
889 //       _constituents = _constituents_ ;
890       _numberOfConstituentsDimension=2 ;
891       _numberOfConstituents=new int[2] ;
892       _numberOfConstituents[0]=6 ;
893       _numberOfConstituents[1]=12 ;
894       _numberOfNodeOfEachConstituent=new (int*)[2] ;
895       _numberOfNodeOfEachConstituent[0]=new (int)[6] ;
896       _numberOfNodeOfEachConstituent[0][0]=8 ;
897       _numberOfNodeOfEachConstituent[0][1]=8 ;
898       _numberOfNodeOfEachConstituent[0][2]=8 ;
899       _numberOfNodeOfEachConstituent[0][3]=8 ;
900       _numberOfNodeOfEachConstituent[0][4]=8 ;
901       _numberOfNodeOfEachConstituent[0][5]=8 ;
902       _numberOfNodeOfEachConstituent[1]=new (int)[12] ;
903       _numberOfNodeOfEachConstituent[1][0]=3 ;
904       _numberOfNodeOfEachConstituent[1][1]=3 ;
905       _numberOfNodeOfEachConstituent[1][2]=3 ;
906       _numberOfNodeOfEachConstituent[1][3]=3 ;
907       _numberOfNodeOfEachConstituent[1][4]=3 ;
908       _numberOfNodeOfEachConstituent[1][5]=3 ;
909       _numberOfNodeOfEachConstituent[1][6]=3 ;
910       _numberOfNodeOfEachConstituent[1][7]=3 ;
911       _numberOfNodeOfEachConstituent[1][8]=3 ;
912       _numberOfNodeOfEachConstituent[1][9]=3 ;
913       _numberOfNodeOfEachConstituent[1][10]=3 ;
914       _numberOfNodeOfEachConstituent[1][11]=3 ;
915
916       int* _edge1=new int[3];
917       _edge1[0]=1;
918       _edge1[1]=2;
919       _edge1[1]=9;
920       int* _edge2=new int[3];
921       _edge2[0]=2;
922       _edge2[1]=3;
923       _edge2[1]=10;
924       int* _edge3=new int[3];
925       _edge3[0]=3;
926       _edge3[1]=4;
927       _edge3[2]=11;
928       int* _edge4=new int[3];
929       _edge4[0]=4;
930       _edge4[1]=1;
931       _edge4[2]=12;
932       int* _edge5=new int[3];
933       _edge5[0]=5;
934       _edge5[1]=6;
935       _edge5[2]=13;
936       int* _edge6=new int[3];
937       _edge6[0]=6;
938       _edge6[1]=7;
939       _edge6[2]=14;
940       int* _edge7=new int[3];
941       _edge7[0]=7;
942       _edge7[1]=8;
943       _edge7[2]=15;
944       int* _edge8=new int[3];
945       _edge8[0]=8;
946       _edge8[1]=5;
947       _edge8[2]=16;
948       int* _edge9=new int[3];
949       _edge9[0]=1;
950       _edge9[1]=5;
951       _edge9[2]=17;
952       int* _edge10=new int[3];
953       _edge10[0]=2;
954       _edge10[1]=6;
955       _edge10[2]=18;
956       int* _edge11=new int[3];
957       _edge11[0]=3;
958       _edge11[1]=7;
959       _edge11[2]=19;
960       int* _edge12=new int[3];
961       _edge12[0]=4;
962       _edge12[1]=8;
963       _edge12[2]=20;
964       int* _face1=new int[8];
965       _face1[0]=1;
966       _face1[1]=2;
967       _face1[2]=3;
968       _face1[3]=4;
969       _face1[4]=9;
970       _face1[5]=10;
971       _face1[6]=11;
972       _face1[7]=12;
973       int* _face2=new int[8];
974       _face2[0]=5;
975       _face2[1]=8;
976       _face2[2]=7;
977       _face2[3]=6;
978       _face2[4]=16;
979       _face2[5]=15;
980       _face2[6]=14;
981       _face2[7]=13;
982       int* _face3=new int[8];
983       _face3[0]=1;
984       _face3[1]=5;
985       _face3[2]=6;
986       _face3[3]=2;
987       _face3[4]=17;
988       _face3[5]=13;
989       _face3[6]=18;
990       _face3[7]=9;
991       int* _face4=new int[8];
992       _face4[0]=2;
993       _face4[1]=6;
994       _face4[2]=7;
995       _face4[3]=3;
996       _face4[4]=18;
997       _face4[5]=14;
998       _face4[6]=19;
999       _face4[7]=10;
1000       int* _face5=new int[8];
1001       _face5[0]=3;
1002       _face5[1]=7;
1003       _face5[2]=8;
1004       _face5[3]=4;
1005       _face5[4]=19;
1006       _face5[5]=15;
1007       _face5[6]=20;
1008       _face5[7]=11;
1009      int* _face6=new int[8];
1010       _face6[0]=4;
1011       _face6[1]=8;
1012       _face6[2]=5;
1013       _face6[3]=1;
1014       _face6[4]=20;
1015       _face6[5]=16;
1016       _face6[6]=17;
1017       _face6[7]=12;
1018       int ** tmpConstituents1 = new (int*)[6];
1019       tmpConstituents1[0]=_face1 ;
1020       tmpConstituents1[1]=_face2 ;
1021       tmpConstituents1[2]=_face3 ;
1022       tmpConstituents1[3]=_face4 ;
1023       tmpConstituents1[4]=_face5 ;
1024       tmpConstituents1[5]=_face6 ;
1025       int ** tmpConstituents2 = new (int*)[12];
1026       tmpConstituents2[0]=_edge1 ;
1027       tmpConstituents2[1]=_edge2 ;
1028       tmpConstituents2[2]=_edge3 ;
1029       tmpConstituents2[3]=_edge4 ;
1030       tmpConstituents2[4]=_edge5 ;
1031       tmpConstituents2[5]=_edge6 ;
1032       tmpConstituents2[6]=_edge7 ;
1033       tmpConstituents2[7]=_edge8 ;
1034       tmpConstituents2[8]=_edge9 ;
1035       tmpConstituents2[9]=_edge10;
1036       tmpConstituents2[10]=_edge11;
1037       tmpConstituents2[11]=_edge12;
1038       _constituents = new int**[2] ;
1039       _constituents[0]=tmpConstituents1 ;
1040       _constituents[1]=tmpConstituents2 ;
1041 //       vector<medGeometryElement> vector_edge_type(12,MED_SEG3) ;
1042 //       vector<medGeometryElement> vector_face_type(6,MED_QUAD8) ;
1043 //       vector<medGeometryElement> __constituents_type[]={vector_face_type,vector_edge_type};
1044 //       vector< vector<medGeometryElement> > _constituents_type(__constituents_type,__constituents_type+2) ;
1045 //       _constituentsType = _constituents_type ;
1046       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[6] ;
1047       tmpConstituentsType1[0] = MED_QUAD8 ;
1048       tmpConstituentsType1[1] = MED_QUAD8 ;
1049       tmpConstituentsType1[2] = MED_QUAD8 ;
1050       tmpConstituentsType1[3] = MED_QUAD8 ;
1051       tmpConstituentsType1[4] = MED_QUAD8 ;
1052       tmpConstituentsType1[5] = MED_QUAD8 ;
1053       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[12] ;
1054       tmpConstituentsType2[0] = MED_SEG3 ;
1055       tmpConstituentsType2[1] = MED_SEG3 ;
1056       tmpConstituentsType2[2] = MED_SEG3 ;
1057       tmpConstituentsType2[3] = MED_SEG3 ;
1058       tmpConstituentsType2[4] = MED_SEG3 ;
1059       tmpConstituentsType2[5] = MED_SEG3 ;
1060       tmpConstituentsType2[6] = MED_SEG3 ;
1061       tmpConstituentsType2[7] = MED_SEG3 ;
1062       tmpConstituentsType2[8] = MED_SEG3 ;
1063       tmpConstituentsType2[9] = MED_SEG3 ;
1064       tmpConstituentsType2[10] = MED_SEG3 ;
1065       tmpConstituentsType2[11] = MED_SEG3 ;
1066       _constituentsType = new medGeometryElement*[2] ;
1067       _constituentsType[0]=tmpConstituentsType1 ;
1068       _constituentsType[1]=tmpConstituentsType2 ;
1069       break;
1070     }
1071     case MED_PENTA6  : {
1072       _name="MED_PENTA6" ;
1073       _type=t;
1074       _dimension=3;
1075       _numberOfVertexes=6;
1076       _numberOfNodes=6;
1077
1078 //       int _edge1[]= {1,2} ;
1079 //       int _edge2[]= {2,3} ;
1080 //       int _edge3[]= {3,1} ;
1081 //       int _edge4[]= {4,5} ;
1082 //       int _edge5[]= {5,6} ;
1083 //       int _edge6[]= {6,4} ;
1084 //       int _edge7[]= {1,4} ;
1085 //       int _edge8[]= {2,5} ;
1086 //       int _edge9[]= {3,6} ;
1087
1088 //       vector<int> edge1(_edge1,_edge1+2) ;
1089 //       vector<int> edge2(_edge2,_edge2+2) ;
1090 //       vector<int> edge3(_edge3,_edge3+2) ;
1091 //       vector<int> edge4(_edge4,_edge4+2) ;
1092 //       vector<int> edge5(_edge5,_edge5+2) ;
1093 //       vector<int> edge6(_edge6,_edge6+2) ;
1094 //       vector<int> edge7(_edge7,_edge7+2) ;
1095 //       vector<int> edge8(_edge8,_edge8+2) ;
1096 //       vector<int> edge9(_edge9,_edge9+2) ;    
1097 //       vector<int> _vector_edge[]={edge1,edge2,edge3,edge4,edge5,edge6,edge7,edge8,edge9};
1098 //       vector< vector<int> > vector_edge(_vector_edge,_vector_edge+9) ;
1099
1100 //       int _face1[]={1,2,3};
1101 //       int _face2[]={4,6,5};
1102 //       int _face3[]={1,4,5,2};
1103 //       int _face4[]={2,5,6,3};
1104 //       int _face5[]={3,6,4,1};
1105 //       vector<int> face1(_face1,_face1+3);
1106 //       vector<int> face2(_face2,_face2+3);
1107 //       vector<int> face3(_face3,_face3+4);
1108 //       vector<int> face4(_face4,_face4+4);
1109 //       vector<int> face5(_face5,_face5+4);
1110 //       vector<int> _vector_face[]= {face1,face2,face3,face4,face5} ;
1111 //       vector< vector<int> > vector_face(_vector_face,_vector_face+5);
1112  
1113 //       vector< vector<int> > __constituents__[]={vector_face,vector_edge};
1114 //       vector< vector< vector<int> > > _constituents_(__constituents__,__constituents__+2) ;
1115 //       _constituents = _constituents_ ;
1116       _numberOfConstituentsDimension=2 ;
1117       _numberOfConstituents=new int[2] ;
1118       _numberOfConstituents[0]=5 ;
1119       _numberOfConstituents[1]=9 ;
1120       _numberOfNodeOfEachConstituent=new (int*)[2] ;
1121       _numberOfNodeOfEachConstituent[0]=new (int)[5] ;
1122       _numberOfNodeOfEachConstituent[0][0]=3 ;
1123       _numberOfNodeOfEachConstituent[0][1]=3 ;
1124       _numberOfNodeOfEachConstituent[0][2]=4 ;
1125       _numberOfNodeOfEachConstituent[0][3]=4 ;
1126       _numberOfNodeOfEachConstituent[0][4]=4 ;
1127       _numberOfNodeOfEachConstituent[1]=new (int)[9] ;
1128       _numberOfNodeOfEachConstituent[1][0]=2 ;
1129       _numberOfNodeOfEachConstituent[1][1]=2 ;
1130       _numberOfNodeOfEachConstituent[1][2]=2 ;
1131       _numberOfNodeOfEachConstituent[1][3]=2 ;
1132       _numberOfNodeOfEachConstituent[1][4]=2 ;
1133       _numberOfNodeOfEachConstituent[1][5]=2 ;
1134       _numberOfNodeOfEachConstituent[1][6]=2 ;
1135       _numberOfNodeOfEachConstituent[1][7]=2 ;
1136       _numberOfNodeOfEachConstituent[1][8]=2 ;
1137
1138       int* _edge1=new int[2];
1139       _edge1[0]=1;
1140       _edge1[1]=2;
1141       int* _edge2=new int[2];
1142       _edge2[0]=2;
1143       _edge2[1]=3;
1144       int* _edge3=new int[2];
1145       _edge3[0]=3;
1146       _edge3[1]=1;
1147       int* _edge4=new int[2];
1148       _edge4[0]=4;
1149       _edge4[1]=5;
1150       int* _edge5=new int[2];
1151       _edge5[0]=5;
1152       _edge5[1]=6;
1153       int* _edge6=new int[2];
1154       _edge6[0]=6;
1155       _edge6[1]=4;
1156       int* _edge7=new int[2];
1157       _edge7[0]=1;
1158       _edge7[1]=4;
1159       int* _edge8=new int[2];
1160       _edge8[0]=2;
1161       _edge8[1]=5;
1162       int* _edge9=new int[2];
1163       _edge9[0]=3;
1164       _edge9[1]=6;
1165       int* _face1=new int[3];
1166       _face1[0]=1;
1167       _face1[1]=2;
1168       _face1[2]=3;
1169       int* _face2=new int[3];
1170       _face2[0]=4;
1171       _face2[1]=6;
1172       _face2[2]=5;
1173       int* _face3=new int[4];
1174       _face3[0]=1;
1175       _face3[1]=4;
1176       _face3[2]=5;
1177       _face3[3]=2;
1178       int* _face4=new int[4];
1179       _face4[0]=2;
1180       _face4[1]=5;
1181       _face4[2]=6;
1182       _face4[3]=3;
1183       int* _face5=new int[4];
1184       _face5[0]=3;
1185       _face5[1]=6;
1186       _face5[2]=4;
1187       _face5[3]=1;
1188       int ** tmpConstituents1 = new (int*)[5];
1189       tmpConstituents1[0]=_face1 ;
1190       tmpConstituents1[1]=_face2 ;
1191       tmpConstituents1[2]=_face3 ;
1192       tmpConstituents1[3]=_face4 ;
1193       tmpConstituents1[4]=_face5 ;
1194       int ** tmpConstituents2 = new (int*)[9];
1195       tmpConstituents2[0]=_edge1 ;
1196       tmpConstituents2[1]=_edge2 ;
1197       tmpConstituents2[2]=_edge3 ;
1198       tmpConstituents2[3]=_edge4 ;
1199       tmpConstituents2[4]=_edge5 ;
1200       tmpConstituents2[5]=_edge6 ;
1201       tmpConstituents2[6]=_edge7 ;
1202       tmpConstituents2[7]=_edge8 ;
1203       tmpConstituents2[8]=_edge9 ;
1204       _constituents = new int**[2] ;
1205       _constituents[0]=tmpConstituents1 ;
1206       _constituents[1]=tmpConstituents2 ;
1207 //       vector<medGeometryElement> vector_edge_type(9,MED_SEG2) ;
1208 //       vector<medGeometryElement> vector_face_type(5,MED_QUAD4) ;
1209 //       vector_face_type[0]=MED_TRIA3 ;
1210 //       vector_face_type[1]=MED_TRIA3 ;
1211 //       vector<medGeometryElement> __constituents_type[]={vector_face_type,vector_edge_type};
1212 //       vector< vector<medGeometryElement> > _constituents_type(__constituents_type,__constituents_type+2) ;
1213 //       _constituentsType = _constituents_type ;
1214       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
1215       tmpConstituentsType1[0] = MED_TRIA3 ;
1216       tmpConstituentsType1[1] = MED_TRIA3 ;
1217       tmpConstituentsType1[2] = MED_QUAD4 ;
1218       tmpConstituentsType1[3] = MED_QUAD4 ;
1219       tmpConstituentsType1[4] = MED_QUAD4 ;
1220       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[9] ;
1221       tmpConstituentsType2[0] = MED_SEG2 ;
1222       tmpConstituentsType2[1] = MED_SEG2 ;
1223       tmpConstituentsType2[2] = MED_SEG2 ;
1224       tmpConstituentsType2[3] = MED_SEG2 ;
1225       tmpConstituentsType2[4] = MED_SEG2 ;
1226       tmpConstituentsType2[5] = MED_SEG2 ;
1227       tmpConstituentsType2[6] = MED_SEG2 ;
1228       tmpConstituentsType2[7] = MED_SEG2 ;
1229       tmpConstituentsType2[8] = MED_SEG2 ;
1230       _constituentsType = new medGeometryElement*[2] ;
1231       _constituentsType[0]=tmpConstituentsType1 ;
1232       _constituentsType[1]=tmpConstituentsType2 ;
1233       break;
1234     }
1235     case MED_PENTA15 : {
1236       _name="MED_PENTA15" ;
1237       _type=t;
1238       _dimension=3;
1239       _numberOfVertexes=6;
1240       _numberOfNodes=15;
1241 //       int _edge1[]={1,2,7} ;
1242 //       int _edge2[]={2,3,8} ;
1243 //       int _edge3[]={3,1,9} ;
1244 //       int _edge4[]={4,5,10} ;
1245 //       int _edge5[]={5,6,11} ;
1246 //       int _edge6[]={6,4,12} ;
1247 //       int _edge7[]={1,4,13} ;
1248 //       int _edge8[]={2,5,14} ;
1249 //       int _edge9[]={3,6,15} ;
1250
1251 //       vector<int> edge1(_edge1,_edge1+3) ;
1252 //       vector<int> edge2(_edge2,_edge2+3) ;
1253 //       vector<int> edge3(_edge3,_edge3+3) ;
1254 //       vector<int> edge4(_edge4,_edge4+3) ;
1255 //       vector<int> edge5(_edge5,_edge5+3) ;
1256 //       vector<int> edge6(_edge6,_edge6+3) ;
1257 //       vector<int> edge7(_edge7,_edge7+3) ;
1258 //       vector<int> edge8(_edge8,_edge8+3) ;
1259 //       vector<int> edge9(_edge9,_edge9+3) ;    
1260 //      vector<int> _vector_edge[]={edge1,edge2,edge3,edge4,edge5,edge6,edge7,edge8,edge9};
1261 //       vector< vector<int> > vector_edge(_vector_edge,_vector_edge+9) ;
1262
1263 //       int _face1[]={1,2,3,7,8,9};
1264 //       int _face2[]={4,6,5,12,11,10};
1265 //       int _face3[]={1,4,5,2,13,10,14,7};
1266 //       int _face4[]={2,5,6,3,14,11,15,8};
1267 //       int _face5[]={3,6,4,1,15,12,13,9};
1268 //       vector<int> face1(_face1,_face1+6);
1269 //       vector<int> face2(_face2,_face2+6);
1270 //       vector<int> face3(_face3,_face3+8);
1271 //       vector<int> face4(_face4,_face4+8);
1272 //       vector<int> face5(_face5,_face5+8);
1273 //       vector<int> _vector_face[]= {face1,face2,face3,face4,face5} ;
1274 //       vector< vector<int> > vector_face(_vector_face,_vector_face+5);
1275
1276 //       vector< vector<int> > __constituents__[]={vector_face,vector_edge};
1277 //       vector< vector< vector<int> > > _constituents_(__constituents__,__constituents__+2) ;
1278 //       _constituents = _constituents_ ;
1279       _numberOfConstituentsDimension=2 ;
1280       _numberOfConstituents=new int[2] ;
1281       _numberOfConstituents[0]=5 ;
1282       _numberOfConstituents[1]=9 ;
1283       _numberOfNodeOfEachConstituent=new (int*)[2] ;
1284       _numberOfNodeOfEachConstituent[0]=new (int)[5] ;
1285       _numberOfNodeOfEachConstituent[0][0]=6 ;
1286       _numberOfNodeOfEachConstituent[0][1]=6 ;
1287       _numberOfNodeOfEachConstituent[0][2]=8 ;
1288       _numberOfNodeOfEachConstituent[0][3]=8 ;
1289       _numberOfNodeOfEachConstituent[0][4]=8 ;
1290       _numberOfNodeOfEachConstituent[1]=new (int)[9] ;
1291       _numberOfNodeOfEachConstituent[1][0]=3 ;
1292       _numberOfNodeOfEachConstituent[1][1]=3 ;
1293       _numberOfNodeOfEachConstituent[1][2]=3 ;
1294       _numberOfNodeOfEachConstituent[1][3]=3 ;
1295       _numberOfNodeOfEachConstituent[1][4]=3 ;
1296       _numberOfNodeOfEachConstituent[1][5]=3 ;
1297       _numberOfNodeOfEachConstituent[1][6]=3 ;
1298       _numberOfNodeOfEachConstituent[1][7]=3 ;
1299       _numberOfNodeOfEachConstituent[1][8]=3 ;
1300
1301       int* _edge1=new int[3];
1302       _edge1[0]=1;
1303       _edge1[1]=2;
1304       _edge1[2]=7;
1305       int* _edge2=new int[3];
1306       _edge2[0]=2;
1307       _edge2[1]=3;
1308       _edge2[2]=8;
1309       int* _edge3=new int[3];
1310       _edge3[0]=3;
1311       _edge3[1]=1;
1312       _edge3[2]=9;
1313       int* _edge4=new int[3];
1314       _edge4[0]=4;
1315       _edge4[1]=5;
1316       _edge4[2]=10;
1317       int* _edge5=new int[3];
1318       _edge5[0]=5;
1319       _edge5[1]=6;
1320       _edge5[2]=11;
1321       int* _edge6=new int[3];
1322       _edge6[0]=6;
1323       _edge6[1]=4;
1324       _edge6[2]=12;
1325       int* _edge7=new int[3];
1326       _edge7[0]=1;
1327       _edge7[1]=4;
1328       _edge7[2]=13;
1329       int* _edge8=new int[3];
1330       _edge8[0]=2;
1331       _edge8[1]=5;
1332       _edge8[2]=14;
1333       int* _edge9=new int[3];
1334       _edge9[0]=3;
1335       _edge9[1]=6;
1336       _edge9[2]=15;
1337       int* _face1=new int[6];
1338       _face1[0]=1;
1339       _face1[1]=2;
1340       _face1[2]=3;
1341       _face1[3]=7;
1342       _face1[4]=8;
1343       _face1[5]=9;
1344       int* _face2=new int[6];
1345       _face2[0]=4;
1346       _face2[1]=5;
1347       _face2[2]=6;
1348       _face2[3]=12;
1349       _face2[4]=11;
1350       _face2[5]=10;
1351       int* _face3=new int[8];
1352       _face3[0]=1;
1353       _face3[1]=4;
1354       _face3[2]=5;
1355       _face3[3]=2;
1356       _face3[4]=13;
1357       _face3[5]=10;
1358       _face3[6]=14;
1359       _face3[7]=7;
1360       int* _face4=new int[8];
1361       _face4[0]=2;
1362       _face4[1]=5;
1363       _face4[2]=6;
1364       _face4[3]=3;
1365       _face4[4]=14;
1366       _face4[5]=11;
1367       _face4[6]=15;
1368       _face4[7]=8;
1369       int* _face5=new int[8];
1370       _face5[0]=3;
1371       _face5[1]=6;
1372       _face5[2]=4;
1373       _face5[3]=1;
1374       _face5[4]=15;
1375       _face5[5]=12;
1376       _face5[6]=13;
1377       _face5[7]=9;
1378       int ** tmpConstituents1 = new (int*)[5];
1379       tmpConstituents1[0]=_face1 ;
1380       tmpConstituents1[1]=_face2 ;
1381       tmpConstituents1[2]=_face3 ;
1382       tmpConstituents1[3]=_face4 ;
1383       tmpConstituents1[4]=_face5 ;
1384       int ** tmpConstituents2 = new (int*)[9];
1385       tmpConstituents2[0]=_edge1 ;
1386       tmpConstituents2[1]=_edge2 ;
1387       tmpConstituents2[2]=_edge3 ;
1388       tmpConstituents2[3]=_edge4 ;
1389       tmpConstituents2[4]=_edge5 ;
1390       tmpConstituents2[5]=_edge6 ;
1391       tmpConstituents2[6]=_edge7 ;
1392       tmpConstituents2[7]=_edge8 ;
1393       tmpConstituents2[8]=_edge9 ;
1394       _constituents = new (int**)[2] ;
1395       _constituents[0]=tmpConstituents1 ;
1396       _constituents[1]=tmpConstituents2 ;
1397 //       vector<medGeometryElement> vector_edge_type(9,MED_SEG3) ;
1398 //       vector<medGeometryElement> vector_face_type(5,MED_QUAD8) ;
1399 //       vector_face_type[0]=MED_TRIA6 ;
1400 //       vector_face_type[1]=MED_TRIA6 ;
1401 //       vector<medGeometryElement> __constituents_type[]={vector_face_type,vector_edge_type};
1402 //       vector< vector<medGeometryElement> > _constituents_type(__constituents_type,__constituents_type+2) ;
1403 //       _constituentsType = _constituents_type ;
1404       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
1405       tmpConstituentsType1[0] = MED_TRIA6 ;
1406       tmpConstituentsType1[1] = MED_TRIA6 ;
1407       tmpConstituentsType1[2] = MED_QUAD8 ;
1408       tmpConstituentsType1[3] = MED_QUAD8 ;
1409       tmpConstituentsType1[4] = MED_QUAD8 ;
1410       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[9] ;
1411       tmpConstituentsType2[0] = MED_SEG3 ;
1412       tmpConstituentsType2[1] = MED_SEG3 ;
1413       tmpConstituentsType2[2] = MED_SEG3 ;
1414       tmpConstituentsType2[3] = MED_SEG3 ;
1415       tmpConstituentsType2[4] = MED_SEG3 ;
1416       tmpConstituentsType2[5] = MED_SEG3 ;
1417       tmpConstituentsType2[6] = MED_SEG3 ;
1418       tmpConstituentsType2[7] = MED_SEG3 ;
1419       tmpConstituentsType2[8] = MED_SEG3 ;
1420       _constituentsType = new (medGeometryElement*)[2] ;
1421       _constituentsType[0]=tmpConstituentsType1 ;
1422       _constituentsType[1]=tmpConstituentsType2 ;
1423       break ;
1424     }
1425     case MED_PYRA5   : {
1426       _name="MED_PYRA5" ;
1427       _type=t;
1428       _dimension=3;
1429       _numberOfVertexes=5;
1430       _numberOfNodes=5;
1431 //       int _edge1[]={1,2} ;
1432 //       int _edge2[]={2,3} ;
1433 //       int _edge3[]={3,4} ;
1434 //       int _edge4[]={4,1} ;
1435 //       int _edge5[]={1,5} ;
1436 //       int _edge6[]={2,5} ;
1437 //       int _edge7[]={3,5} ;
1438 //       int _edge8[]={4,5} ;
1439
1440 //       vector<int> edge1(_edge1,_edge1+2) ;
1441 //       vector<int> edge2(_edge2,_edge2+2) ;
1442 //       vector<int> edge3(_edge3,_edge3+2) ;
1443 //       vector<int> edge4(_edge4,_edge4+2) ;
1444 //       vector<int> edge5(_edge5,_edge5+2) ;
1445 //       vector<int> edge6(_edge6,_edge6+2) ;
1446 //       vector<int> edge7(_edge7,_edge7+2) ;
1447 //       vector<int> edge8(_edge8,_edge8+2) ;
1448 //      vector<int> _vector_edge[]={edge1,edge2,edge3,edge4,edge5,edge6,edge7,edge8};
1449 //       vector< vector<int> > vector_edge(_vector_edge,_vector_edge+8) ;
1450
1451 //       int _face1[]={1,2,3,4} ;
1452 //       int _face2[]={1,5,2} ;
1453 //       int _face3[]={2,5,3} ;
1454 //       int _face4[]={3,5,4} ;
1455 //       int _face5[]={4,5,1} ;
1456 //       vector<int> face1(_face1,_face1+4);
1457 //       vector<int> face2(_face2,_face2+3);
1458 //       vector<int> face3(_face3,_face3+3);
1459 //       vector<int> face4(_face4,_face4+3);
1460 //       vector<int> face5(_face5,_face5+3);
1461 //       vector<int> _vector_face[]= {face1,face2,face3,face4,face5} ;
1462 //       vector< vector<int> > vector_face(_vector_face,_vector_face+5);
1463
1464 //       vector< vector<int> > __constituents__[]={vector_face,vector_edge};
1465 //       vector< vector< vector<int> > > _constituents_(__constituents__,__constituents__+2) ;
1466 //       _constituents = _constituents_ ;
1467       _numberOfConstituentsDimension=2 ;
1468       _numberOfConstituents=new int[2] ;
1469       _numberOfConstituents[0]=5 ;
1470       _numberOfConstituents[1]=8 ;
1471       _numberOfNodeOfEachConstituent=new (int*)[2] ;
1472       _numberOfNodeOfEachConstituent[0]=new (int)[5] ;
1473       _numberOfNodeOfEachConstituent[0][0]=4 ;
1474       _numberOfNodeOfEachConstituent[0][1]=3 ;
1475       _numberOfNodeOfEachConstituent[0][2]=3 ;
1476       _numberOfNodeOfEachConstituent[0][3]=3 ;
1477       _numberOfNodeOfEachConstituent[0][4]=3 ;
1478       _numberOfNodeOfEachConstituent[1]=new (int)[8] ;
1479       _numberOfNodeOfEachConstituent[1][0]=2 ;
1480       _numberOfNodeOfEachConstituent[1][1]=2 ;
1481       _numberOfNodeOfEachConstituent[1][2]=2 ;
1482       _numberOfNodeOfEachConstituent[1][3]=2 ;
1483       _numberOfNodeOfEachConstituent[1][4]=2 ;
1484       _numberOfNodeOfEachConstituent[1][5]=2 ;
1485       _numberOfNodeOfEachConstituent[1][6]=2 ;
1486       _numberOfNodeOfEachConstituent[1][7]=2 ;
1487
1488       int* _edge1=new int[2];
1489       _edge1[0]=1;
1490       _edge1[1]=2;
1491       int* _edge2=new int[2];
1492       _edge2[0]=2;
1493       _edge2[1]=3;
1494       int* _edge3=new int[2];
1495       _edge3[0]=3;
1496       _edge3[1]=4;
1497       int* _edge4=new int[2];
1498       _edge4[0]=4;
1499       _edge4[1]=1;
1500       int* _edge5=new int[2];
1501       _edge5[0]=1;
1502       _edge5[1]=5;
1503       int* _edge6=new int[2];
1504       _edge6[0]=2;
1505       _edge6[1]=5;
1506       int* _edge7=new int[2];
1507       _edge7[0]=3;
1508       _edge7[1]=5;
1509       int* _edge8=new int[2];
1510       _edge8[0]=4;
1511       _edge8[1]=5;
1512       int* _face1=new int[4];
1513       _face1[0]=1;
1514       _face1[1]=2;
1515       _face1[2]=3;
1516       _face1[3]=4;
1517       int* _face2=new int[3];
1518       _face2[0]=1;
1519       _face2[1]=5;
1520       _face2[2]=2;
1521       int* _face3=new int[3];
1522       _face3[0]=2;
1523       _face3[1]=5;
1524       _face3[2]=3;
1525       int* _face4=new int[3];
1526       _face4[0]=3;
1527       _face4[1]=5;
1528       _face4[2]=4;
1529       int* _face5=new int[3];
1530       _face5[0]=4;
1531       _face5[1]=5;
1532       _face5[2]=1;
1533       int ** tmpConstituents1 = new (int*)[5];
1534       tmpConstituents1[0]=_face1 ;
1535       tmpConstituents1[1]=_face2 ;
1536       tmpConstituents1[2]=_face3 ;
1537       tmpConstituents1[3]=_face4 ;
1538       tmpConstituents1[4]=_face5 ;
1539       int ** tmpConstituents2 = new (int*)[8];
1540       tmpConstituents2[0]=_edge1 ;
1541       tmpConstituents2[1]=_edge2 ;
1542       tmpConstituents2[2]=_edge3 ;
1543       tmpConstituents2[3]=_edge4 ;
1544       tmpConstituents2[4]=_edge5 ;
1545       tmpConstituents2[5]=_edge6 ;
1546       tmpConstituents2[6]=_edge7 ;
1547       tmpConstituents2[7]=_edge8 ;
1548       _constituents = new int**[2] ;
1549       _constituents[0]=tmpConstituents1 ;
1550       _constituents[1]=tmpConstituents2 ;
1551 //       vector<medGeometryElement> vector_edge_type(8,MED_SEG2) ;
1552 //       vector<medGeometryElement> vector_face_type(5,MED_TRIA3) ;
1553 //       vector_face_type[0]=MED_QUAD4 ;
1554 //     vector<medGeometryElement> __constituents_type[]={vector_face_type,vector_edge_type};
1555 //       vector< vector<medGeometryElement> > _constituents_type(__constituents_type,__constituents_type+2) ;
1556 //       _constituentsType = _constituents_type ;
1557       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
1558       tmpConstituentsType1[0] = MED_QUAD4 ;
1559       tmpConstituentsType1[1] = MED_TRIA3 ;
1560       tmpConstituentsType1[2] = MED_TRIA3 ;
1561       tmpConstituentsType1[3] = MED_TRIA3 ;
1562       tmpConstituentsType1[4] = MED_TRIA3 ;
1563       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[8] ;
1564       tmpConstituentsType2[0] = MED_SEG2 ;
1565       tmpConstituentsType2[1] = MED_SEG2 ;
1566       tmpConstituentsType2[2] = MED_SEG2 ;
1567       tmpConstituentsType2[3] = MED_SEG2 ;
1568       tmpConstituentsType2[4] = MED_SEG2 ;
1569       tmpConstituentsType2[5] = MED_SEG2 ;
1570       tmpConstituentsType2[6] = MED_SEG2 ;
1571       tmpConstituentsType2[7] = MED_SEG2 ;
1572       _constituentsType = new medGeometryElement*[2] ;
1573       _constituentsType[0]=tmpConstituentsType1 ;
1574       _constituentsType[1]=tmpConstituentsType2 ;
1575       break;
1576     }
1577     case MED_PYRA13  : {
1578       _name="MED_PYRA13" ;
1579       _type=t;
1580       _dimension=3;
1581       _numberOfVertexes=5;
1582       _numberOfNodes=13;
1583 //       int _edge1[]={1,2,6} ;
1584 //       int _edge2[]={2,3,7} ;
1585 //       int _edge3[]={3,4,8} ;
1586 //       int _edge4[]={4,1,9} ;
1587 //       int _edge5[]={1,5,10} ;
1588 //       int _edge6[]={2,5,11} ;
1589 //       int _edge7[]={3,5,12} ;
1590 //       int _edge8[]={4,5,13} ;
1591
1592 //       vector<int> edge1(_edge1,_edge1+3) ;
1593 //       vector<int> edge2(_edge2,_edge2+3) ;
1594 //       vector<int> edge3(_edge3,_edge3+3) ;
1595 //       vector<int> edge4(_edge4,_edge4+3) ;
1596 //       vector<int> edge5(_edge5,_edge5+3) ;
1597 //       vector<int> edge6(_edge6,_edge6+3) ;
1598 //       vector<int> edge7(_edge7,_edge7+3) ;
1599 //       vector<int> edge8(_edge8,_edge8+3) ;
1600
1601
1602 //       vector<int> _vector_edge[]={edge1,edge2,edge3,edge4,edge5,edge6,edge7,edge8};
1603 //       vector< vector<int> > vector_edge(_vector_edge,_vector_edge+8) ;
1604
1605 //       int _face1[]={1,2,3,4,6,7,8,9} ;
1606 //       int _face2[]={1,5,2,10,11,6} ;
1607 //       int _face3[]={2,5,3,11,12,7} ;
1608 //       int _face4[]={3,5,4,12,13,8} ;
1609 //       int _face5[]={4,5,1,13,10,9} ;
1610 //       vector<int> face1(_face1,_face1+8);
1611 //       vector<int> face2(_face2,_face2+6);
1612 //       vector<int> face3(_face3,_face3+6);
1613 //       vector<int> face4(_face4,_face4+6);
1614 //       vector<int> face5(_face5,_face5+6);
1615 //       vector<int> _vector_face[]= {face1,face2,face3,face4,face5} ;
1616 //       vector< vector<int> > vector_face(_vector_face,_vector_face+5);
1617
1618
1619 //       vector< vector<int> > __constituents__[]={vector_face,vector_edge};
1620 //       vector< vector< vector<int> > > _constituents_(__constituents__,__constituents__+2) ;
1621 //       _constituents = _constituents_ ;
1622       _numberOfConstituentsDimension=2 ;
1623       _numberOfConstituents=new int[2] ;
1624       _numberOfConstituents[0]=5 ;
1625       _numberOfConstituents[1]=8 ;
1626       _numberOfNodeOfEachConstituent=new (int*)[2] ;
1627       _numberOfNodeOfEachConstituent[0]=new (int)[5] ;
1628       _numberOfNodeOfEachConstituent[0][0]=8 ;
1629       _numberOfNodeOfEachConstituent[0][1]=6 ;
1630       _numberOfNodeOfEachConstituent[0][2]=6 ;
1631       _numberOfNodeOfEachConstituent[0][3]=6 ;
1632       _numberOfNodeOfEachConstituent[0][4]=6 ;
1633       _numberOfNodeOfEachConstituent[1]=new (int)[8] ;
1634       _numberOfNodeOfEachConstituent[1][0]=3 ;
1635       _numberOfNodeOfEachConstituent[1][1]=3 ;
1636       _numberOfNodeOfEachConstituent[1][2]=3 ;
1637       _numberOfNodeOfEachConstituent[1][3]=3 ;
1638       _numberOfNodeOfEachConstituent[1][4]=3 ;
1639       _numberOfNodeOfEachConstituent[1][5]=3 ;
1640       _numberOfNodeOfEachConstituent[1][6]=3 ;
1641       _numberOfNodeOfEachConstituent[1][7]=3 ;
1642
1643       int* _edge1=new int[3];
1644       _edge1[0]=1;
1645       _edge1[1]=2;
1646       _edge1[2]=6;
1647       int* _edge2=new int[3];
1648       _edge2[0]=2;
1649       _edge2[1]=3;
1650       _edge2[2]=7;
1651       int* _edge3=new int[3];
1652       _edge3[0]=3;
1653       _edge3[1]=4;
1654       _edge3[2]=8;
1655       int* _edge4=new int[3];
1656       _edge4[0]=4;
1657       _edge4[1]=1;
1658       _edge4[2]=9;
1659       int* _edge5=new int[3];
1660       _edge5[0]=1;
1661       _edge5[1]=5;
1662       _edge5[2]=10;
1663       int* _edge6=new int[3];
1664       _edge6[0]=2;
1665       _edge6[1]=5;
1666       _edge6[2]=11;
1667       int* _edge7=new int[3];
1668       _edge7[0]=3;
1669       _edge7[1]=5;
1670       _edge7[2]=12;
1671       int* _edge8=new int[3];
1672       _edge8[0]=4;
1673       _edge8[1]=5;
1674       _edge8[2]=13;
1675       int* _face1=new int[8];
1676       _face1[0]=1;
1677       _face1[1]=2;
1678       _face1[2]=3;
1679       _face1[3]=4;
1680       _face1[4]=6;
1681       _face1[5]=7;
1682       _face1[6]=8;
1683       _face1[7]=9;
1684       int* _face2=new int[6];
1685       _face2[0]=1;
1686       _face2[1]=5;
1687       _face2[2]=2;
1688       _face2[3]=10;
1689       _face2[4]=11;
1690       _face2[5]=6;
1691       int* _face3=new int[6];
1692       _face3[0]=2;
1693       _face3[1]=5;
1694       _face3[2]=3;
1695       _face3[3]=11;
1696       _face3[4]=12;
1697       _face3[5]=7;
1698       int* _face4=new int[6];
1699       _face4[0]=3;
1700       _face4[1]=5;
1701       _face4[2]=4;
1702       _face4[3]=12;
1703       _face4[4]=13;
1704       _face4[5]=8;
1705       int* _face5=new int[6];
1706       _face5[0]=4;
1707       _face5[1]=5;
1708       _face5[2]=1;
1709       _face5[3]=13;
1710       _face5[4]=10;
1711       _face5[5]=9;
1712       int ** tmpConstituents1 = new (int*)[5];
1713       tmpConstituents1[0]=_face1 ;
1714       tmpConstituents1[1]=_face2 ;
1715       tmpConstituents1[2]=_face3 ;
1716       tmpConstituents1[3]=_face4 ;
1717       tmpConstituents1[4]=_face5 ;
1718       int ** tmpConstituents2 = new (int*)[8];
1719       tmpConstituents2[0]=_edge1 ;
1720       tmpConstituents2[1]=_edge2 ;
1721       tmpConstituents2[2]=_edge3 ;
1722       tmpConstituents2[3]=_edge4 ;
1723       tmpConstituents2[4]=_edge5 ;
1724       tmpConstituents2[5]=_edge6 ;
1725       tmpConstituents2[6]=_edge7 ;
1726       tmpConstituents2[7]=_edge8 ;
1727       _constituents = new int**[2] ;
1728       _constituents[0]=tmpConstituents1 ;
1729       _constituents[1]=tmpConstituents2 ;
1730 //       vector<medGeometryElement> vector_edge_type(8,MED_SEG3) ;
1731 //       vector<medGeometryElement> vector_face_type(5,MED_TRIA6) ;
1732 //       vector_face_type[0]=MED_QUAD8 ;
1733 //      vector<medGeometryElement> __constituents_type[]={vector_face_type,vector_edge_type};
1734 //       vector< vector<medGeometryElement> > _constituents_type(__constituents_type,__constituents_type+2) ;
1735
1736 //       _constituentsType = _constituents_type ;
1737       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
1738       tmpConstituentsType1[0] = MED_QUAD8 ;
1739       tmpConstituentsType1[1] = MED_TRIA6 ;
1740       tmpConstituentsType1[2] = MED_TRIA6 ;
1741       tmpConstituentsType1[3] = MED_TRIA6 ;
1742       tmpConstituentsType1[4] = MED_TRIA6 ;
1743       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[8] ;
1744       tmpConstituentsType2[0] = MED_SEG3 ;
1745       tmpConstituentsType2[1] = MED_SEG3 ;
1746       tmpConstituentsType2[2] = MED_SEG3 ;
1747       tmpConstituentsType2[3] = MED_SEG3 ;
1748       tmpConstituentsType2[4] = MED_SEG3 ;
1749       tmpConstituentsType2[5] = MED_SEG3 ;
1750       tmpConstituentsType2[6] = MED_SEG3 ;
1751       tmpConstituentsType2[7] = MED_SEG3 ;
1752       _constituentsType = new medGeometryElement*[2] ;
1753       _constituentsType[0]=tmpConstituentsType1 ;
1754       _constituentsType[1]=tmpConstituentsType2 ;
1755       break;
1756     }
1757 //      default : 
1758 //        _type=0;
1759 //        break;
1760     }
1761 }
1762
1763 ostream & operator<<(ostream &os,const CELLMODEL &my)
1764 {
1765   os << "Cell Model :" << endl ;
1766   os << "  - name               : " << my._name << endl;
1767   os << "  - type               : " << (int)my._type << endl;
1768   os << "  - dimension          : " << my._dimension << endl;
1769   os << "  - number of nodes    : " << my._numberOfNodes << endl ;
1770   os << "  - number of vertexes : " << my._numberOfVertexes << endl ;
1771
1772   os << "  - number of Constituents Dimension : " << my._numberOfConstituentsDimension << endl ;
1773
1774   for(int i=0;i<my._numberOfConstituentsDimension;i++)
1775     {
1776
1777       os << "  - for dimension (-" << i+1 << ") : " << endl ;
1778       os << "    - number of Constituents for this Dimension : " << my._numberOfConstituents[i] << endl ;
1779
1780       for(int j=0;j<my._numberOfConstituents[i];j++)
1781         {
1782           os << "    - number of node for this constituent : " << my._numberOfNodeOfEachConstituent[i][j] << endl ;
1783           os << "      - constituents " << j+1 << " of type "<< my._constituentsType[i][j] <<" : " ;
1784           for(int k=0;k<my._numberOfNodeOfEachConstituent[i][j];k++)
1785             os << my._constituents[i][j][k] << " " ;
1786           os << endl ;
1787         }
1788     }
1789   return os;
1790 }
1791
1792 // Return number of constituents type (which dimension is _dimension-1).
1793 int CELLMODEL::getNumberOfConstituentsType() const
1794 {
1795   set<medGeometryElement> constituentsTypes ;
1796 //   if (_constituentsType.size() > 0 ) {
1797 //     vector<medGeometryElement> constituentsType = _constituentsType[0] ;
1798 //     vector<medGeometryElement>::iterator itvec ;
1799 //     for(itvec=constituentsType.begin();itvec!=constituentsType.end();itvec++)
1800 //       constituentsTypes.insert(*itvec);
1801 //   }
1802   return constituentsTypes.size() ;
1803 }
1804
1805   // Return all types of constituents which dimension is (_dimension-1).
1806 set<medGeometryElement>  CELLMODEL::getAllConstituentsType() const
1807 {
1808   set<medGeometryElement> constituentsTypes ;
1809 //   if (_constituentsType.size() > 0 ) {
1810 //     vector<medGeometryElement> constituentsType = _constituentsType[0] ;
1811 //     vector<medGeometryElement>::iterator itvec ;
1812 //     for(itvec=constituentsType.begin();itvec!=constituentsType.end();itvec++)
1813 //       constituentsTypes.insert(*itvec);
1814 //   }
1815   return constituentsTypes ;
1816 }
1817
1818   // Return number of constituents foreach type (which dimension is _dimension-1).
1819 map<medGeometryElement,int>  CELLMODEL::getNumberOfConstituentsForeachType() const
1820 {
1821   map<medGeometryElement,int> numberOfConstituentsForeachType ;
1822 //   map<medGeometryElement,int>::iterator itmap ;
1823 //   if (_constituentsType.size() > 0 ) {
1824 //     vector<medGeometryElement> constituentsType = _constituentsType[0] ;
1825 //     vector<medGeometryElement>::iterator itvec ;
1826 //     for(itvec=constituentsType.begin();itvec!=constituentsType.end();itvec++) {
1827 //       itmap = numberOfConstituentsForeachType.find(*itvec);
1828 //       if (itmap==numberOfConstituentsForeachType.end()) // new element
1829 //      numberOfConstituentsForeachType[*itvec]=1 ;
1830 //       else
1831 //      numberOfConstituentsForeachType[*itvec]++ ;
1832 //     }
1833 //   }
1834   return numberOfConstituentsForeachType ;
1835 }
1836
1837 void CELLMODEL::init(const CELLMODEL &m)
1838 {
1839   _name=m._name ;
1840   _type= m._type ;
1841   _dimension = m._dimension ;
1842   _numberOfNodes = m._numberOfNodes ;
1843   _numberOfVertexes = m._numberOfVertexes ;
1844   
1845   _numberOfConstituentsDimension = m._numberOfConstituentsDimension ;
1846   
1847   _numberOfConstituents = new int[_numberOfConstituentsDimension] ;
1848   for(int i=0; i<_numberOfConstituentsDimension; i++)
1849     _numberOfConstituents[i]=m._numberOfConstituents[i] ;
1850   
1851   _numberOfNodeOfEachConstituent = new (int*)[_numberOfConstituentsDimension] ;
1852   for(int i=0; i<_numberOfConstituentsDimension; i++) {
1853     int numberOf = _numberOfConstituents[i] ;
1854     int * newArray = new int[numberOf] ;
1855     int * oldArray = m._numberOfNodeOfEachConstituent[i] ;
1856     for(int j=0; j<numberOf; j++)
1857       newArray[j] = oldArray[j] ;
1858     _numberOfNodeOfEachConstituent[i] = newArray ;
1859   }
1860   _constituents = new (int**)[_numberOfConstituentsDimension] ;
1861   _constituentsType = new (medGeometryElement*)[_numberOfConstituentsDimension] ;
1862   for(int i=0; i<_numberOfConstituentsDimension; i++) {
1863     int numberOf = _numberOfConstituents[i] ;
1864     int ** tmpArray = new (int*)[numberOf] ;
1865     medGeometryElement * newArrayType = new medGeometryElement[numberOf] ;
1866     medGeometryElement * oldArrayType = m._constituentsType[i] ;
1867     
1868     for(int j=0; j<numberOf; j++) {
1869       int numberOf2 = _numberOfNodeOfEachConstituent[i][j] ;
1870       int * newArray = new int[numberOf2] ;
1871       int * oldArray = m._constituents[i][j] ;
1872       for(int k=0; k<numberOf2; k++)
1873         newArray[k] = oldArray[k] ;
1874       tmpArray[j] = newArray ;
1875       newArrayType[j] = oldArrayType[j] ;
1876     }
1877     _constituents[i] = tmpArray ;
1878     _constituentsType[i] = newArrayType ;
1879   }
1880   
1881 }
1882 void CELLMODEL::clean()
1883 {
1884   for(int i=0; i<_numberOfConstituentsDimension; i++) {
1885     int numberOf = _numberOfConstituents[i] ;
1886     for(int j=0; j<numberOf; j++) {
1887       if (NULL!=_constituents[i][j])
1888         delete[] _constituents[i][j] ;
1889     }
1890     if (NULL!=_constituentsType[i])
1891       delete[] _constituentsType[i] ;
1892     if (NULL!=_constituents[i])
1893       delete[] _constituents[i] ;
1894     if (NULL!=_numberOfNodeOfEachConstituent[i])
1895       delete[] _numberOfNodeOfEachConstituent[i] ;
1896   }
1897   if (NULL!=_numberOfConstituents)
1898     delete[]_numberOfConstituents ;
1899   if (NULL!=_constituentsType)
1900     delete[] _constituentsType ;
1901   if (NULL!=_constituents)
1902     delete[] _constituents ;
1903   if (NULL!=_numberOfNodeOfEachConstituent)
1904     delete[] _numberOfNodeOfEachConstituent ;
1905 }