00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __MESH_EXTRACT_H
00034 #define __MESH_EXTRACT_H
00035
00036 #include "Mesh.h"
00037
00038 namespace OFELI {
00039
00054 class NodeList {
00055
00056 public:
00057
00059 NodeList(Mesh &ms);
00060
00062 ~NodeList() { }
00063
00068 void selectCode(int code, int dof=1);
00069
00079 void selectCoordinate(double x, double y=ANY, double z=ANY);
00080
00082 size_t getNbNodes() const { return _nb_nodes; }
00083
00085 void top() { _it = 0; }
00086
00088 void top() const { _const_it = 0; }
00089
00091 Node *get()
00092 {
00093 if (_it==_nb_nodes)
00094 return NULL;
00095 else
00096 return _theList[_it++];
00097 }
00098
00100 Node *get() const
00101 {
00102 if (_const_it==_nb_nodes)
00103 return NULL;
00104 else
00105 return _theList[_const_it++];
00106 }
00107
00108 private:
00109
00110 Mesh *_ms;
00111 NodeSet _theList;
00112 size_t _it, _nb_nodes, _nbn;
00113 mutable size_t _const_it;
00114 };
00115
00116
00126 class ElementList {
00127
00128 public:
00129
00131 ElementList(Mesh &ms);
00132
00134 ~ElementList() { }
00135
00137 void selectCode(int code);
00138
00140 size_t getNbElements() const { return _nb_elements; }
00141
00143 void top() { _it = 0; }
00144
00146 void top() const { _const_it = 0; }
00147
00149 Element *get()
00150 {
00151 if (_it==_nb_elements)
00152 return NULL;
00153 else
00154 return _theList[_it++];
00155 }
00156
00158 Element *get() const
00159 {
00160 if (_const_it==_nb_elements)
00161 return NULL;
00162 else
00163 return _theList[_const_it++];
00164 }
00165
00166 private:
00167
00168 Mesh *_ms;
00169 ElementSet _theList;
00170 size_t _it, _nb_elements, _nbn;
00171 mutable size_t _const_it;
00172 };
00173
00174
00184 class SideList {
00185
00186 public:
00187
00189 SideList(Mesh &ms);
00190
00192 ~SideList() { }
00193
00198 void selectCode(int code, int dof=1);
00199
00201 size_t getNbSides() const { return _nb_sides; }
00202
00204 void top() { _it = 0; }
00205
00207 void top() const { _const_it = 0; }
00208
00210 Side *get()
00211 {
00212 if (_it==_nb_sides)
00213 return NULL;
00214 else
00215 return _theList[_it++];
00216 }
00217
00219 Side *get() const
00220 {
00221 if (_const_it==_nb_sides)
00222 return NULL;
00223 else
00224 return _theList[_const_it++];
00225 }
00226
00227 private:
00228
00229 Mesh *_ms;
00230 SideSet _theList;
00231 size_t _it, _nb_sides, _nbn;
00232 mutable size_t _const_it;
00233 };
00234
00235
00239 ostream& operator<<(ostream& s, const NodeList &nl);
00240
00244 ostream& operator<<(ostream& s, const ElementList &el);
00245
00249 ostream& operator<<(ostream& s, const SideList &sl);
00250
00251 }
00252
00253 #endif