Class documentation of Concepts

Loading...
Searching...
No Matches
meshRelations.hh
Go to the documentation of this file.
1
6#ifndef meshRelations_hh
7#define meshRelations_hh
8
9#include "toolbox/sequence.hh"
10#include "topology.hh"
11
12namespace concepts {
13
14 // *********************************************************** PointInCell **
15
21 template<uint dim = 2>
22 class PointInCell : public OutputOperator {
23 public:
24 const Connector* cntr_;
26 protected:
27 virtual std::ostream& info(std::ostream& os) const;
28 };
29
30 template<>
31 class PointInCell<1> : public OutputOperator {
32 public:
33 const Connector* cntr_;
34 Real p_;
35 protected:
36 virtual std::ostream& info(std::ostream& os) const;
37 };
38
39 // ***************************************************** CellToCellMapping **
40
41 template<uint sdim = 2, uint tdim = 2>
43 public:
44 virtual PointInCell<tdim> operator()(const PointInCell<sdim> P) const = 0;
45 protected:
46 virtual std::ostream& info(std::ostream& os) const {
47 return os << concepts::typeOf(*this)<< "()";
48 }
49 };
50
51 // ********************************************************* RelativeCells **
52
61 public:
66 RelativeCells(std::vector<const Connector*> cells);
67
75 bool child (const PointInCell<2> P, PointInCell<2>& T) const;
83 bool parent(const PointInCell<2> P, PointInCell<2>& T) const;
84 PointInCell<2> finestCell (const PointInCell<2> P) const;
85 PointInCell<2> coarsestCell(const PointInCell<2> P) const;
86
89 protected:
90 virtual std::ostream& info(std::ostream& os) const {
91 return os << concepts::typeOf(*this)<< "()";
92 }
93 private:
96
97 // mapping to the parent connector
98 mutable std::map<const Connector*, const Connector*> parents_;
99 // which child number has the connector inside the parent connector
100 mutable std::map<const Connector*, uint> childNo_;
101
102 bool edgeChild_(const Edge* cntr, const Real2d xi, PointInCell<2>& P) const;
103
104 bool quadChild_(const Quad* cntr, const Real2d xi, PointInCell<2>& P) const;
105
106 bool edgeParent_(const Edge* cntr, const Real2d xi, uint i,
107 Real2d& Txi) const;
108
109 bool quadParent_(const Quad* cntr, const Real2d xi, uint i,
110 Real2d& Txi) const;
111 };
112
113
114} // namespace concepts
115
116
117#endif // meshRelations_hh
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
bool parent(const PointInCell< 2 > P, PointInCell< 2 > &T) const
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
bool child(const PointInCell< 2 > P, PointInCell< 2 > &T) const
RelativeCells(std::vector< const Connector * > cells)
void rebuildCells()
Rebuild the list of lowest level cells.
std::string typeOf(const T &t)
Definition output.hh:43
double Real
Definition typedefs.hh:39
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320