1 // Copyright (C) 2007-2008 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
23 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::retrieveCellModel(MED_EN::medGeometryElement type)
37 return CELLMODEL_Map::getInstance()->getCellModel(type);
40 CELLMODEL_Map *CELLMODEL_Map::getInstance()
42 if(!_singleton) _singleton=new CELLMODEL_Map;
46 CELLMODEL::CELLMODEL(medGeometryElement t)
48 // init first all to nothing
52 _numberOfConstituentsDimension=0 ;
53 _numberOfConstituents=(int*)NULL ;
54 _numberOfNodeOfEachConstituent=(int**)NULL ;
55 _constituents=(int***)NULL ;
56 //_numberOfonstituentsType=(int*)NULL ;
57 _constituentsType=(medGeometryElement**)NULL ;
59 MESSAGE_MED("CELLMODEL : constructeur pour le type " << t);
68 // nothing else : POINT are none constituent
77 // constituent are POINT1 and we have no need to define _constituents vector
78 _numberOfConstituentsDimension=1 ;
79 _numberOfConstituents=new int[1] ;
80 _numberOfConstituents[0]=2 ;
81 _numberOfNodeOfEachConstituent=new int*[1] ;
82 _numberOfNodeOfEachConstituent[0]=new int[2] ;
83 _numberOfNodeOfEachConstituent[0][0]=1 ;
84 _numberOfNodeOfEachConstituent[0][1]=1 ;
86 _constituents = new int**[1] ;
87 _constituents[0] = new int*[2] ;
88 _constituents[0][0] = new int[1] ;
89 _constituents[0][0][0] = 1 ;
90 _constituents[0][1] = new int[1] ;
91 _constituents[0][1][0] = 2 ;
93 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[2] ;
94 tmpConstituentsType1[0] = MED_POINT1 ;
95 tmpConstituentsType1[1] = MED_POINT1 ;
96 _constituentsType = new medGeometryElement*[1] ;
97 _constituentsType[0]=tmpConstituentsType1 ;
106 // constituent are POINT1 and we have no need to define _constituents vector
107 _numberOfConstituentsDimension=1 ;
108 _numberOfConstituents=new int[1] ;
109 _numberOfConstituents[0]=3 ;
110 _numberOfNodeOfEachConstituent=new int*[1] ;
111 _numberOfNodeOfEachConstituent[0]=new int[3] ;
112 _numberOfNodeOfEachConstituent[0][0]=1 ;
113 _numberOfNodeOfEachConstituent[0][1]=1 ;
114 _numberOfNodeOfEachConstituent[0][2]=1 ;
116 _constituents = new int**[1] ;
117 _constituents[0] = new int*[3] ;
118 _constituents[0][0] = new int[1] ;
119 _constituents[0][0][0] = 1 ;
120 _constituents[0][1] = new int[1] ;
121 _constituents[0][1][0] = 2 ;
122 _constituents[0][2] = new int[1] ;
123 _constituents[0][2][0] = 3 ;
125 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[3] ;
126 tmpConstituentsType1[0] = MED_POINT1 ;
127 tmpConstituentsType1[1] = MED_POINT1 ;
128 tmpConstituentsType1[2] = MED_POINT1 ;
129 _constituentsType = new medGeometryElement*[1] ;
130 _constituentsType[0]=tmpConstituentsType1 ;
140 _numberOfConstituentsDimension=1 ;
141 _numberOfConstituents=new int[1] ;
142 _numberOfConstituents[0]=3 ;
143 _numberOfNodeOfEachConstituent=new int*[1] ;
144 _numberOfNodeOfEachConstituent[0]=new int[3] ;
145 _numberOfNodeOfEachConstituent[0][0]=2 ;
146 _numberOfNodeOfEachConstituent[0][1]=2 ;
147 _numberOfNodeOfEachConstituent[0][2]=2 ;
149 int* _edge1=new int[2];
152 int* _edge2=new int[2];
155 int* _edge3=new int[2];
158 int ** tmpConstituents1 = new int*[3];
159 tmpConstituents1[0]=_edge1 ;
160 tmpConstituents1[1]=_edge2 ;
161 tmpConstituents1[2]=_edge3 ;
162 _constituents = new int**[1] ;
163 _constituents[0]=tmpConstituents1 ;
165 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[3] ;
166 tmpConstituentsType1[0] = MED_SEG2 ;
167 tmpConstituentsType1[1] = MED_SEG2 ;
168 tmpConstituentsType1[2] = MED_SEG2 ;
169 // medGeometryElement * tmpConstituentsType2 = new medGeometryElement[3] ;
170 // tmpConstituentsType2[0] = MED_POINT1 ;
171 // tmpConstituentsType2[1] = MED_POINT1 ;
172 // tmpConstituentsType2[2] = MED_POINT1 ;
173 // _constituentsType = new medGeometryElement*[2] ;
174 _constituentsType = new medGeometryElement*[1] ;
175 _constituentsType[0]=tmpConstituentsType1 ;
176 // _constituentsType[1]=tmpConstituentsType2 ;
177 // Well, point are defined, but could not be acces because we have
178 // only 1 numberOfConstituentsDimension !
188 _numberOfConstituentsDimension=1 ;
189 _numberOfConstituents=new int[1] ;
190 _numberOfConstituents[0]=3 ;
191 _numberOfNodeOfEachConstituent=new int*[1] ;
192 _numberOfNodeOfEachConstituent[0]=new int[3] ;
193 _numberOfNodeOfEachConstituent[0][0]=3 ;
194 _numberOfNodeOfEachConstituent[0][1]=3 ;
195 _numberOfNodeOfEachConstituent[0][2]=3 ;
197 int* _edge1=new int[3];
201 int* _edge2=new int[3];
205 int* _edge3=new int[3];
209 int ** tmpConstituents1 = new int*[3];
210 tmpConstituents1[0]=_edge1 ;
211 tmpConstituents1[1]=_edge2 ;
212 tmpConstituents1[2]=_edge3 ;
213 _constituents = new int**[1] ;
214 _constituents[0]=tmpConstituents1 ;
215 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[3] ;
216 tmpConstituentsType1[0] = MED_SEG3 ;
217 tmpConstituentsType1[1] = MED_SEG3 ;
218 tmpConstituentsType1[2] = MED_SEG3 ;
219 // medGeometryElement * tmpConstituentsType2 = new medGeometryElement[6] ;
220 // tmpConstituentsType2[0] = MED_POINT1 ;
221 // tmpConstituentsType2[1] = MED_POINT1 ;
222 // tmpConstituentsType2[2] = MED_POINT1 ;
223 // tmpConstituentsType2[3] = MED_POINT1 ;
224 // tmpConstituentsType2[4] = MED_POINT1 ;
225 // tmpConstituentsType2[5] = MED_POINT1 ;
226 // _constituentsType = new medGeometryElement*[2] ;
227 _constituentsType = new medGeometryElement*[1] ;
228 _constituentsType[0]=tmpConstituentsType1 ;
229 // _constituentsType[1]=tmpConstituentsType2 ;
230 // Well, point are defined, but could not be acces because we have
231 // only 1 numberOfConstituentsDimension !
241 _numberOfConstituentsDimension=1 ;
242 _numberOfConstituents=new int[1] ;
243 _numberOfConstituents[0]=4 ;
244 _numberOfNodeOfEachConstituent=new int*[1] ;
245 _numberOfNodeOfEachConstituent[0]=new int[4] ;
246 _numberOfNodeOfEachConstituent[0][0]=2 ;
247 _numberOfNodeOfEachConstituent[0][1]=2 ;
248 _numberOfNodeOfEachConstituent[0][2]=2 ;
249 _numberOfNodeOfEachConstituent[0][3]=2 ;
251 int* _edge1=new int[2];
254 int* _edge2=new int[2];
257 int* _edge3=new int[2];
260 int* _edge4=new int[2];
263 int ** tmpConstituents1 = new int*[4];
264 tmpConstituents1[0]=_edge1 ;
265 tmpConstituents1[1]=_edge2 ;
266 tmpConstituents1[2]=_edge3 ;
267 tmpConstituents1[3]=_edge4 ;
268 _constituents = new int**[1] ;
269 _constituents[0]=tmpConstituents1 ;
270 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
271 tmpConstituentsType1[0] = MED_SEG2 ;
272 tmpConstituentsType1[1] = MED_SEG2 ;
273 tmpConstituentsType1[2] = MED_SEG2 ;
274 tmpConstituentsType1[3] = MED_SEG2 ;
275 // medGeometryElement * tmpConstituentsType2 = new medGeometryElement[4] ;
276 // tmpConstituentsType2[0] = MED_POINT1 ;
277 // tmpConstituentsType2[1] = MED_POINT1 ;
278 // tmpConstituentsType2[2] = MED_POINT1 ;
279 // tmpConstituentsType2[3] = MED_POINT1 ;
280 // _constituentsType = new medGeometryElement*[2] ;
281 _constituentsType = new medGeometryElement*[1] ;
282 _constituentsType[0]=tmpConstituentsType1 ;
283 // _constituentsType[1]=tmpConstituentsType2 ;
284 // Well, point are defined, but could not be acces because we have
285 // only 1 numberOfConstituentsDimension !
295 _numberOfConstituentsDimension=1 ;
296 _numberOfConstituents=new int[1] ;
297 _numberOfConstituents[0]=4 ;
298 _numberOfNodeOfEachConstituent=new int*[1] ;
299 _numberOfNodeOfEachConstituent[0]=new int[4] ;
300 _numberOfNodeOfEachConstituent[0][0]=3 ;
301 _numberOfNodeOfEachConstituent[0][1]=3 ;
302 _numberOfNodeOfEachConstituent[0][2]=3 ;
303 _numberOfNodeOfEachConstituent[0][3]=3 ;
305 int* _edge1=new int[3];
309 int* _edge2=new int[3];
313 int* _edge3=new int[3];
317 int* _edge4=new int[3];
321 int ** tmpConstituents1 = new int*[4];
322 tmpConstituents1[0]=_edge1 ;
323 tmpConstituents1[1]=_edge2 ;
324 tmpConstituents1[2]=_edge3 ;
325 tmpConstituents1[3]=_edge4 ;
326 _constituents = new int**[1] ;
327 _constituents[0]=tmpConstituents1 ;
328 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
329 tmpConstituentsType1[0] = MED_SEG3 ;
330 tmpConstituentsType1[1] = MED_SEG3 ;
331 tmpConstituentsType1[2] = MED_SEG3 ;
332 tmpConstituentsType1[3] = MED_SEG3 ;
333 // medGeometryElement * tmpConstituentsType2 = new medGeometryElement[8] ;
334 // tmpConstituentsType2[0] = MED_POINT1 ;
335 // tmpConstituentsType2[1] = MED_POINT1 ;
336 // tmpConstituentsType2[2] = MED_POINT1 ;
337 // tmpConstituentsType2[3] = MED_POINT1 ;
338 // tmpConstituentsType2[4] = MED_POINT1 ;
339 // tmpConstituentsType2[5] = MED_POINT1 ;
340 // tmpConstituentsType2[6] = MED_POINT1 ;
341 // tmpConstituentsType2[7] = MED_POINT1 ;
342 // _constituentsType = new medGeometryElement*[2] ;
343 _constituentsType = new medGeometryElement*[1] ;
344 _constituentsType[0]=tmpConstituentsType1 ;
345 // _constituentsType[1]=tmpConstituentsType2 ;
346 // Well, point are defined, but could not be acces because we have
347 // only 1 numberOfConstituentsDimension !
357 _numberOfConstituentsDimension=2 ;
358 _numberOfConstituents=new int[2] ;
359 _numberOfConstituents[0]=4 ;
360 _numberOfConstituents[1]=6 ;
361 _numberOfNodeOfEachConstituent=new int*[2] ;
362 _numberOfNodeOfEachConstituent[0]=new int[4] ;
363 _numberOfNodeOfEachConstituent[0][0]=3 ;
364 _numberOfNodeOfEachConstituent[0][1]=3 ;
365 _numberOfNodeOfEachConstituent[0][2]=3 ;
366 _numberOfNodeOfEachConstituent[0][3]=3 ;
367 _numberOfNodeOfEachConstituent[1]=new int[6] ;
368 _numberOfNodeOfEachConstituent[1][0]=2 ;
369 _numberOfNodeOfEachConstituent[1][1]=2 ;
370 _numberOfNodeOfEachConstituent[1][2]=2 ;
371 _numberOfNodeOfEachConstituent[1][3]=2 ;
372 _numberOfNodeOfEachConstituent[1][4]=2 ;
373 _numberOfNodeOfEachConstituent[1][5]=2 ;
375 int* _face1=new int[3];
379 int* _face2=new int[3];
383 int* _face3=new int[3];
387 int* _face4=new int[3];
391 int* _edge1=new int[2];
394 int* _edge2=new int[2];
397 int* _edge3=new int[2];
400 int* _edge4=new int[2];
403 int* _edge5=new int[2];
406 int* _edge6=new int[2];
409 int ** tmpConstituents1 = new int*[4];
410 tmpConstituents1[0]=_face1 ;
411 tmpConstituents1[1]=_face2 ;
412 tmpConstituents1[2]=_face3 ;
413 tmpConstituents1[3]=_face4 ;
414 int ** tmpConstituents2 = new int*[6];
415 tmpConstituents2[0]=_edge1 ;
416 tmpConstituents2[1]=_edge2 ;
417 tmpConstituents2[2]=_edge3 ;
418 tmpConstituents2[3]=_edge4 ;
419 tmpConstituents2[4]=_edge5 ;
420 tmpConstituents2[5]=_edge6 ;
421 _constituents = new int**[2] ;
422 _constituents[0]=tmpConstituents1 ;
423 _constituents[1]=tmpConstituents2 ;
424 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
425 tmpConstituentsType1[0] = MED_TRIA3 ;
426 tmpConstituentsType1[1] = MED_TRIA3 ;
427 tmpConstituentsType1[2] = MED_TRIA3 ;
428 tmpConstituentsType1[3] = MED_TRIA3 ;
429 medGeometryElement * tmpConstituentsType2 = new medGeometryElement[6] ;
430 tmpConstituentsType2[0] = MED_SEG2 ;
431 tmpConstituentsType2[1] = MED_SEG2 ;
432 tmpConstituentsType2[2] = MED_SEG2 ;
433 tmpConstituentsType2[3] = MED_SEG2 ;
434 tmpConstituentsType2[4] = MED_SEG2 ;
435 tmpConstituentsType2[5] = MED_SEG2 ;
436 _constituentsType = new medGeometryElement*[2] ;
437 _constituentsType[0]=tmpConstituentsType1 ;
438 _constituentsType[1]=tmpConstituentsType2 ;
442 _name="MED_TETRA10" ;
447 _numberOfConstituentsDimension=2 ;
448 _numberOfConstituents=new int[2] ;
449 _numberOfConstituents[0]=4 ;
450 _numberOfConstituents[1]=6 ;
451 _numberOfNodeOfEachConstituent=new int*[2] ;
452 _numberOfNodeOfEachConstituent[0]=new int[4] ;
453 _numberOfNodeOfEachConstituent[0][0]=6 ;
454 _numberOfNodeOfEachConstituent[0][1]=6 ;
455 _numberOfNodeOfEachConstituent[0][2]=6 ;
456 _numberOfNodeOfEachConstituent[0][3]=6 ;
457 _numberOfNodeOfEachConstituent[1]=new int[6] ;
458 _numberOfNodeOfEachConstituent[1][0]=3 ;
459 _numberOfNodeOfEachConstituent[1][1]=3 ;
460 _numberOfNodeOfEachConstituent[1][2]=3 ;
461 _numberOfNodeOfEachConstituent[1][3]=3 ;
462 _numberOfNodeOfEachConstituent[1][4]=3 ;
463 _numberOfNodeOfEachConstituent[1][5]=3 ;
465 int* _face1=new int[6];
472 int* _face2=new int[6];
479 int* _face3=new int[6];
486 int* _face4=new int[6];
493 int* _edge1=new int[3];
497 int* _edge2=new int[3];
501 int* _edge3=new int[3];
505 int* _edge4=new int[3];
509 int* _edge5=new int[3];
513 int* _edge6=new int[3];
517 int ** tmpConstituents1 = new int*[4];
518 tmpConstituents1[0]=_face1 ;
519 tmpConstituents1[1]=_face2 ;
520 tmpConstituents1[2]=_face3 ;
521 tmpConstituents1[3]=_face4 ;
522 int ** tmpConstituents2 = new int*[6];
523 tmpConstituents2[0]=_edge1 ;
524 tmpConstituents2[1]=_edge2 ;
525 tmpConstituents2[2]=_edge3 ;
526 tmpConstituents2[3]=_edge4 ;
527 tmpConstituents2[4]=_edge5 ;
528 tmpConstituents2[5]=_edge6 ;
529 _constituents = new int**[2] ;
530 _constituents[0]=tmpConstituents1 ;
531 _constituents[1]=tmpConstituents2 ;
532 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
533 tmpConstituentsType1[0] = MED_TRIA6 ;
534 tmpConstituentsType1[1] = MED_TRIA6 ;
535 tmpConstituentsType1[2] = MED_TRIA6 ;
536 tmpConstituentsType1[3] = MED_TRIA6 ;
537 medGeometryElement * tmpConstituentsType2 = new medGeometryElement[6] ;
538 tmpConstituentsType2[0] = MED_SEG3 ;
539 tmpConstituentsType2[1] = MED_SEG3 ;
540 tmpConstituentsType2[2] = MED_SEG3 ;
541 tmpConstituentsType2[3] = MED_SEG3 ;
542 tmpConstituentsType2[4] = MED_SEG3 ;
543 tmpConstituentsType2[5] = MED_SEG3 ;
544 _constituentsType = new medGeometryElement*[2] ;
545 _constituentsType[0]=tmpConstituentsType1 ;
546 _constituentsType[1]=tmpConstituentsType2 ;
555 _numberOfConstituentsDimension=2 ;
556 _numberOfConstituents=new int[2] ;
557 _numberOfConstituents[0]=6 ;
558 _numberOfConstituents[1]=12 ;
559 _numberOfNodeOfEachConstituent=new int*[2] ;
560 _numberOfNodeOfEachConstituent[0]=new int[6] ;
561 _numberOfNodeOfEachConstituent[0][0]=4 ;
562 _numberOfNodeOfEachConstituent[0][1]=4 ;
563 _numberOfNodeOfEachConstituent[0][2]=4 ;
564 _numberOfNodeOfEachConstituent[0][3]=4 ;
565 _numberOfNodeOfEachConstituent[0][4]=4 ;
566 _numberOfNodeOfEachConstituent[0][5]=4 ;
567 _numberOfNodeOfEachConstituent[1]=new int[12] ;
568 _numberOfNodeOfEachConstituent[1][0]=2 ;
569 _numberOfNodeOfEachConstituent[1][1]=2 ;
570 _numberOfNodeOfEachConstituent[1][2]=2 ;
571 _numberOfNodeOfEachConstituent[1][3]=2 ;
572 _numberOfNodeOfEachConstituent[1][4]=2 ;
573 _numberOfNodeOfEachConstituent[1][5]=2 ;
574 _numberOfNodeOfEachConstituent[1][6]=2 ;
575 _numberOfNodeOfEachConstituent[1][7]=2 ;
576 _numberOfNodeOfEachConstituent[1][8]=2 ;
577 _numberOfNodeOfEachConstituent[1][9]=2 ;
578 _numberOfNodeOfEachConstituent[1][10]=2 ;
579 _numberOfNodeOfEachConstituent[1][11]=2 ;
581 int* _edge1=new int[2];
584 int* _edge2=new int[2];
587 int* _edge3=new int[2];
590 int* _edge4=new int[2];
593 int* _edge5=new int[2];
596 int* _edge6=new int[2];
599 int* _edge7=new int[2];
602 int* _edge8=new int[2];
605 int* _edge9=new int[2];
608 int* _edge10=new int[2];
611 int* _edge11=new int[2];
614 int* _edge12=new int[2];
617 int* _face1=new int[4];
622 int* _face2=new int[4];
627 int* _face3=new int[4];
632 int* _face4=new int[4];
637 int* _face5=new int[4];
642 int* _face6=new int[4];
647 int ** tmpConstituents1 = new int*[6];
648 tmpConstituents1[0]=_face1 ;
649 tmpConstituents1[1]=_face2 ;
650 tmpConstituents1[2]=_face3 ;
651 tmpConstituents1[3]=_face4 ;
652 tmpConstituents1[4]=_face5 ;
653 tmpConstituents1[5]=_face6 ;
654 int ** tmpConstituents2 = new int*[12];
655 tmpConstituents2[0]=_edge1 ;
656 tmpConstituents2[1]=_edge2 ;
657 tmpConstituents2[2]=_edge3 ;
658 tmpConstituents2[3]=_edge4 ;
659 tmpConstituents2[4]=_edge5 ;
660 tmpConstituents2[5]=_edge6 ;
661 tmpConstituents2[6]=_edge7 ;
662 tmpConstituents2[7]=_edge8 ;
663 tmpConstituents2[8]=_edge9 ;
664 tmpConstituents2[9]=_edge10;
665 tmpConstituents2[10]=_edge11;
666 tmpConstituents2[11]=_edge12;
667 _constituents = new int**[2] ;
668 _constituents[0]=tmpConstituents1 ;
669 _constituents[1]=tmpConstituents2 ;
670 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[6] ;
671 tmpConstituentsType1[0] = MED_QUAD4 ;
672 tmpConstituentsType1[1] = MED_QUAD4 ;
673 tmpConstituentsType1[2] = MED_QUAD4 ;
674 tmpConstituentsType1[3] = MED_QUAD4 ;
675 tmpConstituentsType1[4] = MED_QUAD4 ;
676 tmpConstituentsType1[5] = MED_QUAD4 ;
677 medGeometryElement * tmpConstituentsType2 = new medGeometryElement[12] ;
678 tmpConstituentsType2[0] = MED_SEG2 ;
679 tmpConstituentsType2[1] = MED_SEG2 ;
680 tmpConstituentsType2[2] = MED_SEG2 ;
681 tmpConstituentsType2[3] = MED_SEG2 ;
682 tmpConstituentsType2[4] = MED_SEG2 ;
683 tmpConstituentsType2[5] = MED_SEG2 ;
684 tmpConstituentsType2[6] = MED_SEG2 ;
685 tmpConstituentsType2[7] = MED_SEG2 ;
686 tmpConstituentsType2[8] = MED_SEG2 ;
687 tmpConstituentsType2[9] = MED_SEG2 ;
688 tmpConstituentsType2[10] = MED_SEG2 ;
689 tmpConstituentsType2[11] = MED_SEG2 ;
690 _constituentsType = new medGeometryElement*[2] ;
691 _constituentsType[0]=tmpConstituentsType1 ;
692 _constituentsType[1]=tmpConstituentsType2 ;
701 _numberOfConstituentsDimension=2 ;
702 _numberOfConstituents=new int[2] ;
703 _numberOfConstituents[0]=6 ;
704 _numberOfConstituents[1]=12 ;
705 _numberOfNodeOfEachConstituent=new int*[2] ;
706 _numberOfNodeOfEachConstituent[0]=new int[6] ;
707 _numberOfNodeOfEachConstituent[0][0]=8 ;
708 _numberOfNodeOfEachConstituent[0][1]=8 ;
709 _numberOfNodeOfEachConstituent[0][2]=8 ;
710 _numberOfNodeOfEachConstituent[0][3]=8 ;
711 _numberOfNodeOfEachConstituent[0][4]=8 ;
712 _numberOfNodeOfEachConstituent[0][5]=8 ;
713 _numberOfNodeOfEachConstituent[1]=new int[12] ;
714 _numberOfNodeOfEachConstituent[1][0]=3 ;
715 _numberOfNodeOfEachConstituent[1][1]=3 ;
716 _numberOfNodeOfEachConstituent[1][2]=3 ;
717 _numberOfNodeOfEachConstituent[1][3]=3 ;
718 _numberOfNodeOfEachConstituent[1][4]=3 ;
719 _numberOfNodeOfEachConstituent[1][5]=3 ;
720 _numberOfNodeOfEachConstituent[1][6]=3 ;
721 _numberOfNodeOfEachConstituent[1][7]=3 ;
722 _numberOfNodeOfEachConstituent[1][8]=3 ;
723 _numberOfNodeOfEachConstituent[1][9]=3 ;
724 _numberOfNodeOfEachConstituent[1][10]=3 ;
725 _numberOfNodeOfEachConstituent[1][11]=3 ;
727 int* _edge1=new int[3];
731 int* _edge2=new int[3];
735 int* _edge3=new int[3];
739 int* _edge4=new int[3];
743 int* _edge5=new int[3];
747 int* _edge6=new int[3];
751 int* _edge7=new int[3];
755 int* _edge8=new int[3];
759 int* _edge9=new int[3];
763 int* _edge10=new int[3];
767 int* _edge11=new int[3];
771 int* _edge12=new int[3];
775 int* _face1=new int[8];
784 int* _face2=new int[8];
793 int* _face3=new int[8];
802 int* _face4=new int[8];
811 int* _face5=new int[8];
820 int* _face6=new int[8];
829 int ** tmpConstituents1 = new int*[6];
830 tmpConstituents1[0]=_face1 ;
831 tmpConstituents1[1]=_face2 ;
832 tmpConstituents1[2]=_face3 ;
833 tmpConstituents1[3]=_face4 ;
834 tmpConstituents1[4]=_face5 ;
835 tmpConstituents1[5]=_face6 ;
836 int ** tmpConstituents2 = new int*[12];
837 tmpConstituents2[0]=_edge1 ;
838 tmpConstituents2[1]=_edge2 ;
839 tmpConstituents2[2]=_edge3 ;
840 tmpConstituents2[3]=_edge4 ;
841 tmpConstituents2[4]=_edge5 ;
842 tmpConstituents2[5]=_edge6 ;
843 tmpConstituents2[6]=_edge7 ;
844 tmpConstituents2[7]=_edge8 ;
845 tmpConstituents2[8]=_edge9 ;
846 tmpConstituents2[9]=_edge10;
847 tmpConstituents2[10]=_edge11;
848 tmpConstituents2[11]=_edge12;
849 _constituents = new int**[2] ;
850 _constituents[0]=tmpConstituents1 ;
851 _constituents[1]=tmpConstituents2 ;
852 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[6] ;
853 tmpConstituentsType1[0] = MED_QUAD8 ;
854 tmpConstituentsType1[1] = MED_QUAD8 ;
855 tmpConstituentsType1[2] = MED_QUAD8 ;
856 tmpConstituentsType1[3] = MED_QUAD8 ;
857 tmpConstituentsType1[4] = MED_QUAD8 ;
858 tmpConstituentsType1[5] = MED_QUAD8 ;
859 medGeometryElement * tmpConstituentsType2 = new medGeometryElement[12] ;
860 tmpConstituentsType2[0] = MED_SEG3 ;
861 tmpConstituentsType2[1] = MED_SEG3 ;
862 tmpConstituentsType2[2] = MED_SEG3 ;
863 tmpConstituentsType2[3] = MED_SEG3 ;
864 tmpConstituentsType2[4] = MED_SEG3 ;
865 tmpConstituentsType2[5] = MED_SEG3 ;
866 tmpConstituentsType2[6] = MED_SEG3 ;
867 tmpConstituentsType2[7] = MED_SEG3 ;
868 tmpConstituentsType2[8] = MED_SEG3 ;
869 tmpConstituentsType2[9] = MED_SEG3 ;
870 tmpConstituentsType2[10] = MED_SEG3 ;
871 tmpConstituentsType2[11] = MED_SEG3 ;
872 _constituentsType = new medGeometryElement*[2] ;
873 _constituentsType[0]=tmpConstituentsType1 ;
874 _constituentsType[1]=tmpConstituentsType2 ;
884 _numberOfConstituentsDimension=2 ;
885 _numberOfConstituents=new int[2] ;
886 _numberOfConstituents[0]=5 ;
887 _numberOfConstituents[1]=9 ;
888 _numberOfNodeOfEachConstituent=new int*[2] ;
889 _numberOfNodeOfEachConstituent[0]=new int[5] ;
890 _numberOfNodeOfEachConstituent[0][0]=3 ;
891 _numberOfNodeOfEachConstituent[0][1]=3 ;
892 _numberOfNodeOfEachConstituent[0][2]=4 ;
893 _numberOfNodeOfEachConstituent[0][3]=4 ;
894 _numberOfNodeOfEachConstituent[0][4]=4 ;
895 _numberOfNodeOfEachConstituent[1]=new int[9] ;
896 _numberOfNodeOfEachConstituent[1][0]=2 ;
897 _numberOfNodeOfEachConstituent[1][1]=2 ;
898 _numberOfNodeOfEachConstituent[1][2]=2 ;
899 _numberOfNodeOfEachConstituent[1][3]=2 ;
900 _numberOfNodeOfEachConstituent[1][4]=2 ;
901 _numberOfNodeOfEachConstituent[1][5]=2 ;
902 _numberOfNodeOfEachConstituent[1][6]=2 ;
903 _numberOfNodeOfEachConstituent[1][7]=2 ;
904 _numberOfNodeOfEachConstituent[1][8]=2 ;
906 int* _edge1=new int[2];
909 int* _edge2=new int[2];
912 int* _edge3=new int[2];
915 int* _edge4=new int[2];
918 int* _edge5=new int[2];
921 int* _edge6=new int[2];
924 int* _edge7=new int[2];
927 int* _edge8=new int[2];
930 int* _edge9=new int[2];
933 int* _face1=new int[3];
937 int* _face2=new int[3];
941 int* _face3=new int[4];
946 int* _face4=new int[4];
951 int* _face5=new int[4];
956 int ** tmpConstituents1 = new int*[5];
957 tmpConstituents1[0]=_face1 ;
958 tmpConstituents1[1]=_face2 ;
959 tmpConstituents1[2]=_face3 ;
960 tmpConstituents1[3]=_face4 ;
961 tmpConstituents1[4]=_face5 ;
962 int ** tmpConstituents2 = new int*[9];
963 tmpConstituents2[0]=_edge1 ;
964 tmpConstituents2[1]=_edge2 ;
965 tmpConstituents2[2]=_edge3 ;
966 tmpConstituents2[3]=_edge4 ;
967 tmpConstituents2[4]=_edge5 ;
968 tmpConstituents2[5]=_edge6 ;
969 tmpConstituents2[6]=_edge7 ;
970 tmpConstituents2[7]=_edge8 ;
971 tmpConstituents2[8]=_edge9 ;
972 _constituents = new int**[2] ;
973 _constituents[0]=tmpConstituents1 ;
974 _constituents[1]=tmpConstituents2 ;
975 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
976 tmpConstituentsType1[0] = MED_TRIA3 ;
977 tmpConstituentsType1[1] = MED_TRIA3 ;
978 tmpConstituentsType1[2] = MED_QUAD4 ;
979 tmpConstituentsType1[3] = MED_QUAD4 ;
980 tmpConstituentsType1[4] = MED_QUAD4 ;
981 medGeometryElement * tmpConstituentsType2 = new medGeometryElement[9] ;
982 tmpConstituentsType2[0] = MED_SEG2 ;
983 tmpConstituentsType2[1] = MED_SEG2 ;
984 tmpConstituentsType2[2] = MED_SEG2 ;
985 tmpConstituentsType2[3] = MED_SEG2 ;
986 tmpConstituentsType2[4] = MED_SEG2 ;
987 tmpConstituentsType2[5] = MED_SEG2 ;
988 tmpConstituentsType2[6] = MED_SEG2 ;
989 tmpConstituentsType2[7] = MED_SEG2 ;
990 tmpConstituentsType2[8] = MED_SEG2 ;
991 _constituentsType = new medGeometryElement*[2] ;
992 _constituentsType[0]=tmpConstituentsType1 ;
993 _constituentsType[1]=tmpConstituentsType2 ;
997 _name="MED_PENTA15" ;
1000 _numberOfVertexes=6;
1002 _numberOfConstituentsDimension=2 ;
1003 _numberOfConstituents=new int[2] ;
1004 _numberOfConstituents[0]=5 ;
1005 _numberOfConstituents[1]=9 ;
1006 _numberOfNodeOfEachConstituent=new int*[2] ;
1007 _numberOfNodeOfEachConstituent[0]=new int[5] ;
1008 _numberOfNodeOfEachConstituent[0][0]=6 ;
1009 _numberOfNodeOfEachConstituent[0][1]=6 ;
1010 _numberOfNodeOfEachConstituent[0][2]=8 ;
1011 _numberOfNodeOfEachConstituent[0][3]=8 ;
1012 _numberOfNodeOfEachConstituent[0][4]=8 ;
1013 _numberOfNodeOfEachConstituent[1]=new int[9] ;
1014 _numberOfNodeOfEachConstituent[1][0]=3 ;
1015 _numberOfNodeOfEachConstituent[1][1]=3 ;
1016 _numberOfNodeOfEachConstituent[1][2]=3 ;
1017 _numberOfNodeOfEachConstituent[1][3]=3 ;
1018 _numberOfNodeOfEachConstituent[1][4]=3 ;
1019 _numberOfNodeOfEachConstituent[1][5]=3 ;
1020 _numberOfNodeOfEachConstituent[1][6]=3 ;
1021 _numberOfNodeOfEachConstituent[1][7]=3 ;
1022 _numberOfNodeOfEachConstituent[1][8]=3 ;
1024 int* _edge1=new int[3];
1028 int* _edge2=new int[3];
1032 int* _edge3=new int[3];
1036 int* _edge4=new int[3];
1040 int* _edge5=new int[3];
1044 int* _edge6=new int[3];
1048 int* _edge7=new int[3];
1052 int* _edge8=new int[3];
1056 int* _edge9=new int[3];
1060 int* _face1=new int[6];
1067 int* _face2=new int[6];
1074 int* _face3=new int[8];
1083 int* _face4=new int[8];
1092 int* _face5=new int[8];
1101 int ** tmpConstituents1 = new int*[5];
1102 tmpConstituents1[0]=_face1 ;
1103 tmpConstituents1[1]=_face2 ;
1104 tmpConstituents1[2]=_face3 ;
1105 tmpConstituents1[3]=_face4 ;
1106 tmpConstituents1[4]=_face5 ;
1107 int ** tmpConstituents2 = new int*[9];
1108 tmpConstituents2[0]=_edge1 ;
1109 tmpConstituents2[1]=_edge2 ;
1110 tmpConstituents2[2]=_edge3 ;
1111 tmpConstituents2[3]=_edge4 ;
1112 tmpConstituents2[4]=_edge5 ;
1113 tmpConstituents2[5]=_edge6 ;
1114 tmpConstituents2[6]=_edge7 ;
1115 tmpConstituents2[7]=_edge8 ;
1116 tmpConstituents2[8]=_edge9 ;
1117 _constituents = new int**[2] ;
1118 _constituents[0]=tmpConstituents1 ;
1119 _constituents[1]=tmpConstituents2 ;
1120 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
1121 tmpConstituentsType1[0] = MED_TRIA6 ;
1122 tmpConstituentsType1[1] = MED_TRIA6 ;
1123 tmpConstituentsType1[2] = MED_QUAD8 ;
1124 tmpConstituentsType1[3] = MED_QUAD8 ;
1125 tmpConstituentsType1[4] = MED_QUAD8 ;
1126 medGeometryElement * tmpConstituentsType2 = new medGeometryElement[9] ;
1127 tmpConstituentsType2[0] = MED_SEG3 ;
1128 tmpConstituentsType2[1] = MED_SEG3 ;
1129 tmpConstituentsType2[2] = MED_SEG3 ;
1130 tmpConstituentsType2[3] = MED_SEG3 ;
1131 tmpConstituentsType2[4] = MED_SEG3 ;
1132 tmpConstituentsType2[5] = MED_SEG3 ;
1133 tmpConstituentsType2[6] = MED_SEG3 ;
1134 tmpConstituentsType2[7] = MED_SEG3 ;
1135 tmpConstituentsType2[8] = MED_SEG3 ;
1136 _constituentsType = new medGeometryElement*[2] ;
1137 _constituentsType[0]=tmpConstituentsType1 ;
1138 _constituentsType[1]=tmpConstituentsType2 ;
1145 _numberOfVertexes=5;
1147 _numberOfConstituentsDimension=2 ;
1148 _numberOfConstituents=new int[2] ;
1149 _numberOfConstituents[0]=5 ;
1150 _numberOfConstituents[1]=8 ;
1151 _numberOfNodeOfEachConstituent=new int*[2] ;
1152 _numberOfNodeOfEachConstituent[0]=new int[5] ;
1153 _numberOfNodeOfEachConstituent[0][0]=4 ;
1154 _numberOfNodeOfEachConstituent[0][1]=3 ;
1155 _numberOfNodeOfEachConstituent[0][2]=3 ;
1156 _numberOfNodeOfEachConstituent[0][3]=3 ;
1157 _numberOfNodeOfEachConstituent[0][4]=3 ;
1158 _numberOfNodeOfEachConstituent[1]=new int[8] ;
1159 _numberOfNodeOfEachConstituent[1][0]=2 ;
1160 _numberOfNodeOfEachConstituent[1][1]=2 ;
1161 _numberOfNodeOfEachConstituent[1][2]=2 ;
1162 _numberOfNodeOfEachConstituent[1][3]=2 ;
1163 _numberOfNodeOfEachConstituent[1][4]=2 ;
1164 _numberOfNodeOfEachConstituent[1][5]=2 ;
1165 _numberOfNodeOfEachConstituent[1][6]=2 ;
1166 _numberOfNodeOfEachConstituent[1][7]=2 ;
1168 int* _edge1=new int[2];
1171 int* _edge2=new int[2];
1174 int* _edge3=new int[2];
1177 int* _edge4=new int[2];
1180 int* _edge5=new int[2];
1183 int* _edge6=new int[2];
1186 int* _edge7=new int[2];
1189 int* _edge8=new int[2];
1192 int* _face1=new int[4];
1197 int* _face2=new int[3];
1201 int* _face3=new int[3];
1205 int* _face4=new int[3];
1209 int* _face5=new int[3];
1213 int ** tmpConstituents1 = new int*[5];
1214 tmpConstituents1[0]=_face1 ;
1215 tmpConstituents1[1]=_face2 ;
1216 tmpConstituents1[2]=_face3 ;
1217 tmpConstituents1[3]=_face4 ;
1218 tmpConstituents1[4]=_face5 ;
1219 int ** tmpConstituents2 = new int*[8];
1220 tmpConstituents2[0]=_edge1 ;
1221 tmpConstituents2[1]=_edge2 ;
1222 tmpConstituents2[2]=_edge3 ;
1223 tmpConstituents2[3]=_edge4 ;
1224 tmpConstituents2[4]=_edge5 ;
1225 tmpConstituents2[5]=_edge6 ;
1226 tmpConstituents2[6]=_edge7 ;
1227 tmpConstituents2[7]=_edge8 ;
1228 _constituents = new int**[2] ;
1229 _constituents[0]=tmpConstituents1 ;
1230 _constituents[1]=tmpConstituents2 ;
1231 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
1232 tmpConstituentsType1[0] = MED_QUAD4 ;
1233 tmpConstituentsType1[1] = MED_TRIA3 ;
1234 tmpConstituentsType1[2] = MED_TRIA3 ;
1235 tmpConstituentsType1[3] = MED_TRIA3 ;
1236 tmpConstituentsType1[4] = MED_TRIA3 ;
1237 medGeometryElement * tmpConstituentsType2 = new medGeometryElement[8] ;
1238 tmpConstituentsType2[0] = MED_SEG2 ;
1239 tmpConstituentsType2[1] = MED_SEG2 ;
1240 tmpConstituentsType2[2] = MED_SEG2 ;
1241 tmpConstituentsType2[3] = MED_SEG2 ;
1242 tmpConstituentsType2[4] = MED_SEG2 ;
1243 tmpConstituentsType2[5] = MED_SEG2 ;
1244 tmpConstituentsType2[6] = MED_SEG2 ;
1245 tmpConstituentsType2[7] = MED_SEG2 ;
1246 _constituentsType = new medGeometryElement*[2] ;
1247 _constituentsType[0]=tmpConstituentsType1 ;
1248 _constituentsType[1]=tmpConstituentsType2 ;
1252 _name="MED_PYRA13" ;
1255 _numberOfVertexes=5;
1257 _numberOfConstituentsDimension=2 ;
1258 _numberOfConstituents=new int[2] ;
1259 _numberOfConstituents[0]=5 ;
1260 _numberOfConstituents[1]=8 ;
1261 _numberOfNodeOfEachConstituent=new int*[2] ;
1262 _numberOfNodeOfEachConstituent[0]=new int[5] ;
1263 _numberOfNodeOfEachConstituent[0][0]=8 ;
1264 _numberOfNodeOfEachConstituent[0][1]=6 ;
1265 _numberOfNodeOfEachConstituent[0][2]=6 ;
1266 _numberOfNodeOfEachConstituent[0][3]=6 ;
1267 _numberOfNodeOfEachConstituent[0][4]=6 ;
1268 _numberOfNodeOfEachConstituent[1]=new int[8] ;
1269 _numberOfNodeOfEachConstituent[1][0]=3 ;
1270 _numberOfNodeOfEachConstituent[1][1]=3 ;
1271 _numberOfNodeOfEachConstituent[1][2]=3 ;
1272 _numberOfNodeOfEachConstituent[1][3]=3 ;
1273 _numberOfNodeOfEachConstituent[1][4]=3 ;
1274 _numberOfNodeOfEachConstituent[1][5]=3 ;
1275 _numberOfNodeOfEachConstituent[1][6]=3 ;
1276 _numberOfNodeOfEachConstituent[1][7]=3 ;
1278 int* _edge1=new int[3];
1282 int* _edge2=new int[3];
1286 int* _edge3=new int[3];
1290 int* _edge4=new int[3];
1294 int* _edge5=new int[3];
1298 int* _edge6=new int[3];
1302 int* _edge7=new int[3];
1306 int* _edge8=new int[3];
1310 int* _face1=new int[8];
1319 int* _face2=new int[6];
1326 int* _face3=new int[6];
1333 int* _face4=new int[6];
1340 int* _face5=new int[6];
1347 int ** tmpConstituents1 = new int*[5];
1348 tmpConstituents1[0]=_face1 ;
1349 tmpConstituents1[1]=_face2 ;
1350 tmpConstituents1[2]=_face3 ;
1351 tmpConstituents1[3]=_face4 ;
1352 tmpConstituents1[4]=_face5 ;
1353 int ** tmpConstituents2 = new int*[8];
1354 tmpConstituents2[0]=_edge1 ;
1355 tmpConstituents2[1]=_edge2 ;
1356 tmpConstituents2[2]=_edge3 ;
1357 tmpConstituents2[3]=_edge4 ;
1358 tmpConstituents2[4]=_edge5 ;
1359 tmpConstituents2[5]=_edge6 ;
1360 tmpConstituents2[6]=_edge7 ;
1361 tmpConstituents2[7]=_edge8 ;
1362 _constituents = new int**[2] ;
1363 _constituents[0]=tmpConstituents1 ;
1364 _constituents[1]=tmpConstituents2 ;
1365 medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
1366 tmpConstituentsType1[0] = MED_QUAD8 ;
1367 tmpConstituentsType1[1] = MED_TRIA6 ;
1368 tmpConstituentsType1[2] = MED_TRIA6 ;
1369 tmpConstituentsType1[3] = MED_TRIA6 ;
1370 tmpConstituentsType1[4] = MED_TRIA6 ;
1371 medGeometryElement * tmpConstituentsType2 = new medGeometryElement[8] ;
1372 tmpConstituentsType2[0] = MED_SEG3 ;
1373 tmpConstituentsType2[1] = MED_SEG3 ;
1374 tmpConstituentsType2[2] = MED_SEG3 ;
1375 tmpConstituentsType2[3] = MED_SEG3 ;
1376 tmpConstituentsType2[4] = MED_SEG3 ;
1377 tmpConstituentsType2[5] = MED_SEG3 ;
1378 tmpConstituentsType2[6] = MED_SEG3 ;
1379 tmpConstituentsType2[7] = MED_SEG3 ;
1380 _constituentsType = new medGeometryElement*[2] ;
1381 _constituentsType[0]=tmpConstituentsType1 ;
1382 _constituentsType[1]=tmpConstituentsType2 ;
1391 ostream & MEDMEM::operator<<(ostream &os,const CELLMODEL &my)
1393 os << "Cell Model :" << endl ;
1394 os << " - name : " << my._name << endl;
1395 os << " - type : " << (int)my._type << endl;
1396 os << " - dimension : " << my._dimension << endl;
1397 os << " - number of nodes : " << my._numberOfNodes << endl ;
1398 os << " - number of vertexes : " << my._numberOfVertexes << endl ;
1400 os << " - number of Constituents Dimension : " << my._numberOfConstituentsDimension << endl ;
1402 for(int i=0;i<my._numberOfConstituentsDimension;i++)
1405 os << " - for dimension (-" << i+1 << ") : " << endl ;
1406 os << " - number of Constituents for this Dimension : " << my._numberOfConstituents[i] << endl ;
1408 for(int j=0;j<my._numberOfConstituents[i];j++)
1410 os << " - number of node for this constituent : " << my._numberOfNodeOfEachConstituent[i][j] << endl ;
1411 os << " - constituents " << j+1 << " of type "<< my._constituentsType[i][j] <<" : " ;
1412 for(int k=0;k<my._numberOfNodeOfEachConstituent[i][j];k++)
1413 os << my._constituents[i][j][k] << " " ;
1422 // Return number of constituents type (which dimension is _dimension-1).
1423 int CELLMODEL::getNumberOfConstituentsType() const
1425 set<medGeometryElement> constituentsTypes ;
1426 // if (_constituentsType.size() > 0 ) {
1427 // vector<medGeometryElement> constituentsType = _constituentsType[0] ;
1428 // vector<medGeometryElement>::iterator itvec ;
1429 // for(itvec=constituentsType.begin();itvec!=constituentsType.end();itvec++)
1430 // constituentsTypes.insert(*itvec);
1432 return constituentsTypes.size() ;
1435 // Return all types of constituents which dimension is (_dimension-1).
1436 set<medGeometryElement> CELLMODEL::getAllConstituentsType() const
1438 set<medGeometryElement> constituentsTypes ;
1439 // if (_constituentsType.size() > 0 ) {
1440 // vector<medGeometryElement> constituentsType = _constituentsType[0] ;
1441 // vector<medGeometryElement>::iterator itvec ;
1442 // for(itvec=constituentsType.begin();itvec!=constituentsType.end();itvec++)
1443 // constituentsTypes.insert(*itvec);
1445 return constituentsTypes ;
1448 // Return number of constituents foreach type (which dimension is _dimension-1).
1449 map<medGeometryElement,int> CELLMODEL::getNumberOfConstituentsForeachType() const
1451 map<medGeometryElement,int> numberOfConstituentsForeachType ;
1452 // map<medGeometryElement,int>::iterator itmap ;
1453 // if (_constituentsType.size() > 0 ) {
1454 // vector<medGeometryElement> constituentsType = _constituentsType[0] ;
1455 // vector<medGeometryElement>::iterator itvec ;
1456 // for(itvec=constituentsType.begin();itvec!=constituentsType.end();itvec++) {
1457 // itmap = numberOfConstituentsForeachType.find(*itvec);
1458 // if (itmap==numberOfConstituentsForeachType.end()) // new element
1459 // numberOfConstituentsForeachType[*itvec]=1 ;
1461 // numberOfConstituentsForeachType[*itvec]++ ;
1464 return numberOfConstituentsForeachType ;
1467 void CELLMODEL::init(const CELLMODEL &m)
1471 _dimension = m._dimension ;
1472 _numberOfNodes = m._numberOfNodes ;
1473 _numberOfVertexes = m._numberOfVertexes ;
1475 _numberOfConstituentsDimension = m._numberOfConstituentsDimension ;
1477 _numberOfConstituents = new int[_numberOfConstituentsDimension] ;
1478 for(int i=0; i<_numberOfConstituentsDimension; i++)
1479 _numberOfConstituents[i]=m._numberOfConstituents[i] ;
1481 _numberOfNodeOfEachConstituent = new int*[_numberOfConstituentsDimension] ;
1482 for(int i=0; i<_numberOfConstituentsDimension; i++) {
1483 int numberOf = _numberOfConstituents[i] ;
1484 int * newArray = new int[numberOf] ;
1485 int * oldArray = m._numberOfNodeOfEachConstituent[i] ;
1486 for(int j=0; j<numberOf; j++)
1487 newArray[j] = oldArray[j] ;
1488 _numberOfNodeOfEachConstituent[i] = newArray ;
1490 _constituents = new int**[_numberOfConstituentsDimension] ;
1491 _constituentsType = new medGeometryElement*[_numberOfConstituentsDimension] ;
1492 for(int i=0; i<_numberOfConstituentsDimension; i++) {
1493 int numberOf = _numberOfConstituents[i] ;
1494 int ** tmpArray = new int*[numberOf] ;
1495 medGeometryElement * newArrayType = new medGeometryElement[numberOf] ;
1496 medGeometryElement * oldArrayType = m._constituentsType[i] ;
1498 for(int j=0; j<numberOf; j++) {
1499 int numberOf2 = _numberOfNodeOfEachConstituent[i][j] ;
1500 int * newArray = new int[numberOf2] ;
1501 int * oldArray = m._constituents[i][j] ;
1502 for(int k=0; k<numberOf2; k++)
1503 newArray[k] = oldArray[k] ;
1504 tmpArray[j] = newArray ;
1505 newArrayType[j] = oldArrayType[j] ;
1507 _constituents[i] = tmpArray ;
1508 _constituentsType[i] = newArrayType ;
1512 void CELLMODEL::clean()
1514 for(int i=0; i<_numberOfConstituentsDimension; i++) {
1515 int numberOf = _numberOfConstituents[i] ;
1516 for(int j=0; j<numberOf; j++) {
1517 if (NULL!=_constituents[i][j])
1518 delete[] _constituents[i][j] ;
1520 if (NULL!=_constituentsType[i])
1521 delete[] _constituentsType[i] ;
1522 if (NULL!=_constituents[i])
1523 delete[] _constituents[i] ;
1524 if (NULL!=_numberOfNodeOfEachConstituent[i])
1525 delete[] _numberOfNodeOfEachConstituent[i] ;
1527 if (NULL!=_numberOfConstituents)
1528 delete[]_numberOfConstituents ;
1529 if (NULL!=_constituentsType)
1530 delete[] _constituentsType ;
1531 if (NULL!=_constituents)
1532 delete[] _constituents ;
1533 if (NULL!=_numberOfNodeOfEachConstituent)
1534 delete[] _numberOfNodeOfEachConstituent ;