2 File MEDMEM_CellModel.hxx
13 #include "utilities.h"
14 #include "MEDMEM_define.hxx"
17 using namespace MED_EN;
20 This class is an internal class and should not be used by the end-user.
21 This class describes all possible cell models and is used in order
22 to acces informations about geometric type of the cell :
23 Each object (if instancied), contains generic informations about
24 the cell model it describes as cell dimensions, number of nodes...
31 /*! private method : /n
32 used by constructor and operator= */
33 void init(const CELLMODEL &m);
35 /*! private method : /n */
40 /*! explicit name (as MED_POINT1) */
42 /*! type of cell (cf define.h) */
43 medGeometryElement _type;
44 /*! Cell dimension (not space dimension) */
46 /*! number of nodes forming this type of a cell */
48 /*! number of vertexes forming this type of a cell */
49 int _numberOfVertexes;
50 /*! 2 for a 3D Cell and 1 for a 2DCell */
51 int _numberOfConstituentsDimension;
52 /*! Array of size numberOfConstituentsDimension */
53 int* _numberOfConstituents ;
54 /*! Array of size _numberOfConstituentsDimension
55 x_numberOfConstituents[i] */
56 int** _numberOfNodeOfEachConstituent ;
57 /*! defines nodal local connectivity for each
58 constituents of each dimension:
59 should be seen as a vector<vector<vector>> \n
60 - first vector : for each cell dimension
61 (first : dim-1, second if any : dim-2)\n
62 - second vector : for each constituent of
64 - third vector : list of local nodes */
65 int*** _constituents ;
66 medGeometryElement** _constituentsType ;
73 CELLMODEL(medGeometryElement t);
74 /*! Copy constructor. */
75 inline CELLMODEL(const CELLMODEL &m);
79 /*! Operator = : duplicate CELLMODEL. */
80 inline CELLMODEL & operator=(const CELLMODEL &m);
82 /*! Operator << : print CELLMODEL to the given stream. */
83 friend ostream & operator<<(ostream &os,const CELLMODEL &my);
85 /*! returns _name attribute (ie: MED_PENTA15).\n
86 see med.h (in med/include) */
87 inline string getName() const;
89 /*! returns number of vertexes forming this type of cell */
90 inline int getNumberOfVertexes() const;
92 /*! returns number of nodes forming this type of cell */
93 inline int getNumberOfNodes() const;
95 /*! returns the dimension of this type of cell./n
96 it can be different from mesh dimension */
97 inline int getDimension() const;
99 /*! returns the geometric type of the cell. \n
100 see med.h (in med/include) */
101 inline medGeometryElement getType() const;
103 /*! returns all constituents which dimension is _dimension-dim.*/
104 int** getConstituents(int dim) const;
106 /*! returns number of constituents which dimension is _dimension-dim.*/
107 int getNumberOfConstituents(int dim) const;
109 /*! returns local nodes numbers vector for num-th constituent
110 which dimension is _dimension-dim.*/
111 int* getNodesConstituent(int dim,int num) const;
113 /*! returns local node number of nodes_index-th node for
114 num-th constituent which dimension is _dimension-dim.*/
115 int getNodeConstituent(int dim,int num,int nodes_index) const;
117 /*! returns types of each constituents which dimension
119 medGeometryElement* getConstituentsType(int dim) const;
121 /*! returns type of num-th constituent which dimension
123 medGeometryElement getConstituentType(int dim,int num) const;
125 /*! returns number of constituents type
126 (which dimension is _dimension-1).*/
127 int getNumberOfConstituentsType() const;
129 /*! returns all types of constituents which dimension
131 set<medGeometryElement> getAllConstituentsType() const;
133 /*! returns number of constituents foreach type (which dimension
135 map<medGeometryElement,int> getNumberOfConstituentsForeachType() const;
140 // ------------------------------------------
142 // ------------------------------------------
144 inline CELLMODEL::CELLMODEL():
148 _numberOfVertexes(0),
149 _numberOfConstituentsDimension(0),
150 _numberOfConstituents((int*)NULL),
151 _numberOfNodeOfEachConstituent((int**)NULL),
152 _constituents((int***)NULL),
153 _constituentsType((medGeometryElement**)NULL)
156 inline CELLMODEL::CELLMODEL(const CELLMODEL &m)
160 inline CELLMODEL::~CELLMODEL()
162 MESSAGE("CELLMODEL::~CELLMODEL() destroying the cell");
165 inline CELLMODEL & CELLMODEL::operator=(const CELLMODEL &m)
171 inline string CELLMODEL::getName() const
175 inline int CELLMODEL::getNumberOfVertexes() const
177 return _numberOfVertexes;
179 inline int CELLMODEL::getNumberOfNodes() const
181 return _numberOfNodes;
183 inline int CELLMODEL::getDimension() const
187 inline medGeometryElement CELLMODEL::getType() const
191 inline int** CELLMODEL::getConstituents(int dim) const
193 return _constituents[dim-1] ;
195 inline int CELLMODEL::getNumberOfConstituents(int dim) const
197 return _numberOfConstituents[dim-1] ;
199 inline int* CELLMODEL::getNodesConstituent(int dim,int num) const
201 return _constituents[dim-1][num-1];
203 inline int CELLMODEL::getNodeConstituent(int dim,int num,int nodesNumber) const
205 return _constituents[dim-1][num-1][nodesNumber-1] ;
207 inline medGeometryElement* CELLMODEL::getConstituentsType(int dim) const
209 return _constituentsType[dim-1];
211 inline medGeometryElement CELLMODEL::getConstituentType(int dim,int num) const
213 return _constituentsType[dim-1][num-1];
216 #endif /* CELLMODEL_HXX */