Class documentation of Concepts

Loading...
Searching...
No Matches
uniformlyRefinedMesh2.hh
Go to the documentation of this file.
1
8#ifndef uniformlyRefinedMesh2_hh
9#define uniformlyRefinedMesh2_hh
10
11#include "geometry/mesh.hh"
12#include <vector>
13
14namespace concepts {
15
23 public:
32 virtual uint ncell() const { return cell_.size(); }
34 virtual Scan2* scan() { return new S(cell_); }
35 private:
37 class S : public Scan<Cell2> {
38 public:
39 inline S(std::vector<Cell2*>& cell) :
40 idx_(cell.begin()), cell_(cell) {}
41 inline S(const S& scan) : idx_(scan.idx_), cell_(scan.cell_) {}
42 inline bool eos() const { return idx_ == cell_.end(); }
43 inline Cell2& operator++(int) { return *(*idx_++); }
44 inline Scan2* clone() const { return new S(*this); }
45 private:
46 std::vector<Cell2*>::iterator idx_;
47 std::vector<Cell2*>& cell_;
48 };
49 void addCell(Cell2* cell, uint level);
50 std::vector<Cell2*> cell_;
51 };
52
53} // namespace concepts
54
55#endif //uniformlyRefinedMesh2_hh
A scanner for a 2D mesh.
Definition mesh.hh:44
virtual uint ncell() const
Returns the number of cells in the mesh.
virtual Scan2 * scan()
Returns a scanner over the cells of the mesh.
UniformlyRefinedMesh2(Mesh2 &coarseMesh, uint level)
Scan< Cell2 > Scan2
A scanner for a 2D mesh.
Definition mesh.hh:62
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320