Class documentation of Concepts

Loading...
Searching...
No Matches
cuboid.hh
Go to the documentation of this file.
1
6#ifndef Cuboid_hh
7#define Cuboid_hh
8
9#include "basics/typedefs.hh"
10#include "geometry/mesh.hh"
11
12namespace concepts {
13
14// ******************************************************************** Cuboid **
15
21 class Cuboid: public concepts::Mesh3 {
22 public:
23
24 static const uint ncell_ = 1;
26 Cuboid(const Real sizex = 1.0, const Real sizey = 1.0, const Real sizez =
27 1.0);
28
30 virtual ~Cuboid();
31
33 inline uint ncell() const {
34 return ncell_;
35 }
36
39 return new S(cell_);
40 }
41
43 virtual std::ostream& info(std::ostream& os) const;
44
45 private:
46
48 class S: public concepts::Scan<concepts::Cell3> {
49 uint idx_;
50 concepts::Hexahedron3d *(&cell_)[ncell_];
51 public:
52 inline S(concepts::Hexahedron3d *(&cell)[ncell_]) :
53 idx_(0), cell_(cell) {
54 }
55 inline S(const S &scan) :
56 idx_(scan.idx_), cell_(scan.cell_) {
57 }
58
59 inline bool eos() const {
60 return idx_ == ncell_;
61 }
62 inline concepts::Cell3& operator++(int) {
63 return *cell_[idx_++];
64 }
65
66 inline concepts::Scan3* clone() const {
67 return new S(*this);
68 }
69 };
70
71 concepts::Vertex* vtx_[8];
72 concepts::Edge* edg_[12];
73 concepts::Quad* quad_[6];
74 concepts::Hexahedron* hex_[ncell_];
75 concepts::Hexahedron3d* cell_[ncell_];
76 };
77}
78#endif // Cuboid_hh
Three dimensional cell.
Definition cell.hh:112
concepts::Scan3 * scan()
Scanner over the mesh.
Definition cuboid.hh:38
Cuboid(const Real sizex=1.0, const Real sizey=1.0, const Real sizez=1.0)
Constructor, default values for the sizes are 1.0.
virtual ~Cuboid()
Destructor.
virtual std::ostream & info(std::ostream &os) const
For output in command line.
uint ncell() const
Get number of Cells.
Definition cuboid.hh:33
A scanner for a 3D mesh.
Definition mesh.hh:52
double Real
Definition typedefs.hh:39
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320