Class documentation of Concepts

Loading...
Searching...
No Matches
cube.hh
1
6#ifndef cube_hh
7#define cube_hh
8
9#include "basics/typedefs.hh"
10#include "geometry/mesh.hh"
11
12using concepts::Real;
13
14// ******************************************************************** Cube **
15
19class Cube : public concepts::Mesh3 {
20public:
21 static const uint ncell_ = 1;
22 Cube(const Real sizex = 1.0, const Real sizey = 1.0, const Real sizez = 1.0);
23 virtual ~Cube();
24
25 inline uint ncell() const { return ncell_; }
26 inline concepts::Scan3* scan() { return new S(cell_); }
27
28 virtual std::ostream& info(std::ostream& os) const;
29private:
30 class S : public concepts::Scan<concepts::Cell3> {
31 uint idx_;
32 concepts::Hexahedron3d *(&cell_)[ncell_];
33 public:
34 inline S(concepts::Hexahedron3d *(&cell)[ncell_]) : idx_(0), cell_(cell) {}
35 inline S(const S &scan) : idx_(scan.idx_), cell_(scan.cell_) {}
36
37 inline bool eos() const { return idx_ == ncell_; }
38 inline concepts::Cell3& operator++(int) { return *cell_[idx_++]; }
39
40 inline concepts::Scan3* clone() const { return new S(*this); }
41 };
42
43 concepts::Vertex* vtx_[8];
44 concepts::Edge* edg_[12];
45 concepts::Quad* quad_[6];
46 concepts::Hexahedron* hex_[ncell_];
47
48 concepts::Hexahedron3d* cell_[ncell_];
49};
50
51// ******************************************************************* Cube2 **
52
56class Cube2 : public concepts::Mesh3 {
57public:
58 Cube2(const uint variant = 0);
59 virtual ~Cube2();
60
61 inline uint ncell() const { return 2; }
62 inline concepts::Scan3* scan() { return new S(cell_); }
63
64 virtual std::ostream& info(std::ostream& os) const;
65private:
66 class S : public concepts::Scan<concepts::Cell3> {
67 uint idx_;
68 concepts::Hexahedron3d *(&cell_)[2];
69 public:
70 inline S(concepts::Hexahedron3d *(&cell)[2]) : idx_(0), cell_(cell) {}
71 inline S(const S &scan) : idx_(scan.idx_), cell_(scan.cell_) {}
72
73 inline bool eos() const { return idx_ == 2; }
74 inline concepts::Cell3& operator++(int) { return *cell_[idx_++]; }
75
76 inline concepts::Scan3* clone() const { return new S(*this); }
77 };
78
79 concepts::Vertex* vtx_[12];
80 concepts::Edge* edg_[20];
81 concepts::Quad* quad_[11];
82 concepts::Hexahedron* hex_[2];
83
84 concepts::Hexahedron3d* cell_[2];
85};
86
87// ******************************************************************* Cube3 **
88
92class Cube3 : public concepts::Mesh3 {
93public:
94 Cube3();
95 virtual ~Cube3();
96
97 inline uint ncell() const { return 2; }
98 inline concepts::Scan3* scan() { return new S(cell_); }
99
100 virtual std::ostream& info(std::ostream& os) const;
101private:
102 class S : public concepts::Scan<concepts::Cell3> {
103 uint idx_;
104 concepts::Hexahedron3d *(&cell_)[2];
105 public:
106 inline S(concepts::Hexahedron3d *(&cell)[2]) : idx_(0), cell_(cell) {}
107 inline S(const S &scan) : idx_(scan.idx_), cell_(scan.cell_) {}
108
109 inline bool eos() const { return idx_ == 2; }
110 inline concepts::Cell3& operator++(int) { return *cell_[idx_++]; }
111
112 inline concepts::Scan3* clone() const { return new S(*this); }
113 };
114
115 concepts::Vertex* vtx_[12];
116 concepts::Edge* edg_[20];
117 concepts::Quad* quad_[11];
118 concepts::Hexahedron* hex_[2];
119
120 concepts::Hexahedron3d* cell_[2];
121};
122
123#endif // cube_hh
Definition cube.hh:56
uint ncell() const
Returns the number of cells in the mesh.
Definition cube.hh:61
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
concepts::Scan3 * scan()
Definition cube.hh:62
Definition cube.hh:92
uint ncell() const
Returns the number of cells in the mesh.
Definition cube.hh:97
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
concepts::Scan3 * scan()
Definition cube.hh:98
Definition cube.hh:19
concepts::Scan3 * scan()
Definition cube.hh:26
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
uint ncell() const
Returns the number of cells in the mesh.
Definition cube.hh:25
Three dimensional cell.
Definition cell.hh:112
A scanner for a 3D mesh.
Definition mesh.hh:52
double Real
Definition typedefs.hh:39