1 // MED MEDMEM : MED files in memory
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : MEDMEM_CellModel.cxx
29 File MEDMEM_CellModel.cxx
33 #include "utilities.h"
34 #include "MEDMEM_CellModel.hxx"
36 CELLMODEL::CELLMODEL(medGeometryElement t)
38 // init first all to nothing
42 _numberOfConstituentsDimension=0 ;
43 _numberOfConstituents=(int*)NULL ;
44 _numberOfNodeOfEachConstituent=(int**)NULL ;
45 _constituents=(int***)NULL ;
46 //_numberOfonstituentsType=(int*)NULL ;
47 _constituentsType=(medGeometryElement**)NULL ;
49 MESSAGE("CELLMODEL : constructeur pour le type " << t);
58 // nothing else : POINT are none constituent
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 ;
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 ;
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 ;
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 ;
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 ;
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 ;
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 ;
139 int* _edge1=new int[2];
142 int* _edge2=new int[2];
145 int* _edge3=new int[2];
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 ;
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 !
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 ;
187 int* _edge1=new int[3];
191 int* _edge2=new int[3];
195 int* _edge3=new int[3];
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 !
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 ;
241 int* _edge1=new int[2];
244 int* _edge2=new int[2];
247 int* _edge3=new int[2];
250 int* _edge4=new int[2];
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 !
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 ;
295 int* _edge1=new int[3];
299 int* _edge2=new int[3];
303 int* _edge3=new int[3];
307 int* _edge4=new int[3];
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 !
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 ;
365 int* _face1=new int[3];
369 int* _face2=new int[3];
373 int* _face3=new int[3];
377 int* _face4=new int[3];
381 int* _edge1=new int[2];
384 int* _edge2=new int[2];
387 int* _edge3=new int[2];
390 int* _edge4=new int[2];
393 int* _edge5=new int[2];
396 int* _edge6=new int[2];
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 ;
432 _name="MED_TETRA10" ;
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 ;
455 int* _face1=new int[6];
462 int* _face2=new int[6];
469 int* _face3=new int[6];
476 int* _face4=new int[6];
483 int* _edge1=new int[3];
487 int* _edge2=new int[3];
491 int* _edge3=new int[3];
495 int* _edge4=new int[3];
499 int* _edge5=new int[3];
503 int* _edge6=new int[3];
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 ;
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 ;
571 int* _edge1=new int[2];
574 int* _edge2=new int[2];
577 int* _edge3=new int[2];
580 int* _edge4=new int[2];
583 int* _edge5=new int[2];
586 int* _edge6=new int[2];
589 int* _edge7=new int[2];
592 int* _edge8=new int[2];
595 int* _edge9=new int[2];
598 int* _edge10=new int[2];
601 int* _edge11=new int[2];
604 int* _edge12=new int[2];
607 int* _face1=new int[4];
612 int* _face2=new int[4];
617 int* _face3=new int[4];
622 int* _face4=new int[4];
627 int* _face5=new int[4];
632 int* _face6=new int[4];
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 ;
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 ;
717 int* _edge1=new int[3];
721 int* _edge2=new int[3];
725 int* _edge3=new int[3];
729 int* _edge4=new int[3];
733 int* _edge5=new int[3];
737 int* _edge6=new int[3];
741 int* _edge7=new int[3];
745 int* _edge8=new int[3];
749 int* _edge9=new int[3];
753 int* _edge10=new int[3];
757 int* _edge11=new int[3];
761 int* _edge12=new int[3];
765 int* _face1=new int[8];
774 int* _face2=new int[8];
783 int* _face3=new int[8];
792 int* _face4=new int[8];
801 int* _face5=new int[8];
810 int* _face6=new int[8];
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 ;
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 ;
896 int* _edge1=new int[2];
899 int* _edge2=new int[2];
902 int* _edge3=new int[2];
905 int* _edge4=new int[2];
908 int* _edge5=new int[2];
911 int* _edge6=new int[2];
914 int* _edge7=new int[2];
917 int* _edge8=new int[2];
920 int* _edge9=new int[2];
923 int* _face1=new int[3];
927 int* _face2=new int[3];
931 int* _face3=new int[4];
936 int* _face4=new int[4];
941 int* _face5=new int[4];
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 ;
987 _name="MED_PENTA15" ;
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 ;
1014 int* _edge1=new int[3];
1018 int* _edge2=new int[3];
1022 int* _edge3=new int[3];
1026 int* _edge4=new int[3];
1030 int* _edge5=new int[3];
1034 int* _edge6=new int[3];
1038 int* _edge7=new int[3];
1042 int* _edge8=new int[3];
1046 int* _edge9=new int[3];
1050 int* _face1=new int[6];
1057 int* _face2=new int[6];
1064 int* _face3=new int[8];
1073 int* _face4=new int[8];
1082 int* _face5=new int[8];
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 ;
1135 _numberOfVertexes=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 ;
1158 int* _edge1=new int[2];
1161 int* _edge2=new int[2];
1164 int* _edge3=new int[2];
1167 int* _edge4=new int[2];
1170 int* _edge5=new int[2];
1173 int* _edge6=new int[2];
1176 int* _edge7=new int[2];
1179 int* _edge8=new int[2];
1182 int* _face1=new int[4];
1187 int* _face2=new int[3];
1191 int* _face3=new int[3];
1195 int* _face4=new int[3];
1199 int* _face5=new int[3];
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 ;
1242 _name="MED_PYRA13" ;
1245 _numberOfVertexes=5;
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 ;
1268 int* _edge1=new int[3];
1272 int* _edge2=new int[3];
1276 int* _edge3=new int[3];
1280 int* _edge4=new int[3];
1284 int* _edge5=new int[3];
1288 int* _edge6=new int[3];
1292 int* _edge7=new int[3];
1296 int* _edge8=new int[3];
1300 int* _face1=new int[8];
1309 int* _face2=new int[6];
1316 int* _face3=new int[6];
1323 int* _face4=new int[6];
1330 int* _face5=new int[6];
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 ;
1381 ostream & operator<<(ostream &os,const CELLMODEL &my)
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 ;
1390 os << " - number of Constituents Dimension : " << my._numberOfConstituentsDimension << endl ;
1392 for(int i=0;i<my._numberOfConstituentsDimension;i++)
1395 os << " - for dimension (-" << i+1 << ") : " << endl ;
1396 os << " - number of Constituents for this Dimension : " << my._numberOfConstituents[i] << endl ;
1398 for(int j=0;j<my._numberOfConstituents[i];j++)
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] << " " ;
1410 // Return number of constituents type (which dimension is _dimension-1).
1411 int CELLMODEL::getNumberOfConstituentsType() const
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);
1420 return constituentsTypes.size() ;
1423 // Return all types of constituents which dimension is (_dimension-1).
1424 set<medGeometryElement> CELLMODEL::getAllConstituentsType() const
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);
1433 return constituentsTypes ;
1436 // Return number of constituents foreach type (which dimension is _dimension-1).
1437 map<medGeometryElement,int> CELLMODEL::getNumberOfConstituentsForeachType() const
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 ;
1449 // numberOfConstituentsForeachType[*itvec]++ ;
1452 return numberOfConstituentsForeachType ;
1455 void CELLMODEL::init(const CELLMODEL &m)
1459 _dimension = m._dimension ;
1460 _numberOfNodes = m._numberOfNodes ;
1461 _numberOfVertexes = m._numberOfVertexes ;
1463 _numberOfConstituentsDimension = m._numberOfConstituentsDimension ;
1465 _numberOfConstituents = new int[_numberOfConstituentsDimension] ;
1466 for(int i=0; i<_numberOfConstituentsDimension; i++)
1467 _numberOfConstituents[i]=m._numberOfConstituents[i] ;
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 ;
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] ;
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] ;
1495 _constituents[i] = tmpArray ;
1496 _constituentsType[i] = newArrayType ;
1500 void CELLMODEL::clean()
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] ;
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] ;
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 ;