Class documentation of Concepts

Loading...
Searching...
No Matches
edgeMeshes.hh
Go to the documentation of this file.
1
6#ifndef edgeMeshes_hh
7#define edgeMeshes_hh
8
9#include "toolbox/array.hh"
10#include "toolbox/sequence.hh"
11#include "cell1D.hh"
12#include "elementMaps.hh"
13#include "mesh.hh"
14#include "topology.hh"
15
16namespace concepts {
17
18 // ************************************************************** EdgeMesh **
19
27 class EdgeMesh : public Mesh1 {
28 public:
37 EdgeMesh(const uint n, bool closed,
39 Attribute attrib = Attribute(),
41
47 EdgeMesh(const MappingEdge2d* map, Attribute attrib = Attribute());
48
49 virtual ~EdgeMesh();
50
51 inline uint ncell() const { return ncell_; }
52 inline Scan1* scan() { return new S(&cell_); }
53
54 inline const Sequence<Edge2d*>& cells() const { return cell_; }
55
56 protected:
57 virtual std::ostream& info(std::ostream& os) const;
58
59 const uint n_;
60 uint ncell_;
61
64
67 private:
68 Array<Vertex*> vtx_;
69 Array<Edge*> edg_;
70
72 class S : public Scan<Cell1> {
73 uint idx_;
74 Sequence<Edge2d*>* cell_;
75 public:
76 inline S(Sequence<Edge2d*>* cell) : idx_(0), cell_(cell) {}
77 inline S(const S &scan) : idx_(scan.idx_), cell_(scan.cell_) {}
78
79 inline bool eos() const { return idx_ == cell_->size(); }
80 inline Edge2d& operator++(int) { return *(*cell_)[idx_++]; }
81
82 inline Scan1* clone() const { return new S(*this); }
83 };
84
85 };
86
87 // ********************************************************* CircleBoundary **
88
89 class CircleBoundary : public Mesh1, public InnerOuterBoundary2d {
90 public:
91 CircleBoundary(const Real2d center, const uint n, const Real r,
92 const uint attrib = 0, const Real phi0 = 0);
93 virtual ~CircleBoundary();
94
95 inline uint ncell() const { return ncell_; }
96 inline Scan1* scan() { return new S(&this->outerBoundary_); }
97
98 const Sequence<Edge2d*>& cells() const { return this->outerBoundary_; }
99
100 virtual std::ostream& info(std::ostream& os) const;
101 private:
103 class S : public Scan<Cell1> {
104 uint idx_;
105 Sequence<Edge2d*>* cell_;
106 public:
107 inline S(Sequence<Edge2d*>* cell) : idx_(0),
108 cell_(cell) {}
109 inline S(const S &scan) : idx_(scan.idx_),
110 cell_(scan.cell_) {}
111
112 inline bool eos() const { return idx_ == cell_->size(); }
113 inline Cell1& operator++(int) { return *(*cell_)[idx_++]; }
114
115 inline Scan1* clone() const { return new S(*this); }
116 };
117
118 uint ncell_;
119
120 Array<Vertex*> vtx_;
121 Array<Edge*> edg_;
122 };
123
124 // ********************************************** StraightPeriodicBoundary **
125
127 public:
129 const uint n, const uint attrib = 0);
131
132 inline uint ncell() const { return ncell_; }
133 inline Scan1* scan() { return new S(&this->outerBoundary_); }
134
135 const Sequence<Edge2d*>& cells() const { return this->outerBoundary_; }
136
137 virtual std::ostream& info(std::ostream& os) const;
138 private:
140 class S : public Scan<Cell1> {
141 uint idx_;
142 Sequence<Edge2d*>* cell_;
143 public:
144 inline S(Sequence<Edge2d*>* cell) : idx_(0),
145 cell_(cell) {}
146 inline S(const S &scan) : idx_(scan.idx_),
147 cell_(scan.cell_) {}
148
149 inline bool eos() const { return idx_ == cell_->size(); }
150 inline Cell1& operator++(int) { return *(*cell_)[idx_++]; }
151
152 inline Scan1* clone() const { return new S(*this); }
153 };
154
155 uint ncell_;
156
157 Array<Vertex*> vtx_;
158 Array<Edge*> edg_;
159 };
160
161
162} // namespace concepts
163
164#endif // edgeMeshes_hh
165
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 edgeMeshes.hh:95
EdgeMesh(const MappingEdge2d *map, Attribute attrib=Attribute())
Array< MappingEdge2d * > edges_
Edge parametrisation.
Definition edgeMeshes.hh:63
EdgeMesh(const uint n, bool closed, const Sequence< MappingEdge2d * > &maps, Attribute attrib=Attribute(), Sequence< Attribute > vattrib=Sequence< Attribute >())
Sequence< Edge2d * > cell_
Cells.
Definition edgeMeshes.hh:66
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 edgeMeshes.hh:51
Sequence< Edge2d * > outerBoundary_
Outer boundary given by edges in 2D.
Definition mesh.hh:139
A scanner for a 1D mesh.
Definition mesh.hh:36
uint ncell() const
Returns the number of cells in the mesh.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Scan< Cell1 > Scan1
A scanner for a 1D mesh.
Definition mesh.hh:59
double Real
Definition typedefs.hh:39
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320