1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 File MEDMEM_CellModel.cxx
27 #include "MEDMEM_CellModel.hxx"
30 using namespace MEDMEM;
31 using namespace MED_EN;
33 CELLMODEL_Map *CELLMODEL_Map::_singleton=0;
35 const MEDMEM::CELLMODEL& CELLMODEL_Map::getCellModel(MED_EN::medGeometryElement type)
37 map<MED_EN::medGeometryElement,MEDMEM::CELLMODEL>::iterator type2model = _cell_models.find(type);
38 if ( type2model == _cell_models.end() )
39 type2model = _cell_models.insert( make_pair( type, CELLMODEL( type ))).first;
41 return type2model->second;
44 const MEDMEM::CELLMODEL& CELLMODEL_Map::retrieveCellModel(MED_EN::medGeometryElement type)
46 return CELLMODEL_Map::getInstance()->getCellModel(type);
49 CELLMODEL_Map *CELLMODEL_Map::getInstance()
51 if(!_singleton) _singleton=new CELLMODEL_Map;
55 CELLMODEL::CELLMODEL(medGeometryElement t)
57 // init first all to nothing
61 _numberOfConstituentsDimension=0 ;
62 _numberOfConstituents=(int*)NULL ;
63 _numberOfNodeOfEachConstituent=(int**)NULL ;
64 _constituents=(int***)NULL ;
65 _constituentsType=(medGeometryElement**)NULL ;
67 MESSAGE_MED("CELLMODEL : constructeur pour le type " << t);
76 // nothing else : POINT are none constituent
85 // constituent are POINT1 and we have no need to define _constituents vector
86 _numberOfConstituentsDimension=1 ;
87 _numberOfConstituents=new int[1] ;
88 _numberOfConstituents[0]=2 ;
89 _numberOfNodeOfEachConstituent=new int*[1] ;
90 _numberOfNodeOfEachConstituent[0]=new int[2] ;
91 _numberOfNodeOfEachConstituent[0][0]=1 ;
92 _numberOfNodeOfEachConstituent[0][1]=1 ;
94 _constituents = new int**[1] ;
95 _constituents[0] = new int*[2] ;
96 _constituents[0][0] = new int[1] ;
97 _constituents[0][0][0] = 1 ;
98 _constituents[0][1] = new int[1] ;
99 _constituents[0][1][0] = 2 ;
101 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[2] ;
102 tmpConstituentsType1[0] = MED_POINT1 ;
103 tmpConstituentsType1[1] = MED_POINT1 ;
104 _constituentsType = new medGeometryElement*[1] ;
105 _constituentsType[0]=tmpConstituentsType1 ;
114 // constituent are POINT1 and we have no need to define _constituents vector
115 _numberOfConstituentsDimension=1 ;
116 _numberOfConstituents=new int[1] ;
117 _numberOfConstituents[0]=3 ;
118 _numberOfNodeOfEachConstituent=new int*[1] ;
119 _numberOfNodeOfEachConstituent[0]=new int[3] ;
120 _numberOfNodeOfEachConstituent[0][0]=1 ;
121 _numberOfNodeOfEachConstituent[0][1]=1 ;
122 _numberOfNodeOfEachConstituent[0][2]=1 ;
124 _constituents = new int**[1] ;
125 _constituents[0] = new int*[3] ;
126 _constituents[0][0] = new int[1] ;
127 _constituents[0][0][0] = 1 ;
128 _constituents[0][1] = new int[1] ;
129 _constituents[0][1][0] = 2 ;
130 _constituents[0][2] = new int[1] ;
131 _constituents[0][2][0] = 3 ;
133 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[3] ;
134 tmpConstituentsType1[0] = MED_POINT1 ;
135 tmpConstituentsType1[1] = MED_POINT1 ;
136 tmpConstituentsType1[2] = MED_POINT1 ;
137 _constituentsType = new medGeometryElement*[1] ;
138 _constituentsType[0]=tmpConstituentsType1 ;
148 _numberOfConstituentsDimension=1 ;
149 _numberOfConstituents=new int[1] ;
150 _numberOfConstituents[0]=3 ;
151 _numberOfNodeOfEachConstituent=new int*[1] ;
152 _numberOfNodeOfEachConstituent[0]=new int[3] ;
153 _numberOfNodeOfEachConstituent[0][0]=2 ;
154 _numberOfNodeOfEachConstituent[0][1]=2 ;
155 _numberOfNodeOfEachConstituent[0][2]=2 ;
157 int* _edge1=new int[2];
160 int* _edge2=new int[2];
163 int* _edge3=new int[2];
166 int ** tmpConstituents1 = new int*[3];
167 tmpConstituents1[0]=_edge1 ;
168 tmpConstituents1[1]=_edge2 ;
169 tmpConstituents1[2]=_edge3 ;
170 _constituents = new int**[1] ;
171 _constituents[0]=tmpConstituents1 ;
173 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[3] ;
174 tmpConstituentsType1[0] = MED_SEG2 ;
175 tmpConstituentsType1[1] = MED_SEG2 ;
176 tmpConstituentsType1[2] = MED_SEG2 ;
177 _constituentsType = new medGeometryElement*[1] ;
178 _constituentsType[0]=tmpConstituentsType1 ;
179 // Well, point are defined, but could not be acces because we have
180 // only 1 numberOfConstituentsDimension !
190 _numberOfConstituentsDimension=1 ;
191 _numberOfConstituents=new int[1] ;
192 _numberOfConstituents[0]=3 ;
193 _numberOfNodeOfEachConstituent=new int*[1] ;
194 _numberOfNodeOfEachConstituent[0]=new int[3] ;
195 _numberOfNodeOfEachConstituent[0][0]=3 ;
196 _numberOfNodeOfEachConstituent[0][1]=3 ;
197 _numberOfNodeOfEachConstituent[0][2]=3 ;
199 int* _edge1=new int[3];
203 int* _edge2=new int[3];
207 int* _edge3=new int[3];
211 int ** tmpConstituents1 = new int*[3];
212 tmpConstituents1[0]=_edge1 ;
213 tmpConstituents1[1]=_edge2 ;
214 tmpConstituents1[2]=_edge3 ;
215 _constituents = new int**[1] ;
216 _constituents[0]=tmpConstituents1 ;
217 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[3] ;
218 tmpConstituentsType1[0] = MED_SEG3 ;
219 tmpConstituentsType1[1] = MED_SEG3 ;
220 tmpConstituentsType1[2] = MED_SEG3 ;
221 _constituentsType = new medGeometryElement*[1] ;
222 _constituentsType[0]=tmpConstituentsType1 ;
223 // Well, point are defined, but could not be acces because we have
224 // only 1 numberOfConstituentsDimension !
234 _numberOfConstituentsDimension=1 ;
235 _numberOfConstituents=new int[1] ;
236 _numberOfConstituents[0]=4 ;
237 _numberOfNodeOfEachConstituent=new int*[1] ;
238 _numberOfNodeOfEachConstituent[0]=new int[4] ;
239 _numberOfNodeOfEachConstituent[0][0]=2 ;
240 _numberOfNodeOfEachConstituent[0][1]=2 ;
241 _numberOfNodeOfEachConstituent[0][2]=2 ;
242 _numberOfNodeOfEachConstituent[0][3]=2 ;
244 int* _edge1=new int[2];
247 int* _edge2=new int[2];
250 int* _edge3=new int[2];
253 int* _edge4=new int[2];
256 int ** tmpConstituents1 = new int*[4];
257 tmpConstituents1[0]=_edge1 ;
258 tmpConstituents1[1]=_edge2 ;
259 tmpConstituents1[2]=_edge3 ;
260 tmpConstituents1[3]=_edge4 ;
261 _constituents = new int**[1] ;
262 _constituents[0]=tmpConstituents1 ;
263 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
264 tmpConstituentsType1[0] = MED_SEG2 ;
265 tmpConstituentsType1[1] = MED_SEG2 ;
266 tmpConstituentsType1[2] = MED_SEG2 ;
267 tmpConstituentsType1[3] = MED_SEG2 ;
268 _constituentsType = new medGeometryElement*[1] ;
269 _constituentsType[0]=tmpConstituentsType1 ;
270 // Well, point are defined, but could not be acces because we have
271 // only 1 numberOfConstituentsDimension !
281 _numberOfConstituentsDimension=1 ;
282 _numberOfConstituents=new int[1] ;
283 _numberOfConstituents[0]=4 ;
284 _numberOfNodeOfEachConstituent=new int*[1] ;
285 _numberOfNodeOfEachConstituent[0]=new int[4] ;
286 _numberOfNodeOfEachConstituent[0][0]=3 ;
287 _numberOfNodeOfEachConstituent[0][1]=3 ;
288 _numberOfNodeOfEachConstituent[0][2]=3 ;
289 _numberOfNodeOfEachConstituent[0][3]=3 ;
291 int* _edge1=new int[3];
295 int* _edge2=new int[3];
299 int* _edge3=new int[3];
303 int* _edge4=new int[3];
307 int ** tmpConstituents1 = new int*[4];
308 tmpConstituents1[0]=_edge1 ;
309 tmpConstituents1[1]=_edge2 ;
310 tmpConstituents1[2]=_edge3 ;
311 tmpConstituents1[3]=_edge4 ;
312 _constituents = new int**[1] ;
313 _constituents[0]=tmpConstituents1 ;
314 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
315 tmpConstituentsType1[0] = MED_SEG3 ;
316 tmpConstituentsType1[1] = MED_SEG3 ;
317 tmpConstituentsType1[2] = MED_SEG3 ;
318 tmpConstituentsType1[3] = MED_SEG3 ;
319 _constituentsType = new medGeometryElement*[1] ;
320 _constituentsType[0]=tmpConstituentsType1 ;
321 // Well, point are defined, but could not be acces because we have
322 // only 1 numberOfConstituentsDimension !
332 _numberOfConstituentsDimension=2 ;
333 _numberOfConstituents=new int[2] ;
334 _numberOfConstituents[0]=4 ;
335 _numberOfConstituents[1]=6 ;
336 _numberOfNodeOfEachConstituent=new int*[2] ;
337 _numberOfNodeOfEachConstituent[0]=new int[4] ;
338 _numberOfNodeOfEachConstituent[0][0]=3 ;
339 _numberOfNodeOfEachConstituent[0][1]=3 ;
340 _numberOfNodeOfEachConstituent[0][2]=3 ;
341 _numberOfNodeOfEachConstituent[0][3]=3 ;
342 _numberOfNodeOfEachConstituent[1]=new int[6] ;
343 _numberOfNodeOfEachConstituent[1][0]=2 ;
344 _numberOfNodeOfEachConstituent[1][1]=2 ;
345 _numberOfNodeOfEachConstituent[1][2]=2 ;
346 _numberOfNodeOfEachConstituent[1][3]=2 ;
347 _numberOfNodeOfEachConstituent[1][4]=2 ;
348 _numberOfNodeOfEachConstituent[1][5]=2 ;
350 int* _face1=new int[3];
354 int* _face2=new int[3];
358 int* _face3=new int[3];
362 int* _face4=new int[3];
366 int* _edge1=new int[2];
369 int* _edge2=new int[2];
372 int* _edge3=new int[2];
375 int* _edge4=new int[2];
378 int* _edge5=new int[2];
381 int* _edge6=new int[2];
384 int ** tmpConstituents1 = new int*[4];
385 tmpConstituents1[0]=_face1 ;
386 tmpConstituents1[1]=_face2 ;
387 tmpConstituents1[2]=_face3 ;
388 tmpConstituents1[3]=_face4 ;
389 int ** tmpConstituents2 = new int*[6];
390 tmpConstituents2[0]=_edge1 ;
391 tmpConstituents2[1]=_edge2 ;
392 tmpConstituents2[2]=_edge3 ;
393 tmpConstituents2[3]=_edge4 ;
394 tmpConstituents2[4]=_edge5 ;
395 tmpConstituents2[5]=_edge6 ;
396 _constituents = new int**[2] ;
397 _constituents[0]=tmpConstituents1 ;
398 _constituents[1]=tmpConstituents2 ;
399 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
400 tmpConstituentsType1[0] = MED_TRIA3 ;
401 tmpConstituentsType1[1] = MED_TRIA3 ;
402 tmpConstituentsType1[2] = MED_TRIA3 ;
403 tmpConstituentsType1[3] = MED_TRIA3 ;
404 medGeometryElement * tmpConstituentsType2 = new medGeometryElement[6] ;
405 tmpConstituentsType2[0] = MED_SEG2 ;
406 tmpConstituentsType2[1] = MED_SEG2 ;
407 tmpConstituentsType2[2] = MED_SEG2 ;
408 tmpConstituentsType2[3] = MED_SEG2 ;
409 tmpConstituentsType2[4] = MED_SEG2 ;
410 tmpConstituentsType2[5] = MED_SEG2 ;
411 _constituentsType = new medGeometryElement*[2] ;
412 _constituentsType[0]=tmpConstituentsType1 ;
413 _constituentsType[1]=tmpConstituentsType2 ;
417 _name="MED_TETRA10" ;
422 _numberOfConstituentsDimension=2 ;
423 _numberOfConstituents=new int[2] ;
424 _numberOfConstituents[0]=4 ;
425 _numberOfConstituents[1]=6 ;
426 _numberOfNodeOfEachConstituent=new int*[2] ;
427 _numberOfNodeOfEachConstituent[0]=new int[4] ;
428 _numberOfNodeOfEachConstituent[0][0]=6 ;
429 _numberOfNodeOfEachConstituent[0][1]=6 ;
430 _numberOfNodeOfEachConstituent[0][2]=6 ;
431 _numberOfNodeOfEachConstituent[0][3]=6 ;
432 _numberOfNodeOfEachConstituent[1]=new int[6] ;
433 _numberOfNodeOfEachConstituent[1][0]=3 ;
434 _numberOfNodeOfEachConstituent[1][1]=3 ;
435 _numberOfNodeOfEachConstituent[1][2]=3 ;
436 _numberOfNodeOfEachConstituent[1][3]=3 ;
437 _numberOfNodeOfEachConstituent[1][4]=3 ;
438 _numberOfNodeOfEachConstituent[1][5]=3 ;
440 int* _face1=new int[6];
447 int* _face2=new int[6];
454 int* _face3=new int[6];
461 int* _face4=new int[6];
468 int* _edge1=new int[3];
472 int* _edge2=new int[3];
476 int* _edge3=new int[3];
480 int* _edge4=new int[3];
484 int* _edge5=new int[3];
488 int* _edge6=new int[3];
492 int ** tmpConstituents1 = new int*[4];
493 tmpConstituents1[0]=_face1 ;
494 tmpConstituents1[1]=_face2 ;
495 tmpConstituents1[2]=_face3 ;
496 tmpConstituents1[3]=_face4 ;
497 int ** tmpConstituents2 = new int*[6];
498 tmpConstituents2[0]=_edge1 ;
499 tmpConstituents2[1]=_edge2 ;
500 tmpConstituents2[2]=_edge3 ;
501 tmpConstituents2[3]=_edge4 ;
502 tmpConstituents2[4]=_edge5 ;
503 tmpConstituents2[5]=_edge6 ;
504 _constituents = new int**[2] ;
505 _constituents[0]=tmpConstituents1 ;
506 _constituents[1]=tmpConstituents2 ;
507 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
508 tmpConstituentsType1[0] = MED_TRIA6 ;
509 tmpConstituentsType1[1] = MED_TRIA6 ;
510 tmpConstituentsType1[2] = MED_TRIA6 ;
511 tmpConstituentsType1[3] = MED_TRIA6 ;
512 medGeometryElement * tmpConstituentsType2 = new medGeometryElement[6] ;
513 tmpConstituentsType2[0] = MED_SEG3 ;
514 tmpConstituentsType2[1] = MED_SEG3 ;
515 tmpConstituentsType2[2] = MED_SEG3 ;
516 tmpConstituentsType2[3] = MED_SEG3 ;
517 tmpConstituentsType2[4] = MED_SEG3 ;
518 tmpConstituentsType2[5] = MED_SEG3 ;
519 _constituentsType = new medGeometryElement*[2] ;
520 _constituentsType[0]=tmpConstituentsType1 ;
521 _constituentsType[1]=tmpConstituentsType2 ;
530 _numberOfConstituentsDimension=2 ;
531 _numberOfConstituents=new int[2] ;
532 _numberOfConstituents[0]=6 ;
533 _numberOfConstituents[1]=12 ;
534 _numberOfNodeOfEachConstituent=new int*[2] ;
535 _numberOfNodeOfEachConstituent[0]=new int[6] ;
536 _numberOfNodeOfEachConstituent[0][0]=4 ;
537 _numberOfNodeOfEachConstituent[0][1]=4 ;
538 _numberOfNodeOfEachConstituent[0][2]=4 ;
539 _numberOfNodeOfEachConstituent[0][3]=4 ;
540 _numberOfNodeOfEachConstituent[0][4]=4 ;
541 _numberOfNodeOfEachConstituent[0][5]=4 ;
542 _numberOfNodeOfEachConstituent[1]=new int[12] ;
543 _numberOfNodeOfEachConstituent[1][0]=2 ;
544 _numberOfNodeOfEachConstituent[1][1]=2 ;
545 _numberOfNodeOfEachConstituent[1][2]=2 ;
546 _numberOfNodeOfEachConstituent[1][3]=2 ;
547 _numberOfNodeOfEachConstituent[1][4]=2 ;
548 _numberOfNodeOfEachConstituent[1][5]=2 ;
549 _numberOfNodeOfEachConstituent[1][6]=2 ;
550 _numberOfNodeOfEachConstituent[1][7]=2 ;
551 _numberOfNodeOfEachConstituent[1][8]=2 ;
552 _numberOfNodeOfEachConstituent[1][9]=2 ;
553 _numberOfNodeOfEachConstituent[1][10]=2 ;
554 _numberOfNodeOfEachConstituent[1][11]=2 ;
556 int* _edge1=new int[2];
559 int* _edge2=new int[2];
562 int* _edge3=new int[2];
565 int* _edge4=new int[2];
568 int* _edge5=new int[2];
571 int* _edge6=new int[2];
574 int* _edge7=new int[2];
577 int* _edge8=new int[2];
580 int* _edge9=new int[2];
583 int* _edge10=new int[2];
586 int* _edge11=new int[2];
589 int* _edge12=new int[2];
592 int* _face1=new int[4];
597 int* _face2=new int[4];
602 int* _face3=new int[4];
607 int* _face4=new int[4];
612 int* _face5=new int[4];
617 int* _face6=new int[4];
622 int ** tmpConstituents1 = new int*[6];
623 tmpConstituents1[0]=_face1 ;
624 tmpConstituents1[1]=_face2 ;
625 tmpConstituents1[2]=_face3 ;
626 tmpConstituents1[3]=_face4 ;
627 tmpConstituents1[4]=_face5 ;
628 tmpConstituents1[5]=_face6 ;
629 int ** tmpConstituents2 = new int*[12];
630 tmpConstituents2[0]=_edge1 ;
631 tmpConstituents2[1]=_edge2 ;
632 tmpConstituents2[2]=_edge3 ;
633 tmpConstituents2[3]=_edge4 ;
634 tmpConstituents2[4]=_edge5 ;
635 tmpConstituents2[5]=_edge6 ;
636 tmpConstituents2[6]=_edge7 ;
637 tmpConstituents2[7]=_edge8 ;
638 tmpConstituents2[8]=_edge9 ;
639 tmpConstituents2[9]=_edge10;
640 tmpConstituents2[10]=_edge11;
641 tmpConstituents2[11]=_edge12;
642 _constituents = new int**[2] ;
643 _constituents[0]=tmpConstituents1 ;
644 _constituents[1]=tmpConstituents2 ;
645 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[6] ;
646 tmpConstituentsType1[0] = MED_QUAD4 ;
647 tmpConstituentsType1[1] = MED_QUAD4 ;
648 tmpConstituentsType1[2] = MED_QUAD4 ;
649 tmpConstituentsType1[3] = MED_QUAD4 ;
650 tmpConstituentsType1[4] = MED_QUAD4 ;
651 tmpConstituentsType1[5] = MED_QUAD4 ;
652 medGeometryElement * tmpConstituentsType2 = new medGeometryElement[12] ;
653 tmpConstituentsType2[0] = MED_SEG2 ;
654 tmpConstituentsType2[1] = MED_SEG2 ;
655 tmpConstituentsType2[2] = MED_SEG2 ;
656 tmpConstituentsType2[3] = MED_SEG2 ;
657 tmpConstituentsType2[4] = MED_SEG2 ;
658 tmpConstituentsType2[5] = MED_SEG2 ;
659 tmpConstituentsType2[6] = MED_SEG2 ;
660 tmpConstituentsType2[7] = MED_SEG2 ;
661 tmpConstituentsType2[8] = MED_SEG2 ;
662 tmpConstituentsType2[9] = MED_SEG2 ;
663 tmpConstituentsType2[10] = MED_SEG2 ;
664 tmpConstituentsType2[11] = MED_SEG2 ;
665 _constituentsType = new medGeometryElement*[2] ;
666 _constituentsType[0]=tmpConstituentsType1 ;
667 _constituentsType[1]=tmpConstituentsType2 ;
676 _numberOfConstituentsDimension=2 ;
677 _numberOfConstituents=new int[2] ;
678 _numberOfConstituents[0]=6 ;
679 _numberOfConstituents[1]=12 ;
680 _numberOfNodeOfEachConstituent=new int*[2] ;
681 _numberOfNodeOfEachConstituent[0]=new int[6] ;
682 _numberOfNodeOfEachConstituent[0][0]=8 ;
683 _numberOfNodeOfEachConstituent[0][1]=8 ;
684 _numberOfNodeOfEachConstituent[0][2]=8 ;
685 _numberOfNodeOfEachConstituent[0][3]=8 ;
686 _numberOfNodeOfEachConstituent[0][4]=8 ;
687 _numberOfNodeOfEachConstituent[0][5]=8 ;
688 _numberOfNodeOfEachConstituent[1]=new int[12] ;
689 _numberOfNodeOfEachConstituent[1][0]=3 ;
690 _numberOfNodeOfEachConstituent[1][1]=3 ;
691 _numberOfNodeOfEachConstituent[1][2]=3 ;
692 _numberOfNodeOfEachConstituent[1][3]=3 ;
693 _numberOfNodeOfEachConstituent[1][4]=3 ;
694 _numberOfNodeOfEachConstituent[1][5]=3 ;
695 _numberOfNodeOfEachConstituent[1][6]=3 ;
696 _numberOfNodeOfEachConstituent[1][7]=3 ;
697 _numberOfNodeOfEachConstituent[1][8]=3 ;
698 _numberOfNodeOfEachConstituent[1][9]=3 ;
699 _numberOfNodeOfEachConstituent[1][10]=3 ;
700 _numberOfNodeOfEachConstituent[1][11]=3 ;
702 int* _edge1=new int[3];
706 int* _edge2=new int[3];
710 int* _edge3=new int[3];
714 int* _edge4=new int[3];
718 int* _edge5=new int[3];
722 int* _edge6=new int[3];
726 int* _edge7=new int[3];
730 int* _edge8=new int[3];
734 int* _edge9=new int[3];
738 int* _edge10=new int[3];
742 int* _edge11=new int[3];
746 int* _edge12=new int[3];
750 int* _face1=new int[8];
759 int* _face2=new int[8];
768 int* _face3=new int[8];
777 int* _face4=new int[8];
786 int* _face5=new int[8];
795 int* _face6=new int[8];
804 int ** tmpConstituents1 = new int*[6];
805 tmpConstituents1[0]=_face1 ;
806 tmpConstituents1[1]=_face2 ;
807 tmpConstituents1[2]=_face3 ;
808 tmpConstituents1[3]=_face4 ;
809 tmpConstituents1[4]=_face5 ;
810 tmpConstituents1[5]=_face6 ;
811 int ** tmpConstituents2 = new int*[12];
812 tmpConstituents2[0]=_edge1 ;
813 tmpConstituents2[1]=_edge2 ;
814 tmpConstituents2[2]=_edge3 ;
815 tmpConstituents2[3]=_edge4 ;
816 tmpConstituents2[4]=_edge5 ;
817 tmpConstituents2[5]=_edge6 ;
818 tmpConstituents2[6]=_edge7 ;
819 tmpConstituents2[7]=_edge8 ;
820 tmpConstituents2[8]=_edge9 ;
821 tmpConstituents2[9]=_edge10;
822 tmpConstituents2[10]=_edge11;
823 tmpConstituents2[11]=_edge12;
824 _constituents = new int**[2] ;
825 _constituents[0]=tmpConstituents1 ;
826 _constituents[1]=tmpConstituents2 ;
827 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[6] ;
828 tmpConstituentsType1[0] = MED_QUAD8 ;
829 tmpConstituentsType1[1] = MED_QUAD8 ;
830 tmpConstituentsType1[2] = MED_QUAD8 ;
831 tmpConstituentsType1[3] = MED_QUAD8 ;
832 tmpConstituentsType1[4] = MED_QUAD8 ;
833 tmpConstituentsType1[5] = MED_QUAD8 ;
834 medGeometryElement * tmpConstituentsType2 = new medGeometryElement[12] ;
835 tmpConstituentsType2[0] = MED_SEG3 ;
836 tmpConstituentsType2[1] = MED_SEG3 ;
837 tmpConstituentsType2[2] = MED_SEG3 ;
838 tmpConstituentsType2[3] = MED_SEG3 ;
839 tmpConstituentsType2[4] = MED_SEG3 ;
840 tmpConstituentsType2[5] = MED_SEG3 ;
841 tmpConstituentsType2[6] = MED_SEG3 ;
842 tmpConstituentsType2[7] = MED_SEG3 ;
843 tmpConstituentsType2[8] = MED_SEG3 ;
844 tmpConstituentsType2[9] = MED_SEG3 ;
845 tmpConstituentsType2[10] = MED_SEG3 ;
846 tmpConstituentsType2[11] = MED_SEG3 ;
847 _constituentsType = new medGeometryElement*[2] ;
848 _constituentsType[0]=tmpConstituentsType1 ;
849 _constituentsType[1]=tmpConstituentsType2 ;
859 _numberOfConstituentsDimension=2 ;
860 _numberOfConstituents=new int[2] ;
861 _numberOfConstituents[0]=5 ;
862 _numberOfConstituents[1]=9 ;
863 _numberOfNodeOfEachConstituent=new int*[2] ;
864 _numberOfNodeOfEachConstituent[0]=new int[5] ;
865 _numberOfNodeOfEachConstituent[0][0]=3 ;
866 _numberOfNodeOfEachConstituent[0][1]=3 ;
867 _numberOfNodeOfEachConstituent[0][2]=4 ;
868 _numberOfNodeOfEachConstituent[0][3]=4 ;
869 _numberOfNodeOfEachConstituent[0][4]=4 ;
870 _numberOfNodeOfEachConstituent[1]=new int[9] ;
871 _numberOfNodeOfEachConstituent[1][0]=2 ;
872 _numberOfNodeOfEachConstituent[1][1]=2 ;
873 _numberOfNodeOfEachConstituent[1][2]=2 ;
874 _numberOfNodeOfEachConstituent[1][3]=2 ;
875 _numberOfNodeOfEachConstituent[1][4]=2 ;
876 _numberOfNodeOfEachConstituent[1][5]=2 ;
877 _numberOfNodeOfEachConstituent[1][6]=2 ;
878 _numberOfNodeOfEachConstituent[1][7]=2 ;
879 _numberOfNodeOfEachConstituent[1][8]=2 ;
881 int* _edge1=new int[2];
884 int* _edge2=new int[2];
887 int* _edge3=new int[2];
890 int* _edge4=new int[2];
893 int* _edge5=new int[2];
896 int* _edge6=new int[2];
899 int* _edge7=new int[2];
902 int* _edge8=new int[2];
905 int* _edge9=new int[2];
908 int* _face1=new int[3];
912 int* _face2=new int[3];
916 int* _face3=new int[4];
921 int* _face4=new int[4];
926 int* _face5=new int[4];
931 int ** tmpConstituents1 = new int*[5];
932 tmpConstituents1[0]=_face1 ;
933 tmpConstituents1[1]=_face2 ;
934 tmpConstituents1[2]=_face3 ;
935 tmpConstituents1[3]=_face4 ;
936 tmpConstituents1[4]=_face5 ;
937 int ** tmpConstituents2 = new int*[9];
938 tmpConstituents2[0]=_edge1 ;
939 tmpConstituents2[1]=_edge2 ;
940 tmpConstituents2[2]=_edge3 ;
941 tmpConstituents2[3]=_edge4 ;
942 tmpConstituents2[4]=_edge5 ;
943 tmpConstituents2[5]=_edge6 ;
944 tmpConstituents2[6]=_edge7 ;
945 tmpConstituents2[7]=_edge8 ;
946 tmpConstituents2[8]=_edge9 ;
947 _constituents = new int**[2] ;
948 _constituents[0]=tmpConstituents1 ;
949 _constituents[1]=tmpConstituents2 ;
950 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
951 tmpConstituentsType1[0] = MED_TRIA3 ;
952 tmpConstituentsType1[1] = MED_TRIA3 ;
953 tmpConstituentsType1[2] = MED_QUAD4 ;
954 tmpConstituentsType1[3] = MED_QUAD4 ;
955 tmpConstituentsType1[4] = MED_QUAD4 ;
956 medGeometryElement * tmpConstituentsType2 = new medGeometryElement[9] ;
957 tmpConstituentsType2[0] = MED_SEG2 ;
958 tmpConstituentsType2[1] = MED_SEG2 ;
959 tmpConstituentsType2[2] = MED_SEG2 ;
960 tmpConstituentsType2[3] = MED_SEG2 ;
961 tmpConstituentsType2[4] = MED_SEG2 ;
962 tmpConstituentsType2[5] = MED_SEG2 ;
963 tmpConstituentsType2[6] = MED_SEG2 ;
964 tmpConstituentsType2[7] = MED_SEG2 ;
965 tmpConstituentsType2[8] = MED_SEG2 ;
966 _constituentsType = new medGeometryElement*[2] ;
967 _constituentsType[0]=tmpConstituentsType1 ;
968 _constituentsType[1]=tmpConstituentsType2 ;
972 _name="MED_PENTA15" ;
977 _numberOfConstituentsDimension=2 ;
978 _numberOfConstituents=new int[2] ;
979 _numberOfConstituents[0]=5 ;
980 _numberOfConstituents[1]=9 ;
981 _numberOfNodeOfEachConstituent=new int*[2] ;
982 _numberOfNodeOfEachConstituent[0]=new int[5] ;
983 _numberOfNodeOfEachConstituent[0][0]=6 ;
984 _numberOfNodeOfEachConstituent[0][1]=6 ;
985 _numberOfNodeOfEachConstituent[0][2]=8 ;
986 _numberOfNodeOfEachConstituent[0][3]=8 ;
987 _numberOfNodeOfEachConstituent[0][4]=8 ;
988 _numberOfNodeOfEachConstituent[1]=new int[9] ;
989 _numberOfNodeOfEachConstituent[1][0]=3 ;
990 _numberOfNodeOfEachConstituent[1][1]=3 ;
991 _numberOfNodeOfEachConstituent[1][2]=3 ;
992 _numberOfNodeOfEachConstituent[1][3]=3 ;
993 _numberOfNodeOfEachConstituent[1][4]=3 ;
994 _numberOfNodeOfEachConstituent[1][5]=3 ;
995 _numberOfNodeOfEachConstituent[1][6]=3 ;
996 _numberOfNodeOfEachConstituent[1][7]=3 ;
997 _numberOfNodeOfEachConstituent[1][8]=3 ;
999 int* _edge1=new int[3];
1003 int* _edge2=new int[3];
1007 int* _edge3=new int[3];
1011 int* _edge4=new int[3];
1015 int* _edge5=new int[3];
1019 int* _edge6=new int[3];
1023 int* _edge7=new int[3];
1027 int* _edge8=new int[3];
1031 int* _edge9=new int[3];
1035 int* _face1=new int[6];
1042 int* _face2=new int[6];
1049 int* _face3=new int[8];
1058 int* _face4=new int[8];
1067 int* _face5=new int[8];
1076 int ** tmpConstituents1 = new int*[5];
1077 tmpConstituents1[0]=_face1 ;
1078 tmpConstituents1[1]=_face2 ;
1079 tmpConstituents1[2]=_face3 ;
1080 tmpConstituents1[3]=_face4 ;
1081 tmpConstituents1[4]=_face5 ;
1082 int ** tmpConstituents2 = new int*[9];
1083 tmpConstituents2[0]=_edge1 ;
1084 tmpConstituents2[1]=_edge2 ;
1085 tmpConstituents2[2]=_edge3 ;
1086 tmpConstituents2[3]=_edge4 ;
1087 tmpConstituents2[4]=_edge5 ;
1088 tmpConstituents2[5]=_edge6 ;
1089 tmpConstituents2[6]=_edge7 ;
1090 tmpConstituents2[7]=_edge8 ;
1091 tmpConstituents2[8]=_edge9 ;
1092 _constituents = new int**[2] ;
1093 _constituents[0]=tmpConstituents1 ;
1094 _constituents[1]=tmpConstituents2 ;
1095 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
1096 tmpConstituentsType1[0] = MED_TRIA6 ;
1097 tmpConstituentsType1[1] = MED_TRIA6 ;
1098 tmpConstituentsType1[2] = MED_QUAD8 ;
1099 tmpConstituentsType1[3] = MED_QUAD8 ;
1100 tmpConstituentsType1[4] = MED_QUAD8 ;
1101 medGeometryElement * tmpConstituentsType2 = new medGeometryElement[9] ;
1102 tmpConstituentsType2[0] = MED_SEG3 ;
1103 tmpConstituentsType2[1] = MED_SEG3 ;
1104 tmpConstituentsType2[2] = MED_SEG3 ;
1105 tmpConstituentsType2[3] = MED_SEG3 ;
1106 tmpConstituentsType2[4] = MED_SEG3 ;
1107 tmpConstituentsType2[5] = MED_SEG3 ;
1108 tmpConstituentsType2[6] = MED_SEG3 ;
1109 tmpConstituentsType2[7] = MED_SEG3 ;
1110 tmpConstituentsType2[8] = MED_SEG3 ;
1111 _constituentsType = new medGeometryElement*[2] ;
1112 _constituentsType[0]=tmpConstituentsType1 ;
1113 _constituentsType[1]=tmpConstituentsType2 ;
1120 _numberOfVertexes=5;
1122 _numberOfConstituentsDimension=2 ;
1123 _numberOfConstituents=new int[2] ;
1124 _numberOfConstituents[0]=5 ;
1125 _numberOfConstituents[1]=8 ;
1126 _numberOfNodeOfEachConstituent=new int*[2] ;
1127 _numberOfNodeOfEachConstituent[0]=new int[5] ;
1128 _numberOfNodeOfEachConstituent[0][0]=4 ;
1129 _numberOfNodeOfEachConstituent[0][1]=3 ;
1130 _numberOfNodeOfEachConstituent[0][2]=3 ;
1131 _numberOfNodeOfEachConstituent[0][3]=3 ;
1132 _numberOfNodeOfEachConstituent[0][4]=3 ;
1133 _numberOfNodeOfEachConstituent[1]=new int[8] ;
1134 _numberOfNodeOfEachConstituent[1][0]=2 ;
1135 _numberOfNodeOfEachConstituent[1][1]=2 ;
1136 _numberOfNodeOfEachConstituent[1][2]=2 ;
1137 _numberOfNodeOfEachConstituent[1][3]=2 ;
1138 _numberOfNodeOfEachConstituent[1][4]=2 ;
1139 _numberOfNodeOfEachConstituent[1][5]=2 ;
1140 _numberOfNodeOfEachConstituent[1][6]=2 ;
1141 _numberOfNodeOfEachConstituent[1][7]=2 ;
1143 int* _edge1=new int[2];
1146 int* _edge2=new int[2];
1149 int* _edge3=new int[2];
1152 int* _edge4=new int[2];
1155 int* _edge5=new int[2];
1158 int* _edge6=new int[2];
1161 int* _edge7=new int[2];
1164 int* _edge8=new int[2];
1167 int* _face1=new int[4];
1172 int* _face2=new int[3];
1176 int* _face3=new int[3];
1180 int* _face4=new int[3];
1184 int* _face5=new int[3];
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*[8];
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 _constituents = new int**[2] ;
1204 _constituents[0]=tmpConstituents1 ;
1205 _constituents[1]=tmpConstituents2 ;
1206 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
1207 tmpConstituentsType1[0] = MED_QUAD4 ;
1208 tmpConstituentsType1[1] = MED_TRIA3 ;
1209 tmpConstituentsType1[2] = MED_TRIA3 ;
1210 tmpConstituentsType1[3] = MED_TRIA3 ;
1211 tmpConstituentsType1[4] = MED_TRIA3 ;
1212 medGeometryElement * tmpConstituentsType2 = new medGeometryElement[8] ;
1213 tmpConstituentsType2[0] = MED_SEG2 ;
1214 tmpConstituentsType2[1] = MED_SEG2 ;
1215 tmpConstituentsType2[2] = MED_SEG2 ;
1216 tmpConstituentsType2[3] = MED_SEG2 ;
1217 tmpConstituentsType2[4] = MED_SEG2 ;
1218 tmpConstituentsType2[5] = MED_SEG2 ;
1219 tmpConstituentsType2[6] = MED_SEG2 ;
1220 tmpConstituentsType2[7] = MED_SEG2 ;
1221 _constituentsType = new medGeometryElement*[2] ;
1222 _constituentsType[0]=tmpConstituentsType1 ;
1223 _constituentsType[1]=tmpConstituentsType2 ;
1227 _name="MED_PYRA13" ;
1230 _numberOfVertexes=5;
1232 _numberOfConstituentsDimension=2 ;
1233 _numberOfConstituents=new int[2] ;
1234 _numberOfConstituents[0]=5 ;
1235 _numberOfConstituents[1]=8 ;
1236 _numberOfNodeOfEachConstituent=new int*[2] ;
1237 _numberOfNodeOfEachConstituent[0]=new int[5] ;
1238 _numberOfNodeOfEachConstituent[0][0]=8 ;
1239 _numberOfNodeOfEachConstituent[0][1]=6 ;
1240 _numberOfNodeOfEachConstituent[0][2]=6 ;
1241 _numberOfNodeOfEachConstituent[0][3]=6 ;
1242 _numberOfNodeOfEachConstituent[0][4]=6 ;
1243 _numberOfNodeOfEachConstituent[1]=new int[8] ;
1244 _numberOfNodeOfEachConstituent[1][0]=3 ;
1245 _numberOfNodeOfEachConstituent[1][1]=3 ;
1246 _numberOfNodeOfEachConstituent[1][2]=3 ;
1247 _numberOfNodeOfEachConstituent[1][3]=3 ;
1248 _numberOfNodeOfEachConstituent[1][4]=3 ;
1249 _numberOfNodeOfEachConstituent[1][5]=3 ;
1250 _numberOfNodeOfEachConstituent[1][6]=3 ;
1251 _numberOfNodeOfEachConstituent[1][7]=3 ;
1253 int* _edge1=new int[3];
1257 int* _edge2=new int[3];
1261 int* _edge3=new int[3];
1265 int* _edge4=new int[3];
1269 int* _edge5=new int[3];
1273 int* _edge6=new int[3];
1277 int* _edge7=new int[3];
1281 int* _edge8=new int[3];
1285 int* _face1=new int[8];
1294 int* _face2=new int[6];
1301 int* _face3=new int[6];
1308 int* _face4=new int[6];
1315 int* _face5=new int[6];
1322 int ** tmpConstituents1 = new int*[5];
1323 tmpConstituents1[0]=_face1 ;
1324 tmpConstituents1[1]=_face2 ;
1325 tmpConstituents1[2]=_face3 ;
1326 tmpConstituents1[3]=_face4 ;
1327 tmpConstituents1[4]=_face5 ;
1328 int ** tmpConstituents2 = new int*[8];
1329 tmpConstituents2[0]=_edge1 ;
1330 tmpConstituents2[1]=_edge2 ;
1331 tmpConstituents2[2]=_edge3 ;
1332 tmpConstituents2[3]=_edge4 ;
1333 tmpConstituents2[4]=_edge5 ;
1334 tmpConstituents2[5]=_edge6 ;
1335 tmpConstituents2[6]=_edge7 ;
1336 tmpConstituents2[7]=_edge8 ;
1337 _constituents = new int**[2] ;
1338 _constituents[0]=tmpConstituents1 ;
1339 _constituents[1]=tmpConstituents2 ;
1340 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
1341 tmpConstituentsType1[0] = MED_QUAD8 ;
1342 tmpConstituentsType1[1] = MED_TRIA6 ;
1343 tmpConstituentsType1[2] = MED_TRIA6 ;
1344 tmpConstituentsType1[3] = MED_TRIA6 ;
1345 tmpConstituentsType1[4] = MED_TRIA6 ;
1346 medGeometryElement * tmpConstituentsType2 = new medGeometryElement[8] ;
1347 tmpConstituentsType2[0] = MED_SEG3 ;
1348 tmpConstituentsType2[1] = MED_SEG3 ;
1349 tmpConstituentsType2[2] = MED_SEG3 ;
1350 tmpConstituentsType2[3] = MED_SEG3 ;
1351 tmpConstituentsType2[4] = MED_SEG3 ;
1352 tmpConstituentsType2[5] = MED_SEG3 ;
1353 tmpConstituentsType2[6] = MED_SEG3 ;
1354 tmpConstituentsType2[7] = MED_SEG3 ;
1355 _constituentsType = new medGeometryElement*[2] ;
1356 _constituentsType[0]=tmpConstituentsType1 ;
1357 _constituentsType[1]=tmpConstituentsType2 ;
1361 _name="MED_POLYGON" ;
1364 _numberOfConstituentsDimension=1 ;
1365 _numberOfConstituents=new int[_numberOfConstituentsDimension] ;
1366 _numberOfConstituents[0]=0 ;
1367 _numberOfNodeOfEachConstituent=new int*[_numberOfConstituentsDimension] ;
1368 _numberOfNodeOfEachConstituent[0]=0;
1369 _constituentsType = new medGeometryElement*[_numberOfConstituentsDimension] ;
1370 _constituentsType[0]=0 ;
1371 _constituents = new int**[_numberOfConstituentsDimension] ;
1375 _name="MED_POLYHEDRA" ;
1378 _numberOfConstituentsDimension=2 ;
1379 _numberOfConstituents=new int[_numberOfConstituentsDimension] ;
1380 _numberOfConstituents[0]=_numberOfConstituents[1]=0;
1381 _numberOfNodeOfEachConstituent=new int*[_numberOfConstituentsDimension] ;
1382 _numberOfNodeOfEachConstituent[0]=_numberOfNodeOfEachConstituent[1]=0;
1383 _constituentsType = new medGeometryElement*[_numberOfConstituentsDimension] ;
1384 _constituentsType[0]=_constituentsType[1]=0 ;
1385 _constituents = new int**[_numberOfConstituentsDimension] ;
1386 _constituents[0]=_constituents[1]=0;
1394 ostream & MEDMEM::operator<<(ostream &os,const CELLMODEL &my)
1396 os << "Cell Model :" << endl ;
1397 os << " - name : " << my._name << endl;
1398 os << " - type : " << (int)my._type << endl;
1399 os << " - dimension : " << my._dimension << endl;
1400 os << " - number of nodes : " << my._numberOfNodes << endl ;
1401 os << " - number of vertexes : " << my._numberOfVertexes << endl ;
1403 os << " - number of Constituents Dimension : " << my._numberOfConstituentsDimension << endl ;
1405 for(int i=0;i<my._numberOfConstituentsDimension;i++)
1408 os << " - for dimension (-" << i+1 << ") : " << endl ;
1409 os << " - number of Constituents for this Dimension : " << my._numberOfConstituents[i] << endl ;
1411 for(int j=0;j<my._numberOfConstituents[i];j++)
1413 os << " - number of node for this constituent : " << my._numberOfNodeOfEachConstituent[i][j] << endl ;
1414 os << " - constituents " << j+1 << " of type "<< my._constituentsType[i][j] <<" : " ;
1415 for(int k=0;k<my._numberOfNodeOfEachConstituent[i][j];k++)
1416 os << my._constituents[i][j][k] << " " ;
1423 // Return number of constituents type (which dimension is _dimension-1).
1424 int CELLMODEL::getNumberOfConstituentsType() 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.size() ;
1436 // Return all types of constituents which dimension is (_dimension-1).
1437 set<medGeometryElement> CELLMODEL::getAllConstituentsType() const
1439 set<medGeometryElement> constituentsTypes ;
1440 // if (_constituentsType.size() > 0 ) {
1441 // vector<medGeometryElement> constituentsType = _constituentsType[0] ;
1442 // vector<medGeometryElement>::iterator itvec ;
1443 // for(itvec=constituentsType.begin();itvec!=constituentsType.end();itvec++)
1444 // constituentsTypes.insert(*itvec);
1446 return constituentsTypes ;
1449 // Return number of constituents foreach type (which dimension is _dimension-1).
1450 map<medGeometryElement,int> CELLMODEL::getNumberOfConstituentsForeachType() const
1452 map<medGeometryElement,int> numberOfConstituentsForeachType ;
1453 // map<medGeometryElement,int>::iterator itmap ;
1454 // if (_constituentsType.size() > 0 ) {
1455 // vector<medGeometryElement> constituentsType = _constituentsType[0] ;
1456 // vector<medGeometryElement>::iterator itvec ;
1457 // for(itvec=constituentsType.begin();itvec!=constituentsType.end();itvec++) {
1458 // itmap = numberOfConstituentsForeachType.find(*itvec);
1459 // if (itmap==numberOfConstituentsForeachType.end()) // new element
1460 // numberOfConstituentsForeachType[*itvec]=1 ;
1462 // numberOfConstituentsForeachType[*itvec]++ ;
1465 return numberOfConstituentsForeachType ;
1468 void CELLMODEL::init(const CELLMODEL &m)
1472 _dimension = m._dimension ;
1473 _numberOfNodes = m._numberOfNodes ;
1474 _numberOfVertexes = m._numberOfVertexes ;
1476 _numberOfConstituentsDimension = m._numberOfConstituentsDimension ;
1478 _numberOfConstituents = new int[_numberOfConstituentsDimension] ;
1479 for(int i=0; i<_numberOfConstituentsDimension; i++)
1480 _numberOfConstituents[i]=m._numberOfConstituents[i] ;
1482 _numberOfNodeOfEachConstituent = new int*[_numberOfConstituentsDimension] ;
1483 for(int i=0; i<_numberOfConstituentsDimension; i++) {
1484 int numberOf = _numberOfConstituents[i] ;
1485 int * newArray = new int[numberOf] ;
1486 int * oldArray = m._numberOfNodeOfEachConstituent[i] ;
1487 for(int j=0; j<numberOf; j++)
1488 newArray[j] = oldArray[j] ;
1489 _numberOfNodeOfEachConstituent[i] = newArray ;
1491 _constituents = new int**[_numberOfConstituentsDimension] ;
1492 if(_constituentsType)
1494 for(int i=0; i<_numberOfConstituentsDimension; i++)
1495 delete [] _constituentsType[i];
1496 delete [] _constituentsType;
1498 _constituentsType = new medGeometryElement*[_numberOfConstituentsDimension] ;
1499 for(int i=0; i<_numberOfConstituentsDimension; i++) {
1500 int numberOf = _numberOfConstituents[i] ;
1501 int ** tmpArray = new int*[numberOf] ;
1502 medGeometryElement * newArrayType = new medGeometryElement[numberOf] ;
1503 medGeometryElement * oldArrayType = m._constituentsType[i] ;
1505 for(int j=0; j<numberOf; j++) {
1506 int numberOf2 = _numberOfNodeOfEachConstituent[i][j] ;
1507 int * newArray = new int[numberOf2] ;
1508 int * oldArray = m._constituents[i][j] ;
1509 for(int k=0; k<numberOf2; k++)
1510 newArray[k] = oldArray[k] ;
1511 tmpArray[j] = newArray ;
1512 newArrayType[j] = oldArrayType[j] ;
1514 _constituents[i] = tmpArray ;
1515 _constituentsType[i] = newArrayType ;
1519 void CELLMODEL::clean()
1521 for(int i=0; i<_numberOfConstituentsDimension; i++) {
1522 int numberOf = _numberOfConstituents[i] ;
1523 for(int j=0; j<numberOf; j++) {
1524 if (_constituents[i][j])
1525 delete[] _constituents[i][j] ;
1527 if (_constituentsType[i])
1528 delete [] _constituentsType[i] ;
1529 if (_constituents[i])
1530 delete[] _constituents[i] ;
1531 if (_numberOfNodeOfEachConstituent[i])
1532 delete[] _numberOfNodeOfEachConstituent[i] ;
1534 delete [] _constituentsType;
1535 if (_numberOfConstituents)
1536 delete[]_numberOfConstituents ;
1538 delete[] _constituents ;
1539 if (_numberOfNodeOfEachConstituent)
1540 delete[] _numberOfNodeOfEachConstituent ;
1542 _constituentsType = 0;
1543 _numberOfConstituents = 0;
1545 _numberOfNodeOfEachConstituent = 0;