2 File MEDMEM_CellModel.hxx
14 #include "MEDMEM_define.hxx"
18 using namespace MED_EN;
23 // use in constructor and operator=
24 void init(const CELLMODEL &m) ;
25 // use in operator= and destructor
31 medGeometryElement _type ;
32 int _dimension ; // Cell _dimension (!= space _dimension)
34 int _numberOfVertexes ;
35 int _numberOfConstituentsDimension ; // 2 in 3D, 1 in 2D
36 // Array of size _numberOfConstituentsDimension
37 int* _numberOfConstituents ;
38 // Array of size _numberOfConstituentsDimensionx_numberOfConstituents[i]
39 int** _numberOfNodeOfEachConstituent ;
40 // Define nodal local connectivity for each constituent for each dimension
41 int*** _constituents ;
42 // define local connectivity for each constituents
44 // first vector : for each cell _dimension
45 // (first : dim-1, second if any : dim-2)
46 // second vector : for each constituents of this _dimension,
47 // third vector : list of local nodes
48 medGeometryElement** _constituentsType ;
57 _numberOfConstituentsDimension(0),
58 _numberOfConstituents((int*)NULL),
59 _numberOfNodeOfEachConstituent((int**)NULL),
60 _constituents((int***)NULL),
61 _constituentsType((medGeometryElement**)NULL)
64 CELLMODEL(medGeometryElement t) ;
65 CELLMODEL(const CELLMODEL &m){
72 CELLMODEL & operator=(const CELLMODEL &m) {
77 friend ostream & operator<<(ostream &os,const CELLMODEL &my);
79 inline string getName() const ;
80 inline int getNumberOfVertexes() const;
81 inline int getNumberOfNodes() const;
82 inline int getDimension() const;
83 inline medGeometryElement getType() const;
85 // Return all constituents which dimension is _dimension-dim.
86 // vector< vector<int> > getConstituents(int dim) const;
87 int** getConstituents(int dim) const;
89 // Return number of constituents which dimension is _dimension-dim.
90 int getNumberOfConstituents(int dim) const;
92 // Return local nodes numbers vector for num-th constituent which dimension is _dimension-dim.
93 int* getNodesConstituent(int dim,int num) const;
95 // Return local node number of nodes_index-th node for num-th constituent which dimension is _dimension-dim.
96 int getNodeConstituent(int dim,int num,int nodes_index);
98 // Return types of each constituents which dimension is _dimension-dim.
99 medGeometryElement* getConstituentsType(int dim) const;
101 // Return type of num-th constituent which dimension is _dimension-dim.
102 medGeometryElement getConstituentType(int dim,int num) const;
105 // Return number of constituents type (which dimension is _dimension-1).
106 int getNumberOfConstituentsType() const;
108 // Return all types of constituents which dimension is (_dimension-1).
109 set<medGeometryElement> getAllConstituentsType() const;
111 // Return number of constituents foreach type (which dimension is _dimension-1).
112 map<medGeometryElement,int> getNumberOfConstituentsForeachType() const;
117 // ------------------------------------------
119 // ------------------------------------------
121 inline string CELLMODEL::getName() const
125 inline int CELLMODEL::getNumberOfVertexes() const
127 return _numberOfVertexes;
129 inline int CELLMODEL::getNumberOfNodes() const
131 return _numberOfNodes;
133 inline int CELLMODEL::getDimension() const
137 inline medGeometryElement CELLMODEL::getType() const
141 //inline vector< vector<int> > CELLMODEL::getConstituents(int dim) const
142 inline int** CELLMODEL::getConstituents(int dim) const
144 return _constituents[dim-1] ;
146 inline int CELLMODEL::getNumberOfConstituents(int dim) const
148 return _numberOfConstituents[dim-1] ;
149 //return _constituents[dim-1].size() ;
151 //inline vector<int> CELLMODEL::getNodesConstituent(int dim,int num) const
152 inline int* CELLMODEL::getNodesConstituent(int dim,int num) const
154 return _constituents[dim-1][num-1];
156 inline int CELLMODEL::getNodeConstituent(int dim,int num,int nodesNumber)
158 return _constituents[dim-1][num-1][nodesNumber-1] ;
160 //inline vector<medGeometryElement> CELLMODEL::getConstituentsType(int dim) const
161 inline medGeometryElement* CELLMODEL::getConstituentsType(int dim) const
163 return _constituentsType[dim-1];
165 inline medGeometryElement CELLMODEL::getConstituentType(int dim,int num) const
167 return _constituentsType[dim-1][num-1];
170 #endif /* CELLMODEL_HXX */