meshConverter.hh

Go to the documentation of this file.
1 
7 #ifndef meshConverter2D_hh
8 #define meshConverter2D_hh
9 
10 #include <list>
11 #include "mesh.hh"
12 #include "cell2D.hh"
13 
14 namespace concepts {
15 
16  // ****************************************************** ConvertMeshQuads **
17 
35  class ConvertMeshQuads : public Mesh2 {
36  public:
42  ConvertMeshQuads(Mesh2& m, const uint level);
44 
45  virtual uint ncell() const { return quadList_.size(); }
46  virtual Scan2* scan() { return new S(quadList_); }
47  protected:
48  virtual std::ostream& info(std::ostream& os) const;
49  private:
59  std::list<Quad2d*> quadList_;
62 
64  class S : public Scan2 {
65  public:
66  S(std::list<Quad2d*>& cell) :
67  idx_(cell.begin()), cell_(cell) {}
68  S(const S& scan) : idx_(scan.idx_), cell_(scan.cell_) {}
69  bool eos() const { return idx_ == cell_.end(); }
70  Quad2d& operator++(int) { return *(*idx_++); }
71  Scan2* clone() const { return new S(*this); }
72  private:
73  std::list<Quad2d*>::iterator idx_;
74  std::list<Quad2d*>& cell_;
75  };
76 
78  void convertCell_(Cell2& c, const uint level);
79  void deleteStuff_();
80  };
81 
82 } // namespace concepts
83 
84 #endif // meshConverter2D_hh
bool hasQuads
Checks for a mixed mesh.
Joiner< Quad2d *, 1 > * newQuadList_
List of new quads.
ConvertMeshQuads(Mesh2 &m, const uint level)
Constructor.
virtual uint ncell() const
Returns the number of cells in the mesh.
A 2D cell: quadrilateral.
Definition: cell2D.hh:378
S(std::list< Quad2d * > &cell)
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Joiner class with multiple successors, i.e.
A scanner for a 2D mesh.
Definition: mesh.hh:44
std::list< Quad2d * > & cell_
std::list< Quad2d * >::iterator idx_
virtual Scan2 * scan()
Returns a scanner over the cells of the mesh.
Mesh2 & m_
Original mesh.
An abstract class for 2D meshes.
Definition: mesh.hh:103
void convertCell_(Cell2 &c, const uint level)
Handles a cell if it is on the correct level, otherwise, recurses.
Two dimensional cell.
Definition: cell.hh:89
Scanner class for ConvertMeshQuads.
Joiner< Vertex *, 1 > * vertexList_
List of new vertices (centers of gravity of the triangles)
Quad2d & operator++(int)
Returns the next cell.
std::list< Quad2d * > quadList_
List of quads in the new mesh.
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Joiner< Edge *, 1 > * edgeList_
List of new edges.
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich