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 
12 namespace 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 
38  inline concepts::Scan3* scan() {
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_;
51  public:
52  inline S(concepts::Hexahedron3d *(&cell)[ncell_]) :
53  idx_(0), cell_(cell) {
54  }
55  inline S(const S &scan) :
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 
76  };
77 }
78 #endif // Cuboid_hh
concepts::Hexahedron3d *(& cell_)[ncell_]
Definition: cuboid.hh:50
concepts::Hexahedron * hex_[ncell_]
Definition: cuboid.hh:74
concepts::Edge * edg_[12]
Definition: cuboid.hh:72
A scanner for a 3D mesh.
Definition: mesh.hh:52
A quadrilateral in the topology.
Definition: topology.hh:272
An abstract class for 3D meshes.
Definition: mesh.hh:112
virtual std::ostream & info(std::ostream &os) const
For output in command line.
A 3D cell: hexahedron.
Definition: cell3D.hh:317
Three dimensional cell.
Definition: cell.hh:112
concepts::Cell3 & operator++(int)
Returns the next element in the scanned set.
Definition: cuboid.hh:62
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.
concepts::Scan3 * clone() const
Definition: cuboid.hh:66
bool eos() const
Definition: cuboid.hh:59
static const uint ncell_
Definition: cuboid.hh:24
uint ncell() const
Get number of Cells.
Definition: cuboid.hh:33
A hexahedron in the topology.
Definition: topology3D.hh:134
A vertex in the topology.
Definition: topology.hh:40
An abstract class for scanning a mesh (a set of cells) or a space (a set of elements).
S(const S &scan)
Definition: cuboid.hh:55
S(concepts::Hexahedron3d *(&cell)[ncell_])
Definition: cuboid.hh:52
concepts::Scan3 * scan()
Scanner over the mesh.
Definition: cuboid.hh:38
Concepts mesh of an cuboid in one hexahedron.
Definition: cuboid.hh:21
Scann 3d.
Definition: cuboid.hh:48
virtual ~Cuboid()
Destructor.
concepts::Vertex * vtx_[8]
Definition: cuboid.hh:71
concepts::Quad * quad_[6]
Definition: cuboid.hh:73
An edge in the topology.
Definition: topology.hh:73
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
concepts::Hexahedron3d * cell_[ncell_]
Definition: cuboid.hh:75
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich