Class documentation of Concepts

Loading...
Searching...
No Matches
pml_edge.hh
1#ifndef waveprop_pml_edge_hh
2#define waveprop_pml_edge_hh
3
4#include <iostream>
5#include <memory>
6#include "stdio.h"
7#include "basics.hh"
8#include "formula/formula.hh"
10#include "geometry/formula.hh"
11#include "hp2D.hh"
12
13namespace concepts {
14
15// ******************************************************** FormulaPMLEdgeRadia **
16
30class FormulaPMLEdgeRadia: public ElementFormula<Cmplx> {
31public:
32 enum class Mode
33 : int {
34 A11,
35 A22,
36 A12,
37 A21,
38 M11,
39 M22,
40 M12,
41 M21,
42 N11,
43 N22,
44 N12,
45 N21,
46 IDENT,
47 ROTROT
48 };
49
58 Mode mode, const Real2d& center = Real2d(0, 0));
59
60 virtual FormulaPMLEdgeRadia* clone() const {
61 return new FormulaPMLEdgeRadia(*this);
62 }
63
64 virtual Cmplx operator()(const ElementWithCell<Real> &elm, const Real p,
65 const Real t = 0.0) const;
66 virtual Cmplx operator()(const ElementWithCell<Real> &elm, const Real2d &p,
67 const Real t = 0.0) const;
68 virtual Cmplx operator()(const ElementWithCell<Real> &elm, const Real3d &p,
69 const Real t = 0.0) const;
70
71 RCP<Formula<Real> > sigma() const {
72 return sigma_;
73 }
74 RCP<Formula<Real> > sigmaB() const {
75 return sigmaB_;
76 }
77protected:
78 virtual std::ostream& info(std::ostream& os) const;
79private:
81 RCP<Formula<Real> > sigma_;
83 RCP<Formula<Real> > sigmaB_;
85 Mode mode_;
87 Real2d center_;
88
92 Cmplx gamma_(Real2d &p) const {
93 return Cmplx(1, (*sigma_)(p));
94 }
98 Cmplx gammaB_(Real2d &p) const {
99 return Cmplx(1, (*sigmaB_)(p));
100 }
101};
102
103// ******************************************************* RadialPML_2D **
104
111public:
119 RadialPML_2D(const Real offset, const int power = 2,
120 const Real sigma0 = 5.0, const Real2d& center = Real2d(0, 0));
121
127 return *_u_v_formula_;
128 }
129
135 return *_rot_U_rot_V_formula_;
136 }
137
143 return *_U_V_formula_;
144 }
145
151 return *_grad_u_grad_v_formula_;
152 }
153
159 return *_grad_u_V_formula_;
160 }
161
162protected:
163 virtual std::ostream&
164 info(std::ostream& os) const;
165private:
166 std::unique_ptr<FormulaPMLEdgeRadia> _u_v_formula_;
167 std::unique_ptr<FormulaPMLEdgeRadia> _rot_U_rot_V_formula_;
168 std::unique_ptr<MatrixElementFormula<Cmplx, 2> > _grad_u_grad_v_formula_;
169 std::unique_ptr<MatrixElementFormula<Cmplx, 2> > _U_V_formula_;
170 std::unique_ptr<MatrixElementFormula<Cmplx, 2> > _grad_u_V_formula_;
171};
172
173} // namespace concepts
174
175#endif // waveprop_pml_edge_hh
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual FormulaPMLEdgeRadia * clone() const
Virtual copy constructor.
Definition pml_edge.hh:60
ElementFormulaContainer< MapCmplx2d > getLaplaceFormula() const
Definition pml_edge.hh:150
ElementFormulaContainer< MapCmplx2d > getVectorIdentityFormula() const
Definition pml_edge.hh:142
ElementFormulaContainer< Cmplx > getIdentityFormula() const
Definition pml_edge.hh:126
ElementFormulaContainer< Cmplx > getRotRotFormula() const
Definition pml_edge.hh:134
ElementFormulaContainer< MapCmplx2d > getGraduvFormula() const
Definition pml_edge.hh:158
RadialPML_2D(const Real offset, const int power=2, const Real sigma0=5.0, const Real2d &center=Real2d(0, 0))
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
double Real
Definition typedefs.hh:39
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320
std::complex< Real > Cmplx
Type for a complex number. It also depends on the setting of Real.
Definition typedefs.hh:42