Back to index

salome-med  6.5.0
MEDMEM_CellModel.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 /*
00024  File MEDMEM_CellModel.cxx
00025 */
00026 
00027 #include "MEDMEM_CellModel.hxx"
00028 
00029 using namespace std;
00030 using namespace MEDMEM;
00031 using namespace MED_EN;
00032 
00033 CELLMODEL_Map *CELLMODEL_Map::_singleton=0;
00034 
00035 const MEDMEM::CELLMODEL& CELLMODEL_Map::getCellModel(MED_EN::medGeometryElement type)
00036 {
00037   map<MED_EN::medGeometryElement,MEDMEM::CELLMODEL>::iterator type2model = _cell_models.find(type);
00038   if ( type2model == _cell_models.end() )
00039     type2model = _cell_models.insert( make_pair( type, CELLMODEL( type ))).first;
00040 
00041   return type2model->second;
00042 }
00043 
00044 const MEDMEM::CELLMODEL& CELLMODEL_Map::retrieveCellModel(MED_EN::medGeometryElement type)
00045 {
00046   return CELLMODEL_Map::getInstance()->getCellModel(type);
00047 }
00048 
00049 CELLMODEL_Map *CELLMODEL_Map::getInstance()
00050 {
00051   if(!_singleton) _singleton=new CELLMODEL_Map;
00052   return _singleton;
00053 }
00054 
00055 CELLMODEL::CELLMODEL(medGeometryElement t)
00056 {
00057   // init first all to nothing
00058   _dimension=0 ;
00059   _numberOfNodes=0 ;
00060   _numberOfVertexes=0 ;
00061   _numberOfConstituentsDimension=0 ;
00062   _numberOfConstituents=(int*)NULL ;
00063   _numberOfNodeOfEachConstituent=(int**)NULL ;
00064   _constituents=(int***)NULL ; 
00065   _constituentsType=(medGeometryElement**)NULL ;
00066   
00067   MESSAGE_MED("CELLMODEL : constructeur pour le type " << t);
00068   switch (t)
00069     {
00070     case MED_POINT1  : {
00071       _name="MED_POINT1";
00072       _type=t;
00073       _dimension=0;
00074       _numberOfVertexes=1;
00075       _numberOfNodes=1;
00076       // nothing else : POINT are none constituent
00077       break;
00078     }
00079     case MED_SEG2    : {
00080       _name="MED_SEG2" ;
00081       _type=t;
00082       _dimension=1;
00083       _numberOfVertexes=2;
00084       _numberOfNodes=2;
00085       // constituent are POINT1 and we have no need to define _constituents vector
00086       _numberOfConstituentsDimension=1 ;
00087       _numberOfConstituents=new int[1] ;
00088       _numberOfConstituents[0]=2 ;
00089       _numberOfNodeOfEachConstituent=new int*[1] ;
00090       _numberOfNodeOfEachConstituent[0]=new int[2] ;
00091       _numberOfNodeOfEachConstituent[0][0]=1 ;
00092       _numberOfNodeOfEachConstituent[0][1]=1 ;
00093 
00094       _constituents = new int**[1] ;
00095       _constituents[0] = new int*[2] ;
00096       _constituents[0][0] = new int[1] ;
00097       _constituents[0][0][0] = 1 ;
00098       _constituents[0][1] = new int[1] ;
00099       _constituents[0][1][0] = 2 ;
00100 
00101       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[2] ;
00102       tmpConstituentsType1[0] = MED_POINT1 ;
00103       tmpConstituentsType1[1] = MED_POINT1 ;
00104       _constituentsType = new medGeometryElement*[1] ;
00105       _constituentsType[0]=tmpConstituentsType1 ;
00106       break;
00107     }
00108     case MED_SEG3    : {
00109       _name="MED_SEG3" ;
00110       _type=t;
00111       _dimension=1;
00112       _numberOfVertexes=2;
00113       _numberOfNodes=3;
00114       // constituent are POINT1 and we have no need to define _constituents vector
00115       _numberOfConstituentsDimension=1 ;
00116       _numberOfConstituents=new int[1] ;
00117       _numberOfConstituents[0]=3 ;
00118       _numberOfNodeOfEachConstituent=new int*[1] ;
00119       _numberOfNodeOfEachConstituent[0]=new int[3] ;
00120       _numberOfNodeOfEachConstituent[0][0]=1 ;
00121       _numberOfNodeOfEachConstituent[0][1]=1 ;
00122       _numberOfNodeOfEachConstituent[0][2]=1 ;
00123 
00124       _constituents = new int**[1] ;
00125       _constituents[0] = new int*[3] ;
00126       _constituents[0][0] = new int[1] ;
00127       _constituents[0][0][0] = 1 ;
00128       _constituents[0][1] = new int[1] ;
00129       _constituents[0][1][0] = 2 ;
00130       _constituents[0][2] = new int[1] ;
00131       _constituents[0][2][0] = 3 ;
00132 
00133       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[3] ;
00134       tmpConstituentsType1[0] = MED_POINT1 ;
00135       tmpConstituentsType1[1] = MED_POINT1 ;
00136       tmpConstituentsType1[2] = MED_POINT1 ;
00137       _constituentsType = new medGeometryElement*[1] ;
00138       _constituentsType[0]=tmpConstituentsType1 ;
00139       break;
00140     }
00141     case MED_TRIA3   : {
00142       _name="MED_TRIA3" ;
00143       _type=t;
00144       _dimension=2;
00145       _numberOfVertexes=3;
00146       _numberOfNodes=3;
00147 
00148       _numberOfConstituentsDimension=1 ;
00149       _numberOfConstituents=new int[1] ;
00150       _numberOfConstituents[0]=3 ;
00151       _numberOfNodeOfEachConstituent=new int*[1] ;
00152       _numberOfNodeOfEachConstituent[0]=new int[3] ;
00153       _numberOfNodeOfEachConstituent[0][0]=2 ;
00154       _numberOfNodeOfEachConstituent[0][1]=2 ;
00155       _numberOfNodeOfEachConstituent[0][2]=2 ;
00156 
00157       int* _edge1=new int[2];
00158       _edge1[0]=1;
00159       _edge1[1]=2;
00160       int* _edge2=new int[2];
00161       _edge2[0]=2;
00162       _edge2[1]=3;
00163       int* _edge3=new int[2];
00164       _edge3[0]=3;
00165       _edge3[1]=1;
00166       int ** tmpConstituents1 = new int*[3];
00167       tmpConstituents1[0]=_edge1 ;
00168       tmpConstituents1[1]=_edge2 ;
00169       tmpConstituents1[2]=_edge3 ;
00170       _constituents = new int**[1] ;
00171       _constituents[0]=tmpConstituents1 ;
00172 
00173       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[3] ;
00174       tmpConstituentsType1[0] = MED_SEG2 ;
00175       tmpConstituentsType1[1] = MED_SEG2 ;
00176       tmpConstituentsType1[2] = MED_SEG2 ;
00177       _constituentsType = new medGeometryElement*[1] ;
00178       _constituentsType[0]=tmpConstituentsType1 ;
00179       // Well, point are defined, but could not be acces because we have 
00180       // only 1 numberOfConstituentsDimension !
00181 
00182       break;
00183     }
00184     case MED_TRIA6   : {
00185       _name="MED_TRIA6" ;
00186       _type=t;
00187       _dimension=2;
00188       _numberOfVertexes=3;
00189       _numberOfNodes=6;
00190       _numberOfConstituentsDimension=1 ;
00191       _numberOfConstituents=new int[1] ;
00192       _numberOfConstituents[0]=3 ;
00193       _numberOfNodeOfEachConstituent=new int*[1] ;
00194       _numberOfNodeOfEachConstituent[0]=new int[3] ;
00195       _numberOfNodeOfEachConstituent[0][0]=3 ;
00196       _numberOfNodeOfEachConstituent[0][1]=3 ;
00197       _numberOfNodeOfEachConstituent[0][2]=3 ;
00198 
00199       int* _edge1=new int[3];
00200       _edge1[0]=1;
00201       _edge1[1]=2;
00202       _edge1[2]=4;
00203       int* _edge2=new int[3];
00204       _edge2[0]=2;
00205       _edge2[1]=3;
00206       _edge2[2]=5;
00207       int* _edge3=new int[3];
00208       _edge3[0]=3;
00209       _edge3[1]=1;
00210       _edge3[2]=6;
00211       int ** tmpConstituents1 = new int*[3];
00212       tmpConstituents1[0]=_edge1 ;
00213       tmpConstituents1[1]=_edge2 ;
00214       tmpConstituents1[2]=_edge3 ;
00215       _constituents = new int**[1] ;
00216       _constituents[0]=tmpConstituents1 ;
00217       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[3] ;
00218       tmpConstituentsType1[0] = MED_SEG3 ;
00219       tmpConstituentsType1[1] = MED_SEG3 ;
00220       tmpConstituentsType1[2] = MED_SEG3 ;
00221       _constituentsType = new medGeometryElement*[1] ;
00222       _constituentsType[0]=tmpConstituentsType1 ;
00223       // Well, point are defined, but could not be acces because we have 
00224       // only 1 numberOfConstituentsDimension !
00225 
00226       break;
00227     }
00228     case MED_QUAD4   : {
00229       _name="MED_QUAD4" ;
00230       _type=t;
00231       _dimension=2;
00232       _numberOfVertexes=4;
00233       _numberOfNodes=4;
00234       _numberOfConstituentsDimension=1 ;
00235       _numberOfConstituents=new int[1] ;
00236       _numberOfConstituents[0]=4 ;
00237       _numberOfNodeOfEachConstituent=new int*[1] ;
00238       _numberOfNodeOfEachConstituent[0]=new int[4] ;
00239       _numberOfNodeOfEachConstituent[0][0]=2 ;
00240       _numberOfNodeOfEachConstituent[0][1]=2 ;
00241       _numberOfNodeOfEachConstituent[0][2]=2 ;
00242       _numberOfNodeOfEachConstituent[0][3]=2 ;
00243 
00244       int* _edge1=new int[2];
00245       _edge1[0]=1;
00246       _edge1[1]=2;
00247       int* _edge2=new int[2];
00248       _edge2[0]=2;
00249       _edge2[1]=3;
00250       int* _edge3=new int[2];
00251       _edge3[0]=3;
00252       _edge3[1]=4;
00253       int* _edge4=new int[2];
00254       _edge4[0]=4;
00255       _edge4[1]=1;
00256       int ** tmpConstituents1 = new int*[4];
00257       tmpConstituents1[0]=_edge1 ;
00258       tmpConstituents1[1]=_edge2 ;
00259       tmpConstituents1[2]=_edge3 ;
00260       tmpConstituents1[3]=_edge4 ;
00261       _constituents = new int**[1] ;
00262       _constituents[0]=tmpConstituents1 ;
00263       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
00264       tmpConstituentsType1[0] = MED_SEG2 ;
00265       tmpConstituentsType1[1] = MED_SEG2 ;
00266       tmpConstituentsType1[2] = MED_SEG2 ;
00267       tmpConstituentsType1[3] = MED_SEG2 ;
00268       _constituentsType = new medGeometryElement*[1] ;
00269       _constituentsType[0]=tmpConstituentsType1 ;
00270       // Well, point are defined, but could not be acces because we have 
00271       // only 1 numberOfConstituentsDimension !
00272 
00273       break;
00274     }
00275     case MED_QUAD8   : {
00276       _name="MED_QUAD8" ;
00277       _type=t;
00278       _dimension=2;
00279       _numberOfVertexes=4;
00280       _numberOfNodes=8;
00281       _numberOfConstituentsDimension=1 ;
00282       _numberOfConstituents=new int[1] ;
00283       _numberOfConstituents[0]=4 ;
00284       _numberOfNodeOfEachConstituent=new int*[1] ;
00285       _numberOfNodeOfEachConstituent[0]=new int[4] ;
00286       _numberOfNodeOfEachConstituent[0][0]=3 ;
00287       _numberOfNodeOfEachConstituent[0][1]=3 ;
00288       _numberOfNodeOfEachConstituent[0][2]=3 ;
00289       _numberOfNodeOfEachConstituent[0][3]=3 ;
00290 
00291       int* _edge1=new int[3];
00292       _edge1[0]=1;
00293       _edge1[1]=2;
00294       _edge1[2]=5;
00295       int* _edge2=new int[3];
00296       _edge2[0]=2;
00297       _edge2[1]=3;
00298       _edge2[2]=6;
00299       int* _edge3=new int[3];
00300       _edge3[0]=3;
00301       _edge3[1]=4;
00302       _edge3[2]=7;
00303       int* _edge4=new int[3];
00304       _edge4[0]=4;
00305       _edge4[1]=1;
00306       _edge4[2]=8;
00307       int ** tmpConstituents1 = new int*[4];
00308       tmpConstituents1[0]=_edge1 ;
00309       tmpConstituents1[1]=_edge2 ;
00310       tmpConstituents1[2]=_edge3 ;
00311       tmpConstituents1[3]=_edge4 ;
00312       _constituents = new int**[1] ;
00313       _constituents[0]=tmpConstituents1 ;
00314       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
00315       tmpConstituentsType1[0] = MED_SEG3 ;
00316       tmpConstituentsType1[1] = MED_SEG3 ;
00317       tmpConstituentsType1[2] = MED_SEG3 ;
00318       tmpConstituentsType1[3] = MED_SEG3 ;
00319       _constituentsType = new medGeometryElement*[1] ;
00320       _constituentsType[0]=tmpConstituentsType1 ;
00321       // Well, point are defined, but could not be acces because we have 
00322       // only 1 numberOfConstituentsDimension !
00323 
00324       break;
00325     }
00326     case MED_TETRA4  : {
00327       _name="MED_TETRA4" ;
00328       _type=t;
00329       _dimension=3;
00330       _numberOfVertexes=4;
00331       _numberOfNodes=4;
00332       _numberOfConstituentsDimension=2 ;
00333       _numberOfConstituents=new int[2] ;
00334       _numberOfConstituents[0]=4 ;
00335       _numberOfConstituents[1]=6 ;
00336       _numberOfNodeOfEachConstituent=new int*[2] ;
00337       _numberOfNodeOfEachConstituent[0]=new int[4] ;
00338       _numberOfNodeOfEachConstituent[0][0]=3 ;
00339       _numberOfNodeOfEachConstituent[0][1]=3 ;
00340       _numberOfNodeOfEachConstituent[0][2]=3 ;
00341       _numberOfNodeOfEachConstituent[0][3]=3 ;
00342       _numberOfNodeOfEachConstituent[1]=new int[6] ;
00343       _numberOfNodeOfEachConstituent[1][0]=2 ;
00344       _numberOfNodeOfEachConstituent[1][1]=2 ;
00345       _numberOfNodeOfEachConstituent[1][2]=2 ;
00346       _numberOfNodeOfEachConstituent[1][3]=2 ;
00347       _numberOfNodeOfEachConstituent[1][4]=2 ;
00348       _numberOfNodeOfEachConstituent[1][5]=2 ;
00349 
00350       int* _face1=new int[3];
00351       _face1[0]=1;
00352       _face1[1]=2;
00353       _face1[2]=3;
00354       int* _face2=new int[3];
00355       _face2[0]=1;
00356       _face2[1]=4;
00357       _face2[2]=2;
00358       int* _face3=new int[3];
00359       _face3[0]=2;
00360       _face3[1]=4;
00361       _face3[2]=3;
00362       int* _face4=new int[3];
00363       _face4[0]=3;
00364       _face4[1]=4;
00365       _face4[2]=1;
00366       int* _edge1=new int[2];
00367       _edge1[0]=1;
00368       _edge1[1]=2;
00369       int* _edge2=new int[2];
00370       _edge2[0]=2;
00371       _edge2[1]=3;
00372       int* _edge3=new int[2];
00373       _edge3[0]=3;
00374       _edge3[1]=1;
00375       int* _edge4=new int[2];
00376       _edge4[0]=1;
00377       _edge4[1]=4;
00378       int* _edge5=new int[2];
00379       _edge5[0]=2;
00380       _edge5[1]=4;
00381       int* _edge6=new int[2];
00382       _edge6[0]=3;
00383       _edge6[1]=4;
00384       int ** tmpConstituents1 = new int*[4];
00385       tmpConstituents1[0]=_face1 ;
00386       tmpConstituents1[1]=_face2 ;
00387       tmpConstituents1[2]=_face3 ;
00388       tmpConstituents1[3]=_face4 ;
00389       int ** tmpConstituents2 = new int*[6];
00390       tmpConstituents2[0]=_edge1 ;
00391       tmpConstituents2[1]=_edge2 ;
00392       tmpConstituents2[2]=_edge3 ;
00393       tmpConstituents2[3]=_edge4 ;
00394       tmpConstituents2[4]=_edge5 ;
00395       tmpConstituents2[5]=_edge6 ;
00396       _constituents = new int**[2] ;
00397       _constituents[0]=tmpConstituents1 ;
00398       _constituents[1]=tmpConstituents2 ;
00399       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
00400       tmpConstituentsType1[0] = MED_TRIA3 ;
00401       tmpConstituentsType1[1] = MED_TRIA3 ;
00402       tmpConstituentsType1[2] = MED_TRIA3 ;
00403       tmpConstituentsType1[3] = MED_TRIA3 ;
00404       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[6] ;
00405       tmpConstituentsType2[0] = MED_SEG2 ;
00406       tmpConstituentsType2[1] = MED_SEG2 ;
00407       tmpConstituentsType2[2] = MED_SEG2 ;
00408       tmpConstituentsType2[3] = MED_SEG2 ;
00409       tmpConstituentsType2[4] = MED_SEG2 ;
00410       tmpConstituentsType2[5] = MED_SEG2 ;
00411       _constituentsType = new medGeometryElement*[2] ;
00412       _constituentsType[0]=tmpConstituentsType1 ;
00413       _constituentsType[1]=tmpConstituentsType2 ;
00414       break;
00415     }
00416     case MED_TETRA10 : {
00417       _name="MED_TETRA10" ;
00418       _type=t;
00419       _dimension=3;
00420       _numberOfVertexes=4;
00421       _numberOfNodes=10;
00422       _numberOfConstituentsDimension=2 ;
00423       _numberOfConstituents=new int[2] ;
00424       _numberOfConstituents[0]=4 ;
00425       _numberOfConstituents[1]=6 ;
00426       _numberOfNodeOfEachConstituent=new int*[2] ;
00427       _numberOfNodeOfEachConstituent[0]=new int[4] ;
00428       _numberOfNodeOfEachConstituent[0][0]=6 ;
00429       _numberOfNodeOfEachConstituent[0][1]=6 ;
00430       _numberOfNodeOfEachConstituent[0][2]=6 ;
00431       _numberOfNodeOfEachConstituent[0][3]=6 ;
00432       _numberOfNodeOfEachConstituent[1]=new int[6] ;
00433       _numberOfNodeOfEachConstituent[1][0]=3 ;
00434       _numberOfNodeOfEachConstituent[1][1]=3 ;
00435       _numberOfNodeOfEachConstituent[1][2]=3 ;
00436       _numberOfNodeOfEachConstituent[1][3]=3 ;
00437       _numberOfNodeOfEachConstituent[1][4]=3 ;
00438       _numberOfNodeOfEachConstituent[1][5]=3 ;
00439 
00440       int* _face1=new int[6];
00441       _face1[0]=1;
00442       _face1[1]=2;
00443       _face1[2]=3;
00444       _face1[3]=5;
00445       _face1[4]=6;
00446       _face1[5]=7;
00447       int* _face2=new int[6];
00448       _face2[0]=1;
00449       _face2[1]=4;
00450       _face2[2]=2;
00451       _face2[3]=8;
00452       _face2[4]=9;
00453       _face2[5]=5;
00454       int* _face3=new int[6];
00455       _face3[0]=2;
00456       _face3[1]=4;
00457       _face3[2]=3;
00458       _face3[3]=9;
00459       _face3[4]=10;
00460       _face3[5]=6;
00461       int* _face4=new int[6];
00462       _face4[0]=3;
00463       _face4[1]=4;
00464       _face4[2]=1;
00465       _face4[3]=10;
00466       _face4[4]=8;
00467       _face4[5]=7;
00468       int* _edge1=new int[3];
00469       _edge1[0]=1;
00470       _edge1[1]=2;
00471       _edge1[2]=5;
00472       int* _edge2=new int[3];
00473       _edge2[0]=2;
00474       _edge2[1]=3;
00475       _edge2[2]=6;
00476       int* _edge3=new int[3];
00477       _edge3[0]=3;
00478       _edge3[1]=1;
00479       _edge3[2]=7;
00480       int* _edge4=new int[3];
00481       _edge4[0]=1;
00482       _edge4[1]=4;
00483       _edge4[2]=8;
00484       int* _edge5=new int[3];
00485       _edge5[0]=2;
00486       _edge5[1]=4;
00487       _edge5[2]=9;
00488       int* _edge6=new int[3];
00489       _edge6[0]=3;
00490       _edge6[1]=4;
00491       _edge6[2]=10;
00492       int ** tmpConstituents1 = new int*[4];
00493       tmpConstituents1[0]=_face1 ;
00494       tmpConstituents1[1]=_face2 ;
00495       tmpConstituents1[2]=_face3 ;
00496       tmpConstituents1[3]=_face4 ;
00497       int ** tmpConstituents2 = new int*[6];
00498       tmpConstituents2[0]=_edge1 ;
00499       tmpConstituents2[1]=_edge2 ;
00500       tmpConstituents2[2]=_edge3 ;
00501       tmpConstituents2[3]=_edge4 ;
00502       tmpConstituents2[4]=_edge5 ;
00503       tmpConstituents2[5]=_edge6 ;
00504       _constituents = new int**[2] ;
00505       _constituents[0]=tmpConstituents1 ;
00506       _constituents[1]=tmpConstituents2 ;
00507       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[4] ;
00508       tmpConstituentsType1[0] = MED_TRIA6 ;
00509       tmpConstituentsType1[1] = MED_TRIA6 ;
00510       tmpConstituentsType1[2] = MED_TRIA6 ;
00511       tmpConstituentsType1[3] = MED_TRIA6 ;
00512       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[6] ;
00513       tmpConstituentsType2[0] = MED_SEG3 ;
00514       tmpConstituentsType2[1] = MED_SEG3 ;
00515       tmpConstituentsType2[2] = MED_SEG3 ;
00516       tmpConstituentsType2[3] = MED_SEG3 ;
00517       tmpConstituentsType2[4] = MED_SEG3 ;
00518       tmpConstituentsType2[5] = MED_SEG3 ;
00519       _constituentsType = new medGeometryElement*[2] ;
00520       _constituentsType[0]=tmpConstituentsType1 ;
00521       _constituentsType[1]=tmpConstituentsType2 ;
00522     break;
00523     }
00524     case MED_HEXA8   : {
00525       _name="MED_HEXA8" ;
00526       _type=t;
00527       _dimension=3;
00528       _numberOfVertexes=8;
00529       _numberOfNodes=8;
00530       _numberOfConstituentsDimension=2 ;
00531       _numberOfConstituents=new int[2] ;
00532       _numberOfConstituents[0]=6 ;
00533       _numberOfConstituents[1]=12 ;
00534       _numberOfNodeOfEachConstituent=new int*[2] ;
00535       _numberOfNodeOfEachConstituent[0]=new int[6] ;
00536       _numberOfNodeOfEachConstituent[0][0]=4 ;
00537       _numberOfNodeOfEachConstituent[0][1]=4 ;
00538       _numberOfNodeOfEachConstituent[0][2]=4 ;
00539       _numberOfNodeOfEachConstituent[0][3]=4 ;
00540       _numberOfNodeOfEachConstituent[0][4]=4 ;
00541       _numberOfNodeOfEachConstituent[0][5]=4 ;
00542       _numberOfNodeOfEachConstituent[1]=new int[12] ;
00543       _numberOfNodeOfEachConstituent[1][0]=2 ;
00544       _numberOfNodeOfEachConstituent[1][1]=2 ;
00545       _numberOfNodeOfEachConstituent[1][2]=2 ;
00546       _numberOfNodeOfEachConstituent[1][3]=2 ;
00547       _numberOfNodeOfEachConstituent[1][4]=2 ;
00548       _numberOfNodeOfEachConstituent[1][5]=2 ;
00549       _numberOfNodeOfEachConstituent[1][6]=2 ;
00550       _numberOfNodeOfEachConstituent[1][7]=2 ;
00551       _numberOfNodeOfEachConstituent[1][8]=2 ;
00552       _numberOfNodeOfEachConstituent[1][9]=2 ;
00553       _numberOfNodeOfEachConstituent[1][10]=2 ;
00554       _numberOfNodeOfEachConstituent[1][11]=2 ;
00555 
00556       int* _edge1=new int[2];
00557       _edge1[0]=1;
00558       _edge1[1]=2;
00559       int* _edge2=new int[2];
00560       _edge2[0]=2;
00561       _edge2[1]=3;
00562       int* _edge3=new int[2];
00563       _edge3[0]=3;
00564       _edge3[1]=4;
00565       int* _edge4=new int[2];
00566       _edge4[0]=4;
00567       _edge4[1]=1;
00568       int* _edge5=new int[2];
00569       _edge5[0]=5;
00570       _edge5[1]=6;
00571       int* _edge6=new int[2];
00572       _edge6[0]=6;
00573       _edge6[1]=7;
00574       int* _edge7=new int[2];
00575       _edge7[0]=7;
00576       _edge7[1]=8;
00577       int* _edge8=new int[2];
00578       _edge8[0]=8;
00579       _edge8[1]=5;
00580       int* _edge9=new int[2];
00581       _edge9[0]=1;
00582       _edge9[1]=5;
00583       int* _edge10=new int[2];
00584       _edge10[0]=2;
00585       _edge10[1]=6;
00586       int* _edge11=new int[2];
00587       _edge11[0]=3;
00588       _edge11[1]=7;
00589       int* _edge12=new int[2];
00590       _edge12[0]=4;
00591       _edge12[1]=8;
00592       int* _face1=new int[4];
00593       _face1[0]=1;
00594       _face1[1]=2;
00595       _face1[2]=3;
00596       _face1[3]=4;
00597       int* _face2=new int[4];
00598       _face2[0]=5;
00599       _face2[1]=8;
00600       _face2[2]=7;
00601       _face2[3]=6;
00602       int* _face3=new int[4];
00603       _face3[0]=1;
00604       _face3[1]=5;
00605       _face3[2]=6;
00606       _face3[3]=2;
00607       int* _face4=new int[4];
00608       _face4[0]=2;
00609       _face4[1]=6;
00610       _face4[2]=7;
00611       _face4[3]=3;
00612       int* _face5=new int[4];
00613       _face5[0]=3;
00614       _face5[1]=7;
00615       _face5[2]=8;
00616       _face5[3]=4;
00617      int* _face6=new int[4];
00618       _face6[0]=4;
00619       _face6[1]=8;
00620       _face6[2]=5;
00621       _face6[3]=1;
00622       int ** tmpConstituents1 = new int*[6];
00623       tmpConstituents1[0]=_face1 ;
00624       tmpConstituents1[1]=_face2 ;
00625       tmpConstituents1[2]=_face3 ;
00626       tmpConstituents1[3]=_face4 ;
00627       tmpConstituents1[4]=_face5 ;
00628       tmpConstituents1[5]=_face6 ;
00629       int ** tmpConstituents2 = new int*[12];
00630       tmpConstituents2[0]=_edge1 ;
00631       tmpConstituents2[1]=_edge2 ;
00632       tmpConstituents2[2]=_edge3 ;
00633       tmpConstituents2[3]=_edge4 ;
00634       tmpConstituents2[4]=_edge5 ;
00635       tmpConstituents2[5]=_edge6 ;
00636       tmpConstituents2[6]=_edge7 ;
00637       tmpConstituents2[7]=_edge8 ;
00638       tmpConstituents2[8]=_edge9 ;
00639       tmpConstituents2[9]=_edge10;
00640       tmpConstituents2[10]=_edge11;
00641       tmpConstituents2[11]=_edge12;
00642       _constituents = new int**[2] ;
00643       _constituents[0]=tmpConstituents1 ;
00644       _constituents[1]=tmpConstituents2 ;
00645       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[6] ;
00646       tmpConstituentsType1[0] = MED_QUAD4 ;
00647       tmpConstituentsType1[1] = MED_QUAD4 ;
00648       tmpConstituentsType1[2] = MED_QUAD4 ;
00649       tmpConstituentsType1[3] = MED_QUAD4 ;
00650       tmpConstituentsType1[4] = MED_QUAD4 ;
00651       tmpConstituentsType1[5] = MED_QUAD4 ;
00652       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[12] ;
00653       tmpConstituentsType2[0] = MED_SEG2 ;
00654       tmpConstituentsType2[1] = MED_SEG2 ;
00655       tmpConstituentsType2[2] = MED_SEG2 ;
00656       tmpConstituentsType2[3] = MED_SEG2 ;
00657       tmpConstituentsType2[4] = MED_SEG2 ;
00658       tmpConstituentsType2[5] = MED_SEG2 ;
00659       tmpConstituentsType2[6] = MED_SEG2 ;
00660       tmpConstituentsType2[7] = MED_SEG2 ;
00661       tmpConstituentsType2[8] = MED_SEG2 ;
00662       tmpConstituentsType2[9] = MED_SEG2 ;
00663       tmpConstituentsType2[10] = MED_SEG2 ;
00664       tmpConstituentsType2[11] = MED_SEG2 ;
00665       _constituentsType = new medGeometryElement*[2] ;
00666       _constituentsType[0]=tmpConstituentsType1 ;
00667       _constituentsType[1]=tmpConstituentsType2 ;
00668       break;
00669     }
00670     case MED_HEXA20  : {
00671       _name="MED_HEXA20" ;
00672       _type=t;
00673       _dimension=3;
00674       _numberOfVertexes=8;
00675       _numberOfNodes=20;
00676       _numberOfConstituentsDimension=2 ;
00677       _numberOfConstituents=new int[2] ;
00678       _numberOfConstituents[0]=6 ;
00679       _numberOfConstituents[1]=12 ;
00680       _numberOfNodeOfEachConstituent=new int*[2] ;
00681       _numberOfNodeOfEachConstituent[0]=new int[6] ;
00682       _numberOfNodeOfEachConstituent[0][0]=8 ;
00683       _numberOfNodeOfEachConstituent[0][1]=8 ;
00684       _numberOfNodeOfEachConstituent[0][2]=8 ;
00685       _numberOfNodeOfEachConstituent[0][3]=8 ;
00686       _numberOfNodeOfEachConstituent[0][4]=8 ;
00687       _numberOfNodeOfEachConstituent[0][5]=8 ;
00688       _numberOfNodeOfEachConstituent[1]=new int[12] ;
00689       _numberOfNodeOfEachConstituent[1][0]=3 ;
00690       _numberOfNodeOfEachConstituent[1][1]=3 ;
00691       _numberOfNodeOfEachConstituent[1][2]=3 ;
00692       _numberOfNodeOfEachConstituent[1][3]=3 ;
00693       _numberOfNodeOfEachConstituent[1][4]=3 ;
00694       _numberOfNodeOfEachConstituent[1][5]=3 ;
00695       _numberOfNodeOfEachConstituent[1][6]=3 ;
00696       _numberOfNodeOfEachConstituent[1][7]=3 ;
00697       _numberOfNodeOfEachConstituent[1][8]=3 ;
00698       _numberOfNodeOfEachConstituent[1][9]=3 ;
00699       _numberOfNodeOfEachConstituent[1][10]=3 ;
00700       _numberOfNodeOfEachConstituent[1][11]=3 ;
00701 
00702       int* _edge1=new int[3];
00703       _edge1[0]=1;
00704       _edge1[1]=2;
00705       _edge1[2]=9;
00706       int* _edge2=new int[3];
00707       _edge2[0]=2;
00708       _edge2[1]=3;
00709       _edge2[2]=10;
00710       int* _edge3=new int[3];
00711       _edge3[0]=3;
00712       _edge3[1]=4;
00713       _edge3[2]=11;
00714       int* _edge4=new int[3];
00715       _edge4[0]=4;
00716       _edge4[1]=1;
00717       _edge4[2]=12;
00718       int* _edge5=new int[3];
00719       _edge5[0]=5;
00720       _edge5[1]=6;
00721       _edge5[2]=13;
00722       int* _edge6=new int[3];
00723       _edge6[0]=6;
00724       _edge6[1]=7;
00725       _edge6[2]=14;
00726       int* _edge7=new int[3];
00727       _edge7[0]=7;
00728       _edge7[1]=8;
00729       _edge7[2]=15;
00730       int* _edge8=new int[3];
00731       _edge8[0]=8;
00732       _edge8[1]=5;
00733       _edge8[2]=16;
00734       int* _edge9=new int[3];
00735       _edge9[0]=1;
00736       _edge9[1]=5;
00737       _edge9[2]=17;
00738       int* _edge10=new int[3];
00739       _edge10[0]=2;
00740       _edge10[1]=6;
00741       _edge10[2]=18;
00742       int* _edge11=new int[3];
00743       _edge11[0]=3;
00744       _edge11[1]=7;
00745       _edge11[2]=19;
00746       int* _edge12=new int[3];
00747       _edge12[0]=4;
00748       _edge12[1]=8;
00749       _edge12[2]=20;
00750       int* _face1=new int[8];
00751       _face1[0]=1;
00752       _face1[1]=2;
00753       _face1[2]=3;
00754       _face1[3]=4;
00755       _face1[4]=9;
00756       _face1[5]=10;
00757       _face1[6]=11;
00758       _face1[7]=12;
00759       int* _face2=new int[8];
00760       _face2[0]=5;
00761       _face2[1]=8;
00762       _face2[2]=7;
00763       _face2[3]=6;
00764       _face2[4]=16;
00765       _face2[5]=15;
00766       _face2[6]=14;
00767       _face2[7]=13;
00768       int* _face3=new int[8];
00769       _face3[0]=1;
00770       _face3[1]=5;
00771       _face3[2]=6;
00772       _face3[3]=2;
00773       _face3[4]=17;
00774       _face3[5]=13;
00775       _face3[6]=18;
00776       _face3[7]=9;
00777       int* _face4=new int[8];
00778       _face4[0]=2;
00779       _face4[1]=6;
00780       _face4[2]=7;
00781       _face4[3]=3;
00782       _face4[4]=18;
00783       _face4[5]=14;
00784       _face4[6]=19;
00785       _face4[7]=10;
00786       int* _face5=new int[8];
00787       _face5[0]=3;
00788       _face5[1]=7;
00789       _face5[2]=8;
00790       _face5[3]=4;
00791       _face5[4]=19;
00792       _face5[5]=15;
00793       _face5[6]=20;
00794       _face5[7]=11;
00795      int* _face6=new int[8];
00796       _face6[0]=4;
00797       _face6[1]=8;
00798       _face6[2]=5;
00799       _face6[3]=1;
00800       _face6[4]=20;
00801       _face6[5]=16;
00802       _face6[6]=17;
00803       _face6[7]=12;
00804       int ** tmpConstituents1 = new int*[6];
00805       tmpConstituents1[0]=_face1 ;
00806       tmpConstituents1[1]=_face2 ;
00807       tmpConstituents1[2]=_face3 ;
00808       tmpConstituents1[3]=_face4 ;
00809       tmpConstituents1[4]=_face5 ;
00810       tmpConstituents1[5]=_face6 ;
00811       int ** tmpConstituents2 = new int*[12];
00812       tmpConstituents2[0]=_edge1 ;
00813       tmpConstituents2[1]=_edge2 ;
00814       tmpConstituents2[2]=_edge3 ;
00815       tmpConstituents2[3]=_edge4 ;
00816       tmpConstituents2[4]=_edge5 ;
00817       tmpConstituents2[5]=_edge6 ;
00818       tmpConstituents2[6]=_edge7 ;
00819       tmpConstituents2[7]=_edge8 ;
00820       tmpConstituents2[8]=_edge9 ;
00821       tmpConstituents2[9]=_edge10;
00822       tmpConstituents2[10]=_edge11;
00823       tmpConstituents2[11]=_edge12;
00824       _constituents = new int**[2] ;
00825       _constituents[0]=tmpConstituents1 ;
00826       _constituents[1]=tmpConstituents2 ;
00827       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[6] ;
00828       tmpConstituentsType1[0] = MED_QUAD8 ;
00829       tmpConstituentsType1[1] = MED_QUAD8 ;
00830       tmpConstituentsType1[2] = MED_QUAD8 ;
00831       tmpConstituentsType1[3] = MED_QUAD8 ;
00832       tmpConstituentsType1[4] = MED_QUAD8 ;
00833       tmpConstituentsType1[5] = MED_QUAD8 ;
00834       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[12] ;
00835       tmpConstituentsType2[0] = MED_SEG3 ;
00836       tmpConstituentsType2[1] = MED_SEG3 ;
00837       tmpConstituentsType2[2] = MED_SEG3 ;
00838       tmpConstituentsType2[3] = MED_SEG3 ;
00839       tmpConstituentsType2[4] = MED_SEG3 ;
00840       tmpConstituentsType2[5] = MED_SEG3 ;
00841       tmpConstituentsType2[6] = MED_SEG3 ;
00842       tmpConstituentsType2[7] = MED_SEG3 ;
00843       tmpConstituentsType2[8] = MED_SEG3 ;
00844       tmpConstituentsType2[9] = MED_SEG3 ;
00845       tmpConstituentsType2[10] = MED_SEG3 ;
00846       tmpConstituentsType2[11] = MED_SEG3 ;
00847       _constituentsType = new medGeometryElement*[2] ;
00848       _constituentsType[0]=tmpConstituentsType1 ;
00849       _constituentsType[1]=tmpConstituentsType2 ;
00850       break;
00851     }
00852     case MED_PENTA6  : {
00853       _name="MED_PENTA6" ;
00854       _type=t;
00855       _dimension=3;
00856       _numberOfVertexes=6;
00857       _numberOfNodes=6;
00858 
00859       _numberOfConstituentsDimension=2 ;
00860       _numberOfConstituents=new int[2] ;
00861       _numberOfConstituents[0]=5 ;
00862       _numberOfConstituents[1]=9 ;
00863       _numberOfNodeOfEachConstituent=new int*[2] ;
00864       _numberOfNodeOfEachConstituent[0]=new int[5] ;
00865       _numberOfNodeOfEachConstituent[0][0]=3 ;
00866       _numberOfNodeOfEachConstituent[0][1]=3 ;
00867       _numberOfNodeOfEachConstituent[0][2]=4 ;
00868       _numberOfNodeOfEachConstituent[0][3]=4 ;
00869       _numberOfNodeOfEachConstituent[0][4]=4 ;
00870       _numberOfNodeOfEachConstituent[1]=new int[9] ;
00871       _numberOfNodeOfEachConstituent[1][0]=2 ;
00872       _numberOfNodeOfEachConstituent[1][1]=2 ;
00873       _numberOfNodeOfEachConstituent[1][2]=2 ;
00874       _numberOfNodeOfEachConstituent[1][3]=2 ;
00875       _numberOfNodeOfEachConstituent[1][4]=2 ;
00876       _numberOfNodeOfEachConstituent[1][5]=2 ;
00877       _numberOfNodeOfEachConstituent[1][6]=2 ;
00878       _numberOfNodeOfEachConstituent[1][7]=2 ;
00879       _numberOfNodeOfEachConstituent[1][8]=2 ;
00880 
00881       int* _edge1=new int[2];
00882       _edge1[0]=1;
00883       _edge1[1]=2;
00884       int* _edge2=new int[2];
00885       _edge2[0]=2;
00886       _edge2[1]=3;
00887       int* _edge3=new int[2];
00888       _edge3[0]=3;
00889       _edge3[1]=1;
00890       int* _edge4=new int[2];
00891       _edge4[0]=4;
00892       _edge4[1]=5;
00893       int* _edge5=new int[2];
00894       _edge5[0]=5;
00895       _edge5[1]=6;
00896       int* _edge6=new int[2];
00897       _edge6[0]=6;
00898       _edge6[1]=4;
00899       int* _edge7=new int[2];
00900       _edge7[0]=1;
00901       _edge7[1]=4;
00902       int* _edge8=new int[2];
00903       _edge8[0]=2;
00904       _edge8[1]=5;
00905       int* _edge9=new int[2];
00906       _edge9[0]=3;
00907       _edge9[1]=6;
00908       int* _face1=new int[3];
00909       _face1[0]=1;
00910       _face1[1]=2;
00911       _face1[2]=3;
00912       int* _face2=new int[3];
00913       _face2[0]=4;
00914       _face2[1]=6;
00915       _face2[2]=5;
00916       int* _face3=new int[4];
00917       _face3[0]=1;
00918       _face3[1]=4;
00919       _face3[2]=5;
00920       _face3[3]=2;
00921       int* _face4=new int[4];
00922       _face4[0]=2;
00923       _face4[1]=5;
00924       _face4[2]=6;
00925       _face4[3]=3;
00926       int* _face5=new int[4];
00927       _face5[0]=3;
00928       _face5[1]=6;
00929       _face5[2]=4;
00930       _face5[3]=1;
00931       int ** tmpConstituents1 = new int*[5];
00932       tmpConstituents1[0]=_face1 ;
00933       tmpConstituents1[1]=_face2 ;
00934       tmpConstituents1[2]=_face3 ;
00935       tmpConstituents1[3]=_face4 ;
00936       tmpConstituents1[4]=_face5 ;
00937       int ** tmpConstituents2 = new int*[9];
00938       tmpConstituents2[0]=_edge1 ;
00939       tmpConstituents2[1]=_edge2 ;
00940       tmpConstituents2[2]=_edge3 ;
00941       tmpConstituents2[3]=_edge4 ;
00942       tmpConstituents2[4]=_edge5 ;
00943       tmpConstituents2[5]=_edge6 ;
00944       tmpConstituents2[6]=_edge7 ;
00945       tmpConstituents2[7]=_edge8 ;
00946       tmpConstituents2[8]=_edge9 ;
00947       _constituents = new int**[2] ;
00948       _constituents[0]=tmpConstituents1 ;
00949       _constituents[1]=tmpConstituents2 ;
00950       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
00951       tmpConstituentsType1[0] = MED_TRIA3 ;
00952       tmpConstituentsType1[1] = MED_TRIA3 ;
00953       tmpConstituentsType1[2] = MED_QUAD4 ;
00954       tmpConstituentsType1[3] = MED_QUAD4 ;
00955       tmpConstituentsType1[4] = MED_QUAD4 ;
00956       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[9] ;
00957       tmpConstituentsType2[0] = MED_SEG2 ;
00958       tmpConstituentsType2[1] = MED_SEG2 ;
00959       tmpConstituentsType2[2] = MED_SEG2 ;
00960       tmpConstituentsType2[3] = MED_SEG2 ;
00961       tmpConstituentsType2[4] = MED_SEG2 ;
00962       tmpConstituentsType2[5] = MED_SEG2 ;
00963       tmpConstituentsType2[6] = MED_SEG2 ;
00964       tmpConstituentsType2[7] = MED_SEG2 ;
00965       tmpConstituentsType2[8] = MED_SEG2 ;
00966       _constituentsType = new medGeometryElement*[2] ;
00967       _constituentsType[0]=tmpConstituentsType1 ;
00968       _constituentsType[1]=tmpConstituentsType2 ;
00969       break;
00970     }
00971     case MED_PENTA15 : {
00972       _name="MED_PENTA15" ;
00973       _type=t;
00974       _dimension=3;
00975       _numberOfVertexes=6;
00976       _numberOfNodes=15;
00977       _numberOfConstituentsDimension=2 ;
00978       _numberOfConstituents=new int[2] ;
00979       _numberOfConstituents[0]=5 ;
00980       _numberOfConstituents[1]=9 ;
00981       _numberOfNodeOfEachConstituent=new int*[2] ;
00982       _numberOfNodeOfEachConstituent[0]=new int[5] ;
00983       _numberOfNodeOfEachConstituent[0][0]=6 ;
00984       _numberOfNodeOfEachConstituent[0][1]=6 ;
00985       _numberOfNodeOfEachConstituent[0][2]=8 ;
00986       _numberOfNodeOfEachConstituent[0][3]=8 ;
00987       _numberOfNodeOfEachConstituent[0][4]=8 ;
00988       _numberOfNodeOfEachConstituent[1]=new int[9] ;
00989       _numberOfNodeOfEachConstituent[1][0]=3 ;
00990       _numberOfNodeOfEachConstituent[1][1]=3 ;
00991       _numberOfNodeOfEachConstituent[1][2]=3 ;
00992       _numberOfNodeOfEachConstituent[1][3]=3 ;
00993       _numberOfNodeOfEachConstituent[1][4]=3 ;
00994       _numberOfNodeOfEachConstituent[1][5]=3 ;
00995       _numberOfNodeOfEachConstituent[1][6]=3 ;
00996       _numberOfNodeOfEachConstituent[1][7]=3 ;
00997       _numberOfNodeOfEachConstituent[1][8]=3 ;
00998 
00999       int* _edge1=new int[3];
01000       _edge1[0]=1;
01001       _edge1[1]=2;
01002       _edge1[2]=7;
01003       int* _edge2=new int[3];
01004       _edge2[0]=2;
01005       _edge2[1]=3;
01006       _edge2[2]=8;
01007       int* _edge3=new int[3];
01008       _edge3[0]=3;
01009       _edge3[1]=1;
01010       _edge3[2]=9;
01011       int* _edge4=new int[3];
01012       _edge4[0]=4;
01013       _edge4[1]=5;
01014       _edge4[2]=10;
01015       int* _edge5=new int[3];
01016       _edge5[0]=5;
01017       _edge5[1]=6;
01018       _edge5[2]=11;
01019       int* _edge6=new int[3];
01020       _edge6[0]=6;
01021       _edge6[1]=4;
01022       _edge6[2]=12;
01023       int* _edge7=new int[3];
01024       _edge7[0]=1;
01025       _edge7[1]=4;
01026       _edge7[2]=13;
01027       int* _edge8=new int[3];
01028       _edge8[0]=2;
01029       _edge8[1]=5;
01030       _edge8[2]=14;
01031       int* _edge9=new int[3];
01032       _edge9[0]=3;
01033       _edge9[1]=6;
01034       _edge9[2]=15;
01035       int* _face1=new int[6];
01036       _face1[0]=1;
01037       _face1[1]=2;
01038       _face1[2]=3;
01039       _face1[3]=7;
01040       _face1[4]=8;
01041       _face1[5]=9;
01042       int* _face2=new int[6];
01043       _face2[0]=4;
01044       _face2[1]=5;
01045       _face2[2]=6;
01046       _face2[3]=12;
01047       _face2[4]=11;
01048       _face2[5]=10;
01049       int* _face3=new int[8];
01050       _face3[0]=1;
01051       _face3[1]=4;
01052       _face3[2]=5;
01053       _face3[3]=2;
01054       _face3[4]=13;
01055       _face3[5]=10;
01056       _face3[6]=14;
01057       _face3[7]=7;
01058       int* _face4=new int[8];
01059       _face4[0]=2;
01060       _face4[1]=5;
01061       _face4[2]=6;
01062       _face4[3]=3;
01063       _face4[4]=14;
01064       _face4[5]=11;
01065       _face4[6]=15;
01066       _face4[7]=8;
01067       int* _face5=new int[8];
01068       _face5[0]=3;
01069       _face5[1]=6;
01070       _face5[2]=4;
01071       _face5[3]=1;
01072       _face5[4]=15;
01073       _face5[5]=12;
01074       _face5[6]=13;
01075       _face5[7]=9;
01076       int ** tmpConstituents1 = new int*[5];
01077       tmpConstituents1[0]=_face1 ;
01078       tmpConstituents1[1]=_face2 ;
01079       tmpConstituents1[2]=_face3 ;
01080       tmpConstituents1[3]=_face4 ;
01081       tmpConstituents1[4]=_face5 ;
01082       int ** tmpConstituents2 = new int*[9];
01083       tmpConstituents2[0]=_edge1 ;
01084       tmpConstituents2[1]=_edge2 ;
01085       tmpConstituents2[2]=_edge3 ;
01086       tmpConstituents2[3]=_edge4 ;
01087       tmpConstituents2[4]=_edge5 ;
01088       tmpConstituents2[5]=_edge6 ;
01089       tmpConstituents2[6]=_edge7 ;
01090       tmpConstituents2[7]=_edge8 ;
01091       tmpConstituents2[8]=_edge9 ;
01092       _constituents = new int**[2] ;
01093       _constituents[0]=tmpConstituents1 ;
01094       _constituents[1]=tmpConstituents2 ;
01095       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
01096       tmpConstituentsType1[0] = MED_TRIA6 ;
01097       tmpConstituentsType1[1] = MED_TRIA6 ;
01098       tmpConstituentsType1[2] = MED_QUAD8 ;
01099       tmpConstituentsType1[3] = MED_QUAD8 ;
01100       tmpConstituentsType1[4] = MED_QUAD8 ;
01101       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[9] ;
01102       tmpConstituentsType2[0] = MED_SEG3 ;
01103       tmpConstituentsType2[1] = MED_SEG3 ;
01104       tmpConstituentsType2[2] = MED_SEG3 ;
01105       tmpConstituentsType2[3] = MED_SEG3 ;
01106       tmpConstituentsType2[4] = MED_SEG3 ;
01107       tmpConstituentsType2[5] = MED_SEG3 ;
01108       tmpConstituentsType2[6] = MED_SEG3 ;
01109       tmpConstituentsType2[7] = MED_SEG3 ;
01110       tmpConstituentsType2[8] = MED_SEG3 ;
01111       _constituentsType = new medGeometryElement*[2] ;
01112       _constituentsType[0]=tmpConstituentsType1 ;
01113       _constituentsType[1]=tmpConstituentsType2 ;
01114       break ;
01115     }
01116     case MED_PYRA5   : {
01117       _name="MED_PYRA5" ;
01118       _type=t;
01119       _dimension=3;
01120       _numberOfVertexes=5;
01121       _numberOfNodes=5;
01122       _numberOfConstituentsDimension=2 ;
01123       _numberOfConstituents=new int[2] ;
01124       _numberOfConstituents[0]=5 ;
01125       _numberOfConstituents[1]=8 ;
01126       _numberOfNodeOfEachConstituent=new int*[2] ;
01127       _numberOfNodeOfEachConstituent[0]=new int[5] ;
01128       _numberOfNodeOfEachConstituent[0][0]=4 ;
01129       _numberOfNodeOfEachConstituent[0][1]=3 ;
01130       _numberOfNodeOfEachConstituent[0][2]=3 ;
01131       _numberOfNodeOfEachConstituent[0][3]=3 ;
01132       _numberOfNodeOfEachConstituent[0][4]=3 ;
01133       _numberOfNodeOfEachConstituent[1]=new int[8] ;
01134       _numberOfNodeOfEachConstituent[1][0]=2 ;
01135       _numberOfNodeOfEachConstituent[1][1]=2 ;
01136       _numberOfNodeOfEachConstituent[1][2]=2 ;
01137       _numberOfNodeOfEachConstituent[1][3]=2 ;
01138       _numberOfNodeOfEachConstituent[1][4]=2 ;
01139       _numberOfNodeOfEachConstituent[1][5]=2 ;
01140       _numberOfNodeOfEachConstituent[1][6]=2 ;
01141       _numberOfNodeOfEachConstituent[1][7]=2 ;
01142 
01143       int* _edge1=new int[2];
01144       _edge1[0]=1;
01145       _edge1[1]=2;
01146       int* _edge2=new int[2];
01147       _edge2[0]=2;
01148       _edge2[1]=3;
01149       int* _edge3=new int[2];
01150       _edge3[0]=3;
01151       _edge3[1]=4;
01152       int* _edge4=new int[2];
01153       _edge4[0]=4;
01154       _edge4[1]=1;
01155       int* _edge5=new int[2];
01156       _edge5[0]=1;
01157       _edge5[1]=5;
01158       int* _edge6=new int[2];
01159       _edge6[0]=2;
01160       _edge6[1]=5;
01161       int* _edge7=new int[2];
01162       _edge7[0]=3;
01163       _edge7[1]=5;
01164       int* _edge8=new int[2];
01165       _edge8[0]=4;
01166       _edge8[1]=5;
01167       int* _face1=new int[4];
01168       _face1[0]=1;
01169       _face1[1]=2;
01170       _face1[2]=3;
01171       _face1[3]=4;
01172       int* _face2=new int[3];
01173       _face2[0]=1;
01174       _face2[1]=5;
01175       _face2[2]=2;
01176       int* _face3=new int[3];
01177       _face3[0]=2;
01178       _face3[1]=5;
01179       _face3[2]=3;
01180       int* _face4=new int[3];
01181       _face4[0]=3;
01182       _face4[1]=5;
01183       _face4[2]=4;
01184       int* _face5=new int[3];
01185       _face5[0]=4;
01186       _face5[1]=5;
01187       _face5[2]=1;
01188       int ** tmpConstituents1 = new int*[5];
01189       tmpConstituents1[0]=_face1 ;
01190       tmpConstituents1[1]=_face2 ;
01191       tmpConstituents1[2]=_face3 ;
01192       tmpConstituents1[3]=_face4 ;
01193       tmpConstituents1[4]=_face5 ;
01194       int ** tmpConstituents2 = new int*[8];
01195       tmpConstituents2[0]=_edge1 ;
01196       tmpConstituents2[1]=_edge2 ;
01197       tmpConstituents2[2]=_edge3 ;
01198       tmpConstituents2[3]=_edge4 ;
01199       tmpConstituents2[4]=_edge5 ;
01200       tmpConstituents2[5]=_edge6 ;
01201       tmpConstituents2[6]=_edge7 ;
01202       tmpConstituents2[7]=_edge8 ;
01203       _constituents = new int**[2] ;
01204       _constituents[0]=tmpConstituents1 ;
01205       _constituents[1]=tmpConstituents2 ;
01206       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
01207       tmpConstituentsType1[0] = MED_QUAD4 ;
01208       tmpConstituentsType1[1] = MED_TRIA3 ;
01209       tmpConstituentsType1[2] = MED_TRIA3 ;
01210       tmpConstituentsType1[3] = MED_TRIA3 ;
01211       tmpConstituentsType1[4] = MED_TRIA3 ;
01212       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[8] ;
01213       tmpConstituentsType2[0] = MED_SEG2 ;
01214       tmpConstituentsType2[1] = MED_SEG2 ;
01215       tmpConstituentsType2[2] = MED_SEG2 ;
01216       tmpConstituentsType2[3] = MED_SEG2 ;
01217       tmpConstituentsType2[4] = MED_SEG2 ;
01218       tmpConstituentsType2[5] = MED_SEG2 ;
01219       tmpConstituentsType2[6] = MED_SEG2 ;
01220       tmpConstituentsType2[7] = MED_SEG2 ;
01221       _constituentsType = new medGeometryElement*[2] ;
01222       _constituentsType[0]=tmpConstituentsType1 ;
01223       _constituentsType[1]=tmpConstituentsType2 ;
01224       break;
01225     }
01226     case MED_PYRA13  : {
01227       _name="MED_PYRA13" ;
01228       _type=t;
01229       _dimension=3;
01230       _numberOfVertexes=5;
01231       _numberOfNodes=13;
01232       _numberOfConstituentsDimension=2 ;
01233       _numberOfConstituents=new int[2] ;
01234       _numberOfConstituents[0]=5 ;
01235       _numberOfConstituents[1]=8 ;
01236       _numberOfNodeOfEachConstituent=new int*[2] ;
01237       _numberOfNodeOfEachConstituent[0]=new int[5] ;
01238       _numberOfNodeOfEachConstituent[0][0]=8 ;
01239       _numberOfNodeOfEachConstituent[0][1]=6 ;
01240       _numberOfNodeOfEachConstituent[0][2]=6 ;
01241       _numberOfNodeOfEachConstituent[0][3]=6 ;
01242       _numberOfNodeOfEachConstituent[0][4]=6 ;
01243       _numberOfNodeOfEachConstituent[1]=new int[8] ;
01244       _numberOfNodeOfEachConstituent[1][0]=3 ;
01245       _numberOfNodeOfEachConstituent[1][1]=3 ;
01246       _numberOfNodeOfEachConstituent[1][2]=3 ;
01247       _numberOfNodeOfEachConstituent[1][3]=3 ;
01248       _numberOfNodeOfEachConstituent[1][4]=3 ;
01249       _numberOfNodeOfEachConstituent[1][5]=3 ;
01250       _numberOfNodeOfEachConstituent[1][6]=3 ;
01251       _numberOfNodeOfEachConstituent[1][7]=3 ;
01252 
01253       int* _edge1=new int[3];
01254       _edge1[0]=1;
01255       _edge1[1]=2;
01256       _edge1[2]=6;
01257       int* _edge2=new int[3];
01258       _edge2[0]=2;
01259       _edge2[1]=3;
01260       _edge2[2]=7;
01261       int* _edge3=new int[3];
01262       _edge3[0]=3;
01263       _edge3[1]=4;
01264       _edge3[2]=8;
01265       int* _edge4=new int[3];
01266       _edge4[0]=4;
01267       _edge4[1]=1;
01268       _edge4[2]=9;
01269       int* _edge5=new int[3];
01270       _edge5[0]=1;
01271       _edge5[1]=5;
01272       _edge5[2]=10;
01273       int* _edge6=new int[3];
01274       _edge6[0]=2;
01275       _edge6[1]=5;
01276       _edge6[2]=11;
01277       int* _edge7=new int[3];
01278       _edge7[0]=3;
01279       _edge7[1]=5;
01280       _edge7[2]=12;
01281       int* _edge8=new int[3];
01282       _edge8[0]=4;
01283       _edge8[1]=5;
01284       _edge8[2]=13;
01285       int* _face1=new int[8];
01286       _face1[0]=1;
01287       _face1[1]=2;
01288       _face1[2]=3;
01289       _face1[3]=4;
01290       _face1[4]=6;
01291       _face1[5]=7;
01292       _face1[6]=8;
01293       _face1[7]=9;
01294       int* _face2=new int[6];
01295       _face2[0]=1;
01296       _face2[1]=5;
01297       _face2[2]=2;
01298       _face2[3]=10;
01299       _face2[4]=11;
01300       _face2[5]=6;
01301       int* _face3=new int[6];
01302       _face3[0]=2;
01303       _face3[1]=5;
01304       _face3[2]=3;
01305       _face3[3]=11;
01306       _face3[4]=12;
01307       _face3[5]=7;
01308       int* _face4=new int[6];
01309       _face4[0]=3;
01310       _face4[1]=5;
01311       _face4[2]=4;
01312       _face4[3]=12;
01313       _face4[4]=13;
01314       _face4[5]=8;
01315       int* _face5=new int[6];
01316       _face5[0]=4;
01317       _face5[1]=5;
01318       _face5[2]=1;
01319       _face5[3]=13;
01320       _face5[4]=10;
01321       _face5[5]=9;
01322       int ** tmpConstituents1 = new int*[5];
01323       tmpConstituents1[0]=_face1 ;
01324       tmpConstituents1[1]=_face2 ;
01325       tmpConstituents1[2]=_face3 ;
01326       tmpConstituents1[3]=_face4 ;
01327       tmpConstituents1[4]=_face5 ;
01328       int ** tmpConstituents2 = new int*[8];
01329       tmpConstituents2[0]=_edge1 ;
01330       tmpConstituents2[1]=_edge2 ;
01331       tmpConstituents2[2]=_edge3 ;
01332       tmpConstituents2[3]=_edge4 ;
01333       tmpConstituents2[4]=_edge5 ;
01334       tmpConstituents2[5]=_edge6 ;
01335       tmpConstituents2[6]=_edge7 ;
01336       tmpConstituents2[7]=_edge8 ;
01337       _constituents = new int**[2] ;
01338       _constituents[0]=tmpConstituents1 ;
01339       _constituents[1]=tmpConstituents2 ;
01340       medGeometryElement * tmpConstituentsType1 = new medGeometryElement[5] ;
01341       tmpConstituentsType1[0] = MED_QUAD8 ;
01342       tmpConstituentsType1[1] = MED_TRIA6 ;
01343       tmpConstituentsType1[2] = MED_TRIA6 ;
01344       tmpConstituentsType1[3] = MED_TRIA6 ;
01345       tmpConstituentsType1[4] = MED_TRIA6 ;
01346       medGeometryElement * tmpConstituentsType2 = new medGeometryElement[8] ;
01347       tmpConstituentsType2[0] = MED_SEG3 ;
01348       tmpConstituentsType2[1] = MED_SEG3 ;
01349       tmpConstituentsType2[2] = MED_SEG3 ;
01350       tmpConstituentsType2[3] = MED_SEG3 ;
01351       tmpConstituentsType2[4] = MED_SEG3 ;
01352       tmpConstituentsType2[5] = MED_SEG3 ;
01353       tmpConstituentsType2[6] = MED_SEG3 ;
01354       tmpConstituentsType2[7] = MED_SEG3 ;
01355       _constituentsType = new medGeometryElement*[2] ;
01356       _constituentsType[0]=tmpConstituentsType1 ;
01357       _constituentsType[1]=tmpConstituentsType2 ;
01358       break;
01359     }
01360     case MED_POLYGON:
01361       _name="MED_POLYGON" ;
01362       _type=t;
01363       _dimension=2;
01364       _numberOfConstituentsDimension=1 ;
01365       _numberOfConstituents=new int[_numberOfConstituentsDimension] ;
01366       _numberOfConstituents[0]=0 ;
01367       _numberOfNodeOfEachConstituent=new int*[_numberOfConstituentsDimension] ;
01368       _numberOfNodeOfEachConstituent[0]=0;
01369       _constituentsType = new medGeometryElement*[_numberOfConstituentsDimension] ;
01370       _constituentsType[0]=0 ;
01371       _constituents = new int**[_numberOfConstituentsDimension] ;
01372       _constituents[0]=0;
01373      break;
01374     case MED_POLYHEDRA:
01375       _name="MED_POLYHEDRA" ;
01376       _type=t;
01377       _dimension=3;
01378       _numberOfConstituentsDimension=2 ;
01379       _numberOfConstituents=new int[_numberOfConstituentsDimension] ;
01380       _numberOfConstituents[0]=_numberOfConstituents[1]=0;
01381       _numberOfNodeOfEachConstituent=new int*[_numberOfConstituentsDimension] ;
01382       _numberOfNodeOfEachConstituent[0]=_numberOfNodeOfEachConstituent[1]=0;
01383       _constituentsType = new medGeometryElement*[_numberOfConstituentsDimension] ;
01384       _constituentsType[0]=_constituentsType[1]=0 ;
01385       _constituents = new int**[_numberOfConstituentsDimension] ;
01386       _constituents[0]=_constituents[1]=0;
01387       break;
01388 //      default : 
01389 //        _type=0;
01390 //        break;
01391     }
01392 }
01393 
01394 ostream & MEDMEM::operator<<(ostream &os,const CELLMODEL &my)
01395 {
01396   os << "Cell Model :" << endl ;
01397   os << "  - name               : " << my._name << endl;
01398   os << "  - type               : " << (int)my._type << endl;
01399   os << "  - dimension          : " << my._dimension << endl;
01400   os << "  - number of nodes    : " << my._numberOfNodes << endl ;
01401   os << "  - number of vertexes : " << my._numberOfVertexes << endl ;
01402 
01403   os << "  - number of Constituents Dimension : " << my._numberOfConstituentsDimension << endl ;
01404 
01405   for(int i=0;i<my._numberOfConstituentsDimension;i++)
01406     {
01407 
01408       os << "  - for dimension (-" << i+1 << ") : " << endl ;
01409       os << "    - number of Constituents for this Dimension : " << my._numberOfConstituents[i] << endl ;
01410 
01411       for(int j=0;j<my._numberOfConstituents[i];j++)
01412         {
01413           os << "    - number of node for this constituent : " << my._numberOfNodeOfEachConstituent[i][j] << endl ;
01414           os << "      - constituents " << j+1 << " of type "<< my._constituentsType[i][j] <<" : " ;
01415           for(int k=0;k<my._numberOfNodeOfEachConstituent[i][j];k++)
01416             os << my._constituents[i][j][k] << " " ;
01417           os << endl ;
01418         }
01419     }
01420   return os;
01421 }
01422 
01423 // Return number of constituents type (which dimension is _dimension-1).
01424 int CELLMODEL::getNumberOfConstituentsType() const
01425 {
01426   set<medGeometryElement> constituentsTypes ;
01427 //   if (_constituentsType.size() > 0 ) {
01428 //     vector<medGeometryElement> constituentsType = _constituentsType[0] ;
01429 //     vector<medGeometryElement>::iterator itvec ;
01430 //     for(itvec=constituentsType.begin();itvec!=constituentsType.end();itvec++)
01431 //       constituentsTypes.insert(*itvec);
01432 //   }
01433   return constituentsTypes.size() ;
01434 }
01435 
01436   // Return all types of constituents which dimension is (_dimension-1).
01437 set<medGeometryElement>  CELLMODEL::getAllConstituentsType() const
01438 {
01439   set<medGeometryElement> constituentsTypes ;
01440 //   if (_constituentsType.size() > 0 ) {
01441 //     vector<medGeometryElement> constituentsType = _constituentsType[0] ;
01442 //     vector<medGeometryElement>::iterator itvec ;
01443 //     for(itvec=constituentsType.begin();itvec!=constituentsType.end();itvec++)
01444 //       constituentsTypes.insert(*itvec);
01445 //   }
01446   return constituentsTypes ;
01447 }
01448 
01449   // Return number of constituents foreach type (which dimension is _dimension-1).
01450 map<medGeometryElement,int>  CELLMODEL::getNumberOfConstituentsForeachType() const
01451 {
01452   map<medGeometryElement,int> numberOfConstituentsForeachType ;
01453 //   map<medGeometryElement,int>::iterator itmap ;
01454 //   if (_constituentsType.size() > 0 ) {
01455 //     vector<medGeometryElement> constituentsType = _constituentsType[0] ;
01456 //     vector<medGeometryElement>::iterator itvec ;
01457 //     for(itvec=constituentsType.begin();itvec!=constituentsType.end();itvec++) {
01458 //       itmap = numberOfConstituentsForeachType.find(*itvec);
01459 //       if (itmap==numberOfConstituentsForeachType.end()) // new element
01460 //      numberOfConstituentsForeachType[*itvec]=1 ;
01461 //       else
01462 //      numberOfConstituentsForeachType[*itvec]++ ;
01463 //     }
01464 //   }
01465   return numberOfConstituentsForeachType ;
01466 }
01467 
01468 void CELLMODEL::init(const CELLMODEL &m)
01469 {
01470   _name=m._name ;
01471   _type= m._type ;
01472   _dimension = m._dimension ;
01473   _numberOfNodes = m._numberOfNodes ;
01474   _numberOfVertexes = m._numberOfVertexes ;
01475   
01476   _numberOfConstituentsDimension = m._numberOfConstituentsDimension ;
01477   
01478   _numberOfConstituents = new int[_numberOfConstituentsDimension] ;
01479   for(int i=0; i<_numberOfConstituentsDimension; i++)
01480     _numberOfConstituents[i]=m._numberOfConstituents[i] ;
01481   
01482   _numberOfNodeOfEachConstituent = new int*[_numberOfConstituentsDimension] ;
01483   for(int i=0; i<_numberOfConstituentsDimension; i++) {
01484     int numberOf = _numberOfConstituents[i] ;
01485     int * newArray = new int[numberOf] ;
01486     int * oldArray = m._numberOfNodeOfEachConstituent[i] ;
01487     for(int j=0; j<numberOf; j++)
01488       newArray[j] = oldArray[j] ;
01489     _numberOfNodeOfEachConstituent[i] = newArray ;
01490   }
01491   _constituents = new int**[_numberOfConstituentsDimension] ;
01492   if(_constituentsType)
01493     {
01494       for(int i=0; i<_numberOfConstituentsDimension; i++)
01495         delete [] _constituentsType[i];
01496       delete [] _constituentsType;
01497     }
01498   _constituentsType = new medGeometryElement*[_numberOfConstituentsDimension] ;
01499   for(int i=0; i<_numberOfConstituentsDimension; i++) {
01500     int numberOf = _numberOfConstituents[i] ;
01501     int ** tmpArray = new int*[numberOf] ;
01502     medGeometryElement * newArrayType = new medGeometryElement[numberOf] ;
01503     medGeometryElement * oldArrayType = m._constituentsType[i] ;
01504     
01505     for(int j=0; j<numberOf; j++) {
01506       int numberOf2 = _numberOfNodeOfEachConstituent[i][j] ;
01507       int * newArray = new int[numberOf2] ;
01508       int * oldArray = m._constituents[i][j] ;
01509       for(int k=0; k<numberOf2; k++)
01510         newArray[k] = oldArray[k] ;
01511       tmpArray[j] = newArray ;
01512       newArrayType[j] = oldArrayType[j] ;
01513     }
01514     _constituents[i] = tmpArray ;
01515     _constituentsType[i] = newArrayType ;
01516   }
01517   
01518 }
01519 void CELLMODEL::clean()
01520 {
01521   for(int i=0; i<_numberOfConstituentsDimension; i++) {
01522     int numberOf = _numberOfConstituents[i] ;
01523     for(int j=0; j<numberOf; j++) {
01524       if (_constituents[i][j])
01525         delete[] _constituents[i][j] ;
01526     }
01527     if (_constituentsType[i])
01528       delete [] _constituentsType[i] ;
01529     if (_constituents[i])
01530       delete[] _constituents[i] ;
01531     if (_numberOfNodeOfEachConstituent[i])
01532       delete[] _numberOfNodeOfEachConstituent[i] ;
01533   }
01534   delete [] _constituentsType; 
01535   if (_numberOfConstituents)
01536     delete[]_numberOfConstituents ;
01537   if (_constituents)
01538     delete[] _constituents ;
01539   if (_numberOfNodeOfEachConstituent)
01540     delete[] _numberOfNodeOfEachConstituent ;
01541 
01542   _constituentsType = 0;
01543   _numberOfConstituents = 0;
01544   _constituents = 0;
01545   _numberOfNodeOfEachConstituent = 0;
01546 }