Class documentation of Concepts

Loading...
Searching...
No Matches
meshDX.hh
Go to the documentation of this file.
1
6#ifndef graphMeshDX_hh
7#define graphMeshDX_hh
8
9#include <iostream>
10#include <string>
11#include <list>
12#include "space/postProcess.hh"
13#include "basics/typedefs.hh"
14#include "basics/exceptions.hh"
15#include "spaceTraits.hh"
16#include "geometry/topology.hh"
17
18namespace hp2D {
19 // forward declaration
20 class Space;
21}
22
23namespace hp3D {
24 // forward declaration
25 class Space;
26}
27
28namespace graphics {
29
30 using concepts::Real;
31
32 // forward declartions
33 class VertexList;
34
35 // ********************************************************** Space traits **
36
42 template<typename T, typename traits = spaceTraits<T> >
43 struct spcDim {
44 static inline uint dim() { return traits::dim(); }
45 };
46
59 template<typename T>
60 uint spaceDimension(const T& spc) {
61 return spcDim<T>::dim();
62 }
63
64 // **************************************************************** MeshDX **
65
88 template<class F>
89 class MeshDX {
90 public:
96 MeshDX(concepts::Mesh& msh, std::string filename);
97
107 MeshDX(concepts::Space<F>& spc, std::string filename, uint dim);
108 private:
110 concepts::Space<F>* spc_;
111
113 concepts::Mesh* msh_;
114
116 std::string filename_;
117
119 void constructor_(concepts::GlobalPostprocess<F>& postProcess,
120 std::string& filename, uint nelm, uint dim);
121 };
122
131 MeshDX<Real> drawMeshDX(concepts::Mesh& msh, std::string filename);
132
144 template<typename T>
145 MeshDX<Real> drawMeshDX(T& spc, std::string filename) {
146 return MeshDX<Real>(spc, filename, spaceDimension(spc));
147 }
148
149 // ************************************************************ MeshDXCell **
150
162 template<class F>
164 public:
179 MeshDXCell(std::ostream& os, VertexList& vtxList, uint nelms, uint nfaces,
180 uint dim = 2);
181
182 virtual ~MeshDXCell();
183
184 virtual void operator() (const concepts::Element<F>& elm);
185 virtual void operator() (const concepts::Cell& cell);
186 private:
188 std::ostream& os_;
189
191 VertexList& vtxList_;
192
194 uint dim_;
195 };
196
197 // ******************************************************** BoundaryDXCell **
198
209 template<typename F>
211 public:
212 BoundaryDXCell(VertexList& vtxList) : vtxList_(vtxList) {}
213 virtual ~BoundaryDXCell();
214
215 virtual void operator() (const concepts::Element<F>& elm);
216 virtual void operator() (const concepts::Cell& cell);
217
219 const std::list<const concepts::Connector*>& faces() const
220 { return faces_; }
221 private:
223 VertexList& vtxList_;
224
226 std::list<const concepts::Connector*> faces_;
227 };
228
229} // namespace graphics
230
231#endif // graphMeshDX_hh
virtual void operator()(const concepts::Element< F > &elm)
const std::list< const concepts::Connector * > & faces() const
Returns the list of faces.
Definition meshDX.hh:219
MeshDXCell(std::ostream &os, VertexList &vtxList, uint nelms, uint nfaces, uint dim=2)
virtual void operator()(const concepts::Element< F > &elm)
MeshDX(concepts::Mesh &msh, std::string filename)
MeshDX(concepts::Space< F > &spc, std::string filename, uint dim)
double Real
Definition typedefs.hh:39
MeshDX< Real > drawMeshDX(concepts::Mesh &msh, std::string filename)
uint spaceDimension(const T &spc)
Definition meshDX.hh:60
Definition meshDX.hh:23