edgeMinMax.hh

Go to the documentation of this file.
1 
8 #ifndef hp2DedgeMinMax_hh
9 #define hp2DedgeMinMax_hh
10 
11 #include "basics/outputOperator.hh"
12 #include "basics/cloneable.hh"
13 
14 namespace hp2D {
15 
16  // ********************************************************** PolyEdgeRule **
17 
23  public concepts::Cloneable {
24  public:
25  virtual PolyEdgeRule* clone() const = 0;
29  virtual void pUnderChildren(ushort& p, ushort pChild) const = 0;
33  virtual void pFromChildren(ushort& p, ushort pChild) const {
34  p = std::min(p, pChild); // seems to be equal as
35  }
39  virtual void pEdge(ushort& p, ushort pEdge) const = 0;
40  protected:
41  virtual std::ostream& info(std::ostream& os) const {
42  return os << concepts::typeOf(*this)<<"()";
43  }
44  };
45 
46 
47  // *********************************************************** PolyEdgeMax **
48 
53  class PolyEdgeMax : public PolyEdgeRule {
54  public:
55  virtual PolyEdgeMax* clone() const { return new PolyEdgeMax(); }
59  virtual void pUnderChildren(ushort& p, ushort pChild) const {
60  p = std::max(p, pChild);
61  }
65  virtual void pFromChildren(ushort& p, ushort pChild) const {
66  p = std::max(p, pChild);
67  }
71  virtual void pEdge(ushort& p, ushort pInner) const {
72  p = std::max(p, pInner);
73  }
74  protected:
75  virtual std::ostream& info(std::ostream& os) const {
76  return os << concepts::typeOf(*this)<<"()";
77  }
78  };
79 
80  // *********************************************************** PolyEdgeMin **
81 
86  class PolyEdgeMin : public PolyEdgeRule {
87  public:
88  virtual PolyEdgeMin* clone() const { return new PolyEdgeMin(); }
92  virtual void pUnderChildren(ushort& p, ushort pChild) const {
93  p = std::min(p, pChild);
94  }
98  virtual void pEdge(ushort& p, ushort pInner) const {
99  p = std::min(p, pInner);
100  }
101  protected:
102  virtual std::ostream& info(std::ostream& os) const {
103  return os << concepts::typeOf(*this)<<"()";
104  }
105  };
106 
107  // ********************************************** PolyEdgeMinNeighMaxChild **
108 
115  public:
116  virtual PolyEdgeMinNeighMaxChild* clone() const {
117  return new PolyEdgeMinNeighMaxChild(); }
121  virtual void pUnderChildren(ushort& p, ushort pChild) const {
122  p = std::max(p, pChild);
123  }
127  virtual void pEdge(ushort& p, ushort pInner) const {
128  p = std::min(p, pInner);
129  }
130  protected:
131  virtual std::ostream& info(std::ostream& os) const {
132  return os << concepts::typeOf(*this)<<"()";
133  }
134  };
135 
136 } // namespace hp2D
137 
138 #endif // hp2DedgeMinMax_hh
virtual void pUnderChildren(ushort &p, ushort pChild) const
Adapt common polynomial degree of children of an edge p according to a polynomial degree on a child \...
Definition: edgeMinMax.hh:59
virtual void pEdge(ushort &p, ushort pInner) const
Adapt polynomial degree on an edge p according to the value on the.
Definition: edgeMinMax.hh:98
virtual PolyEdgeMin * clone() const
Virtual constructor.
Definition: edgeMinMax.hh:88
virtual PolyEdgeMinNeighMaxChild * clone() const
Virtual constructor.
Definition: edgeMinMax.hh:116
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition: edgeMinMax.hh:75
Edge gets maximal polynomial degree of adjacent cells.
Definition: edgeMinMax.hh:53
virtual void pUnderChildren(ushort &p, ushort pChild) const
Adapt common polynomial degree of children of an edge p according to a polynomial degree on a child \...
Definition: edgeMinMax.hh:121
virtual PolyEdgeRule * clone() const =0
Virtual constructor.
virtual void pEdge(ushort &p, ushort pEdge) const =0
Adapt polynomial degree on an edge p according to the value on the.
2D hp-FEM for H1-conforming elements.
virtual void pFromChildren(ushort &p, ushort pChild) const
Adapt polynomial degree on edge depending in polynomial degree on a child.
Definition: edgeMinMax.hh:33
virtual void pEdge(ushort &p, ushort pInner) const
Adapt polynomial degree on an edge p according to the value on the.
Definition: edgeMinMax.hh:71
virtual PolyEdgeMax * clone() const
Virtual constructor.
Definition: edgeMinMax.hh:55
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition: edgeMinMax.hh:131
Cloneable interface.
Definition: cloneable.hh:16
virtual void pFromChildren(ushort &p, ushort pChild) const
Adapt polynomial degree on edge depending in polynomial degree on a child.
Definition: edgeMinMax.hh:65
virtual void pUnderChildren(ushort &p, ushort pChild) const =0
Adapt common polynomial degree of children of an edge p according to a polynomial degree on a child \...
F min(const concepts::Array< F > &a)
Returns the minimal value in array a.
Definition: arrayOp.hh:67
virtual void pUnderChildren(ushort &p, ushort pChild) const
Adapt common polynomial degree of children of an edge p according to a polynomial degree on a child \...
Definition: edgeMinMax.hh:92
First the maximum polynomial degree of both sides of the edge is choosen.
Definition: edgeMinMax.hh:114
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition: edgeMinMax.hh:41
unsigned short ushort
Abbreviation for unsigned short.
Definition: typedefs.hh:48
Base class for rules for polynomial degrees of edges.
Definition: edgeMinMax.hh:23
std::string typeOf(const T &t)
Return the typeid name of a class object.
Definition: output.hh:43
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition: edgeMinMax.hh:102
Class providing an output operator.
Edge gets minimum of the polynomial degrees of the adjacent cells.
Definition: edgeMinMax.hh:86
virtual void pEdge(ushort &p, ushort pInner) const
Adapt polynomial degree on an edge p according to the value on the.
Definition: edgeMinMax.hh:127
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich