Class documentation of Concepts

Loading...
Searching...
No Matches
hpMethod.hh
Go to the documentation of this file.
1
6#ifndef hpMethod_hh
7#define hpMethod_hh
8
9#include <cstring>
10#include "basics/level.hh"
11#include "toolbox/array.hh"
12#include "space.hh"
13#include "postProcess.hh"
14
15namespace concepts {
16
17 // ****************************************************** AdaptiveControlP **
18
27 template<int dim, class F = uint>
28 struct AdaptiveControlP : public AdaptiveControl<F> {
30 ushort p_[dim];
31
35 std::memset(p_, 0, dim*sizeof(ushort));
36 }
37
38 bool operator!=(const AdaptiveControlP<dim,F>& a) { return this != &a; }
39
40 std::ostream& info(std::ostream& os) const;
41 };
42
43 template<int dim, class F>
44 std::ostream& operator<<(std::ostream& os, const AdaptiveControlP<dim, F>& a)
45 {
46 return a.info(os);
47 }
48
49 // ******************************************************* AdaptiveAdjustP **
50
58 template<int dim>
59 class AdaptiveAdjustP : public AdaptiveAdjust<dim> {
60 public:
64 short p_[dim];
65
70 std::memset(p_, 0, dim*sizeof(short));
71 }
76 AdaptiveAdjustP(short l, int* p) :
77 AdaptiveAdjust<dim>(l) {
78 for (int i = 0; i < dim; ++i) p_[i] = p[i];
79 }
84 AdaptiveAdjustP(short l, const int p) :
85 AdaptiveAdjust<dim>(l) {
86 for (int i = 0; i < dim; ++i) p_[i] = p;
87 }
92 AdaptiveAdjustP(short l, const Array<int> p) :
93 AdaptiveAdjust<dim>(l) {
94 conceptsAssert(p.size() == dim, Assertion());
95 for (int i = 0; i < dim; ++i) p_[i] = p[i];
96 }
101 AdaptiveAdjustP(const Level<dim>& l, const int p) {
102 this->level_ = l;
103 for (int i = 0; i < dim; ++i) p_[i] = p;
104 }
109 AdaptiveAdjustP(const Level<dim>& l, const int* p) {
110 this->level_ = l;
111 for (int i = 0; i < dim; ++i) p_[i] = p[i];
112 }
118 conceptsAssert(p.size() == dim, Assertion());
119 this->level_ = l;
120 for (int i = 0; i < dim; ++i) p_[i] = p[i];
121 }
122
123 AdaptiveAdjustP<dim>& operator=(const AdaptiveAdjustP<dim>& a);
124
125 std::ostream& info(std::ostream& os) const;
126 };
127
128 template<int dim>
129 std::ostream& operator<<(std::ostream& os, const AdaptiveAdjustP<dim>& a) {
130 return a.info(os);
131 }
132
133 // *********************************************************** HRefinement **
134
144 template<typename F, int dim>
145 class HRefinement : public CellPostprocess<F> {
146 public:
151 virtual void operator() (const Element<F>& elm);
152 virtual void operator() (const Cell& cell) {}
153 protected:
154 virtual std::ostream& info(std::ostream& os) const;
155 private:
158 };
159
160 // *********************************************************** PRefinement **
161
171 template<typename F, int dim>
172 class PRefinement : public CellPostprocess<F> {
173 public:
178 virtual void operator() (const Element<F>& elm);
179 virtual void operator() (const Cell& cell) {}
180 protected:
181 virtual std::ostream& info(std::ostream& os) const;
182 private:
185 };
186
187} // namespace concepts
188
189#endif // hpMethod_hh
AdaptiveAdjustP(const Level< dim > &l, const Array< int > p)
Definition hpMethod.hh:117
AdaptiveAdjustP(const Level< dim > &l, const int p)
Definition hpMethod.hh:101
AdaptiveAdjustP(const Level< dim > &l, const int *p)
Definition hpMethod.hh:109
AdaptiveAdjustP(short l, const int p)
Definition hpMethod.hh:84
AdaptiveAdjustP(short l, const Array< int > p)
Definition hpMethod.hh:92
AdaptiveAdjustP(short l, int *p)
Definition hpMethod.hh:76
Level< levelDim > level_
Level in several dimensions.
Definition space.hh:308
uint size() const
Returns the requested size of the array.
Definition array.hh:259
HRefinement(AdaptiveSpace< F, AdaptiveAdjustP< dim > > &spc)
Definition hpMethod.hh:150
virtual void operator()(const Element< F > &elm)
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
PRefinement(AdaptiveSpace< F, AdaptiveAdjustP< dim > > &spc)
Definition hpMethod.hh:177
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual void operator()(const Element< F > &elm)
#define conceptsAssert(cond, exc)
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320
unsigned short ushort
Abbreviation for unsigned short.
Definition typedefs.hh:51
ushort p_[dim]
Polynomial degree.
Definition hpMethod.hh:30