meshInfo.hh

Go to the documentation of this file.
1 
6 #ifndef dgMeshInfo_hh
7 #define dgMeshInfo_hh
8 
9 #include "edgeInfo.hh"
10 
11 // forward declaration
12 namespace concepts {
13  class Mesh2;
14 }
15 
16 namespace linDG2D {
17 
25  class MeshInfo {
26  public:
33  Scanner* scan() const { return new S(edgeInfos_); }
35  const EdgeInfo& edgeInfo(const concepts::Edge& edge) const {
36  return edgeInfos_.find(edge.key())->second;
37  }
38  private:
40  class S : public Scanner {
41  public:
42  inline S(const std::unordered_map<uint, EdgeInfo>& edgeInfos) :
43  idx_(edgeInfos.begin()), edgeInfos_(edgeInfos) {}
44  inline S(const S& scan) : idx_(scan.idx_), edgeInfos_(scan.edgeInfos_) {}
45  inline bool eos() const { return idx_ == edgeInfos_.end(); }
46  inline EdgeInfo& operator++(int) {
47  return const_cast<EdgeInfo&>((*idx_++).second);
48  }
49  inline S* clone() const { return new S(*this); }
50  private:
51  std::unordered_map<uint, EdgeInfo>::const_iterator idx_;
52  const std::unordered_map<uint, EdgeInfo>& edgeInfos_;
53  };
55  std::unordered_map<uint, EdgeInfo> edgeInfos_;
56  };
57 
58 } // namespace linDG2D
59 
60 #endif // dgMeshInfo_hh
MeshInfo(concepts::Mesh2 &mesh)
Constructor.
const std::unordered_map< uint, EdgeInfo > & edgeInfos_
Definition: meshInfo.hh:52
std::unordered_map< uint, EdgeInfo >::const_iterator idx_
Definition: meshInfo.hh:51
DG FEM for 2D problems using piecewise linear shape functions.
Definition: bilinearForm.hh:15
Mesh info about edges for DG FEM in 2D.
Definition: meshInfo.hh:25
Edge information for DG FEM.
Definition: edgeInfo.hh:31
Scanner * scan() const
scanner over EdgeInfo objects
Definition: meshInfo.hh:33
const Key & key() const
Returns the key of the connector.
Definition: connector.hh:105
std::unordered_map< uint, EdgeInfo > edgeInfos_
List of edge information objects.
Definition: meshInfo.hh:55
S(const S &scan)
Definition: meshInfo.hh:44
concepts::Scan< EdgeInfo > Scanner
Definition: meshInfo.hh:27
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
EdgeInfo & operator++(int)
Returns the next element in the scanned set.
Definition: meshInfo.hh:46
const EdgeInfo & edgeInfo(const concepts::Edge &edge) const
Returns the edge info object built up for edge edge.
Definition: meshInfo.hh:35
S(const std::unordered_map< uint, EdgeInfo > &edgeInfos)
Definition: meshInfo.hh:42
An edge in the topology.
Definition: topology.hh:73
S * clone() const
Returns a clone of the scanner.
Definition: meshInfo.hh:49
bool eos() const
Returns true if the end of the scanned set is reached.
Definition: meshInfo.hh:45
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Scanner class for MeshInfo.
Definition: meshInfo.hh:40
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich