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 
12 namespace 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_;
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 
60  class RelativeCells : public OutputOperator {
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;
86 
88  void rebuildCells();
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
const Connector * cntr_
std::map< const Connector *, const Connector * > parents_
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.
A quadrilateral in the topology.
Definition: topology.hh:272
std::map< const Connector *, uint > childNo_
Point< Real, dim > p_
virtual PointInCell< tdim > operator()(const PointInCell< sdim > P) const =0
bool quadParent_(const Quad *cntr, const Real2d xi, uint i, Real2d &Txi) const
bool parent(const PointInCell< 2 > P, PointInCell< 2 > &T) const
Parent connector and associate point.
Define a point inside a geometrical cell by its connector and the coordinate in the reference cell.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
concepts::Sequence< const Connector * > cells_
List of lowest level cells.
RelativeCells(std::vector< const Connector * > cells)
Constructor.
Sequence with operations, output operator, and method of the particular element types.
Definition: sequence.hh:39
bool child(const PointInCell< 2 > P, PointInCell< 2 > &T) const
Child connector and associate point.
bool quadChild_(const Quad *cntr, const Real2d xi, PointInCell< 2 > &P) const
Class which holds information about the mesh hierarchy and how the point in the reference cell change...
PointInCell< 2 > finestCell(const PointInCell< 2 > P) const
const Connector * cntr_
bool edgeChild_(const Edge *cntr, const Real2d xi, PointInCell< 2 > &P) const
bool edgeParent_(const Edge *cntr, const Real2d xi, uint i, Real2d &Txi) const
void rebuildCells()
Rebuild the list of lowest level cells.
PointInCell< 2 > coarsestCell(const PointInCell< 2 > P) const
std::string typeOf(const T &t)
Return the typeid name of a class object.
Definition: output.hh:43
An edge in the topology.
Definition: topology.hh:73
Class providing an output operator.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
An abstract class for elements of the topology.
Definition: connector.hh:85
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich