circle.hh

Go to the documentation of this file.
1 
6 #ifndef circle_hh
7 #define circle_hh
8 
9 #include "toolbox/array.hh"
10 #include "toolbox/sequence.hh"
11 #include "cell1D.hh"
12 #include "cell2D.hh"
13 #include "mesh.hh"
14 
15 namespace concepts {
16 
17  // **************************************************************** Circle **
18 
47  class Circle : public Mesh2withBoundary {
48  public:
60  Circle(const Real r = 1.0, const Real ratio = 0.5,
61  const Real innerRadius = 0.0);
71  Circle(const Array<Real> rings, const Real ratio = 0.5,
72  const Real innerRadius = 0.0);
84  Circle(const Array<Real> rings,
85  const Array<uint> ringAttrib,
86  const Real ratio = 0.5, const Real innerRadius = 0.0);
100  Circle(const Array<Real> rings,
101  const Array<uint> ringAttrib, const Array<uint> ringEdgeAttrib,
102  const Real ratio = 0.5, const Real innerRadius = 0.0);
108  Circle(const Real innerRadius, const Array<Real> rings);
119  Circle(const Real innerRadius, const Array<Real> rings,
120  const Array<uint> ringAttrib);
121 
131  Circle(const Real2d center, const Real r, const uint n,
132  const Attribute attrib = 0, const Real phi0 = 0,
133  const Attribute edgAttr = 0);
134 
148  Circle(const Real2d center, const Real innerRadius,
149  const Real outerRadius, const uint n,
150  const Attribute attrib = 0, const Real phi0 = 0);
151 
152  virtual ~Circle();
153 
154  inline uint ncell() const { return ncell_; }
155  inline Scan2* scan() { return new S(&cell_); }
156 
157  virtual std::ostream& info(std::ostream& os) const;
158  private:
160  class S : public Scan<Cell2> {
161  uint idx_;
163  public:
164  inline S(Array<Quad2d*>* cell) : idx_(0),
165  cell_(cell) {}
166  inline S(const S &scan) : idx_(scan.idx_),
167  cell_(scan.cell_) {}
168 
169  inline bool eos() const { return idx_ == cell_->size(); }
170  inline Cell2& operator++(int) { return *(*cell_)[idx_++]; }
171 
172  inline Scan2* clone() const { return new S(*this); }
173  };
174  uint ncell_;
175 
179 
182 
185 
190  Real2d point_(const uint n, const Real r) const;
199  void construct_(const Array<Real> rings, const Real ratio,
200  const Real innerRadius,
201  const std::map<uint, uint>* const attrib = 0,
202  const std::map<uint, uint>* const edgeAttrib = 0,
203  const bool hole = false);
204  };
205 
206 
207 } // namespace concepts
208 
209 #endif // circle_hh
Scan2 * scan()
Returns a scanner over the cells of the mesh.
Definition: circle.hh:155
Circle(const Real2d center, const Real innerRadius, const Real outerRadius, const uint n, const Attribute attrib=0, const Real phi0=0)
V3 constructor for circular sheet with uniform subdivision.
Array< Quad * > quad_
Definition: circle.hh:178
S(const S &scan)
Definition: circle.hh:166
Circle(const Array< Real > rings, const Array< uint > ringAttrib, const Real ratio=0.5, const Real innerRadius=0.0)
V1 constructor for circle and rings around.
Array< Vertex * > vtx_
Definition: circle.hh:176
uint ncell() const
Returns the number of cells in the mesh.
Definition: circle.hh:154
Circle(const Array< Real > rings, const Real ratio=0.5, const Real innerRadius=0.0)
V1 constructor for circle and rings around.
A scanner for a 2D mesh.
Definition: mesh.hh:44
void construct_(const Array< Real > rings, const Real ratio, const Real innerRadius, const std::map< uint, uint > *const attrib=0, const std::map< uint, uint > *const edgeAttrib=0, const bool hole=false)
For variant V1: Constructs the rings.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Circle(const Real innerRadius, const Array< Real > rings, const Array< uint > ringAttrib)
V1 constructor for circle and rings with hole in the middle.
Cell2 & operator++(int)
Returns the next cell.
Definition: circle.hh:170
Array< Quad2d * > cell_
Cells.
Definition: circle.hh:184
Array< Quad2d * > * cell_
Definition: circle.hh:162
Base class for mesh classes in 2D which defines its outer boundary and inner boundaries.
Definition: mesh.hh:152
Circle(const Array< Real > rings, const Array< uint > ringAttrib, const Array< uint > ringEdgeAttrib, const Real ratio=0.5, const Real innerRadius=0.0)
V1 constructor for circle and rings around.
Circle(const Real2d center, const Real r, const uint n, const Attribute attrib=0, const Real phi0=0, const Attribute edgAttr=0)
V2 constructor for circle with uniform subdivision.
virtual ~Circle()
bool eos() const
Definition: circle.hh:169
An abstract class for scanning a mesh (a set of cells) or a space (a set of elements).
Array< CircleMappingEdge2d * > edges_
Edge parametrisation.
Definition: circle.hh:181
Real2d point_(const uint n, const Real r) const
For variant V1: Coordinates of a point in direction x, y, -x or y with distance r from 0.
Two dimensional cell.
Definition: cell.hh:89
Circle(const Real innerRadius, const Array< Real > rings)
V1 constructor for circle and rings with hole in the middle.
Scan2 * clone() const
Definition: circle.hh:172
Mesh for a circle.
Definition: circle.hh:47
Circle(const Real r=1.0, const Real ratio=0.5, const Real innerRadius=0.0)
V1 constructor for circle with 5 cells.
S(Array< Quad2d * > *cell)
Definition: circle.hh:164
scanner over the cells
Definition: circle.hh:160
Attributes for elements of the topology.
Definition: connector.hh:22
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Array< Edge * > edg_
Definition: circle.hh:177
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich