1 #include "MEDMEM_DriversDef.hxx"
7 // Returns the (string) name of the geometry of
8 // an element given by a med_geometrie_element value
9 GEO_NAME::GEO_NAME() : map<int,string>()
11 map<int,string> &table = (map<int,string>&)*this ;
12 table[(int)0 ] = "MED_NONE" ;
13 table[(int)MED_POINT1 ] = "MED_POINT1" ;
14 table[(int)MED_SEG2 ] = "MED_SEG2" ;
15 table[(int)MED_SEG3 ] = "MED_SEG3" ;
16 table[(int)MED_TRIA3 ] = "MED_TRIA3" ;
17 table[(int)MED_TRIA6 ] = "MED_TRIA6" ;
18 table[(int)MED_QUAD4 ] = "MED_QUAD4" ;
19 table[(int)MED_QUAD8 ] = "MED_QUAD8" ;
20 table[(int)MED_TETRA4 ] = "MED_TETRA4" ;
21 table[(int)MED_TETRA10] = "MED_TETRA10";
22 table[(int)MED_HEXA8 ] = "MED_HEXA8" ;
23 table[(int)MED_HEXA20 ] = "MED_HEXA20" ;
24 table[(int)MED_PENTA6 ] = "MED_PENTA6" ;
25 table[(int)MED_PENTA15] = "MED_PENTA15";
26 table[(int)MED_PYRA5 ] = "MED_PYRA5" ;
27 table[(int)MED_PYRA13 ] = "MED_PYRA13" ;
28 assert( table.find( (int)MED_PYRA13 ) != table.end() ) ;
33 // MESSAGE(" destructor GEO_NAME::~GEO_NAME() "<< size() );
35 // MESSAGE(" end of destructor GEO_NAME::~GEO_NAME() "<< size() );
38 string & GEO_NAME::operator[]( const MED_EN::medGeometryElement &c ) const
40 map<int,string> &table = (map<int,string>&)*this ;
41 assert( table.find( (int)c ) != table.end() ) ;
42 return table[ (int)c ] ;
46 // Returns the (string) name of the type of
47 // an entity given by a med_entite_maillage value
49 ENT_NAME::ENT_NAME() : map<int,string>()
51 map<int,string> &table = (map<int,string>&)*this ;
52 table[(int)MED_CELL ] = "MED_MAILLE";
53 table[(int)MED_FACE ] = "MED_FACE";
54 table[(int)MED_EDGE ] = "MED_ARETE";
55 table[(int)MED_NODE ] = "MED_NOEUD";
60 // MESSAGE(" destructor ENT_NAME::~ENT_NAME() "<< size() );
62 // MESSAGE(" end of destructor ENT_NAME::~ENT_NAME() "<< size() );
65 string & ENT_NAME::operator[]( const MED_EN::medEntityMesh &c ) const
67 map<int,string> &table = (map<int,string>&)*this ;
68 assert( table.find( (int)c ) != table.end() ) ;
69 return table[ (int)c ] ;
72 MESH_ENTITIES::MESH_ENTITIES () : map<int, const list<MED_EN::medGeometryElement> >()
74 // Override the const declaration in order to used the find method below
75 // map<int, const list<med_geometrie_element> > &table = (map<int, const list<med_geometrie_element> >&)*this ; unused local variable
77 // Initialize the value associated with the ROUGE_ key ( use the private operator = )
79 const MED_EN::medGeometryElement T[] = {
96 static const list<MED_EN::medGeometryElement> geomList(T,T+sizeof(T)/sizeof(MED_EN::medGeometryElement));
97 (*this)[MED_CELL] = geomList;
101 const MED_EN::medGeometryElement T[] = {
107 static const list<MED_EN::medGeometryElement> geomList(T,T+sizeof(T)/sizeof(MED_EN::medGeometryElement));
108 (*this)[MED_FACE] = geomList;
112 const MED_EN::medGeometryElement T[] = {
116 static const list<MED_EN::medGeometryElement> geomList(T,T+sizeof(T)/sizeof(MED_EN::medGeometryElement));
117 (*this)[MED_EDGE] = geomList;
121 // const med_geometrie_element T[] = { MED_NONE };
122 const MED_EN::medGeometryElement T[] = { (MED_EN::medGeometryElement)0 };
123 static const list<MED_EN::medGeometryElement> geomList(T,T+sizeof(T)/sizeof(MED_EN::medGeometryElement));
124 (*this)[MED_NODE] = geomList;
129 MESH_ENTITIES::~MESH_ENTITIES()
131 // MESSAGE(" destructor MESH_ENTITIES::~MESH_ENTITIES() "<< size() );
133 // MESSAGE(" end of destructor MESH_ENTITIES::~MESH_ENTITIES() "<< size() );
136 const list<MED_EN::medGeometryElement> & MESH_ENTITIES::operator[]( const MED_EN::medEntityMesh &c ) const
138 map<int,const list<MED_EN::medGeometryElement> > &table = (map<int,const list<MED_EN::medGeometryElement> >&)*this ;
139 // Verify the object already exists in the map
140 assert( table.find( (int)c ) != table.end() ) ;
141 return table[ (int)c ] ;
144 // This operator is used to initialize class objects of type const list<med_geometrie_element>
145 list<MED_EN::medGeometryElement> & MESH_ENTITIES::operator[]( const MED_EN::medEntityMesh &c )
147 return (list<MED_EN::medGeometryElement> &) this->map<int,const list<MED_EN::medGeometryElement> >::operator[]( (int)c) ;
150 } // End Of NampeSpace MED_EN