14 #include "MEDMEM_define.hxx"
16 using namespace MED_EN;
24 medGeometryElement _type ;
25 int _dimension ; // Cell _dimension (!= space _dimension)
27 int _numberOfVertexes ;
28 vector< vector< vector<int> > > _constituents ;
29 // define local connectivity for each constituents
31 // first vector : for each cell _dimension
32 // (first : dim-1, second if any : dim-2)
33 // second vector : for each constituents of this _dimension,
34 // third vector : list of local nodes
35 vector< vector<medGeometryElement> > _constituentsType ;
43 _numberOfVertexes = 0 ;
45 CELLMODEL(medGeometryElement t) ;
46 CELLMODEL(const CELLMODEL &m){
49 _dimension = m._dimension ;
50 _numberOfNodes = m._numberOfNodes ;
51 _numberOfVertexes = m._numberOfVertexes ;
52 _constituents = m._constituents ;
53 _constituentsType = m._constituentsType ;
58 CELLMODEL & operator=(const CELLMODEL &m) {
61 _dimension = m._dimension ;
62 _numberOfNodes = m._numberOfNodes ;
63 _numberOfVertexes = m._numberOfVertexes ;
64 _constituents = m._constituents ;
65 _constituentsType = m._constituentsType ;
68 friend ostream & operator<<(ostream &os,const CELLMODEL &my);
70 inline string getName() const ;
71 inline int getNumberOfVertexes() const;
72 inline int getNumberOfNodes() const;
73 inline int getDimension() const;
74 inline medGeometryElement getType() const;
76 // Return all constituents which dimension is _dimension-dim.
77 vector< vector<int> > getConstituents(int dim) const;
79 // Return number of constituents which dimension is _dimension-dim.
80 int getNumberOfConstituents(int dim) const;
82 // Return local nodes numbers vector for num-th constituent which dimension is _dimension-dim.
83 vector<int> getNodesConstituent(int dim,int num) const;
85 // Return local node number of nodes_index-th node for num-th constituent which dimension is _dimension-dim.
86 int getNodeConstituent(int dim,int num,int nodes_index);
88 // Return types of each constituents which dimension is _dimension-dim.
89 vector <medGeometryElement> getConstituentsType(int dim) const;
91 // Return type of num-th constituent which dimension is _dimension-dim.
92 medGeometryElement getConstituentType(int dim,int num) const;
95 // Return number of constituents type (which dimension is _dimension-1).
96 int getNumberOfConstituentsType() const;
98 // Return all types of constituents which dimension is (_dimension-1).
99 set <medGeometryElement> getAllConstituentsType() const;
101 // Return number of constituents foreach type (which dimension is _dimension-1).
102 map <medGeometryElement,int> getNumberOfConstituentsForeachType() const;
107 // ------------------------------------------
109 // ------------------------------------------
111 inline string CELLMODEL::getName() const
115 inline int CELLMODEL::getNumberOfVertexes() const
117 return _numberOfVertexes;
119 inline int CELLMODEL::getNumberOfNodes() const
121 return _numberOfNodes;
123 inline int CELLMODEL::getDimension() const
127 inline medGeometryElement CELLMODEL::getType() const
131 inline vector< vector<int> > CELLMODEL::getConstituents(int dim) const
133 return _constituents[dim-1] ;
135 inline int CELLMODEL::getNumberOfConstituents(int dim) const
137 return _constituents[dim-1].size() ;
139 inline vector<int> CELLMODEL::getNodesConstituent(int dim,int num) const
141 return _constituents[dim-1][num-1];
143 inline int CELLMODEL::getNodeConstituent(int dim,int num,int nodesNumber)
145 return _constituents[dim-1][num-1][nodesNumber-1] ;
147 inline vector<medGeometryElement> CELLMODEL::getConstituentsType(int dim) const
149 return _constituentsType[dim-1];
151 inline medGeometryElement CELLMODEL::getConstituentType(int dim,int num) const
153 return _constituentsType[dim-1][num-1];
156 #endif /* CELLMODEL_HXX */