infiniteMeshes.hh

Go to the documentation of this file.
1 
6 #ifndef infMeshes_hh
7 #define infMeshes_hh
8 
9 #include "basics/typedefs.hh"
10 #include "mesh.hh"
11 #include "topology.hh"
12 #include "cell2D.hh"
13 
14 namespace concepts {
15 
16  // ************************************************** SquareTwoInfiniteRects **
17 
27  class SquareTwoInfiniteRects : public Mesh2 {
28  private:
29  class S : public Scan<Cell2> {
30  unsigned int idx_;
31  Cell2 *(&cell_)[3];
32  public:
33  inline S(Cell2 *(&cell)[3]) : idx_(0), cell_(cell) {}
34  inline S(const S& scan) : idx_(scan.idx_), cell_(scan.cell_) {}
35  inline bool eos() const { return idx_ == 3; }
36  inline Cell2& operator++(int) { return *cell_[idx_++]; }
37  inline Scan2* clone() const { return new S(*this); }
38  };
39 
40  Vertex *vtx_ [4];
41  Edge *edg_ [4];
43  Quad *quad_ [1];
45  Cell2 *cell_ [3];
46  bool periodic_;
47  public:
48  SquareTwoInfiniteRects(bool periodic = false);
50  inline unsigned int ncell() const { return 3; }
51  inline Scan2* scan() { return new S(cell_); }
52  virtual std::ostream& info(std::ostream& os) const;
53  };
54 
55  // *************************************************** SquareOneInfiniteRect **
56 
71  class SquareOneInfiniteRect : public Mesh2 {
72  private:
73  class S : public Scan<Cell2> {
74  unsigned int idx_;
75  Cell2 *(&cell_)[2];
76  public:
77  inline S(Cell2 *(&cell)[2]) : idx_(0), cell_(cell) {}
78  inline S(const S& scan) : idx_(scan.idx_), cell_(scan.cell_) {}
79  inline bool eos() const { return idx_ == 2; }
80  inline Cell2& operator++(int) { return *cell_[idx_++]; }
81  inline Scan2* clone() const { return new S(*this); }
82  };
83 
84  Vertex *vtx_ [4];
85  Edge *edg_ [4];
87  Quad *quad_ [1];
89  Cell2 *cell_ [2];
90  bool periodic_;
91  public:
92  SquareOneInfiniteRect(bool periodic = false);
94  inline unsigned int ncell() const { return 2; }
95  inline Scan2* scan() { return new S(cell_); }
96  virtual std::ostream& info(std::ostream& os) const;
97  };
98 
99 } // namespace concepts
100 
101 #endif // infMeshes_hh
102 
Mesh consisting of three cells, one Quad2d and two InfiniteRect2d.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
A infinite quadrilateral in the topology, which possess one Edge and two InfiniteEdges since one edge...
Definition: topology.hh:423
A quadrilateral in the topology.
Definition: topology.hh:272
SquareOneInfiniteRect(bool periodic=false)
A scanner for a 2D mesh.
Definition: mesh.hh:44
unsigned int ncell() const
Returns the number of cells in the mesh.
unsigned int ncell() const
Returns the number of cells in the mesh.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Cell2 & operator++(int)
Returns the next cell.
Mesh consisting of two cells, one Quad2d and one InfiniteRect2d.
Cell2 & operator++(int)
Returns the next cell.
A vertex in the topology.
Definition: topology.hh:40
An infinite edge in the topology, which possess only one vertex as the other lies in the infinite.
Definition: topology.hh:143
An abstract class for scanning a mesh (a set of cells) or a space (a set of elements).
An abstract class for 2D meshes.
Definition: mesh.hh:103
SquareTwoInfiniteRects(bool periodic=false)
Two dimensional cell.
Definition: cell.hh:89
Scan2 * scan()
Returns a scanner over the cells of the mesh.
An edge in the topology.
Definition: topology.hh:73
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Scan2 * scan()
Returns a scanner over the cells of the mesh.
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich