pml_edge.hh

Go to the documentation of this file.
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 
13 namespace concepts {
14 
15 // ******************************************************** FormulaPMLEdgeRadia **
16 
30 class FormulaPMLEdgeRadia: public ElementFormula<Cmplx> {
31 public:
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 
72  return sigma_;
73  }
75  return sigmaB_;
76  }
77 protected:
78  virtual std::ostream& info(std::ostream& os) const;
79 private:
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 
111 public:
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 
162 protected:
163  virtual std::ostream&
164  info(std::ostream& os) const;
165 private:
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
FormulaPMLEdgeRadia(RCP< Formula< Real > > sigma, RCP< Formula< Real > > sigmaB, Mode mode, const Real2d &center=Real2d(0, 0))
RCP< Formula< Real > > sigma_
Function .
Definition: pml_edge.hh:81
std::unique_ptr< FormulaPMLEdgeRadia > _rot_U_rot_V_formula_
Definition: pml_edge.hh:167
Cmplx gamma_(Real2d &p) const
Returns the parameter on page 2067 (no equation number) of the above article.
Definition: pml_edge.hh:92
std::unique_ptr< MatrixElementFormula< Cmplx, 2 > > _U_V_formula_
Definition: pml_edge.hh:169
RadialPML_2D(const Real offset, const int power=2, const Real sigma0=5.0, const Real2d &center=Real2d(0, 0))
Constructor.
Real2d center_
Center of PML.
Definition: pml_edge.hh:87
Point< Real, 2 > Real2d
ElementFormulaContainer< MapCmplx2d > getVectorIdentityFormula() const
Returns formula related to the bilinear form.
Definition: pml_edge.hh:142
std::unique_ptr< MatrixElementFormula< Cmplx, 2 > > _grad_u_V_formula_
Definition: pml_edge.hh:170
Class for radial PML in polar coordinates.
Definition: pml_edge.hh:30
Mode mode_
The choosen mode.
Definition: pml_edge.hh:85
ElementFormulaContainer< MapCmplx2d > getLaplaceFormula() const
Returns formula related to the bilinear form.
Definition: pml_edge.hh:150
std::unique_ptr< FormulaPMLEdgeRadia > _u_v_formula_
Definition: pml_edge.hh:166
std::unique_ptr< MatrixElementFormula< Cmplx, 2 > > _grad_u_grad_v_formula_
Definition: pml_edge.hh:168
Interface for a formula defined element by element.
virtual Cmplx operator()(const ElementWithCell< Real > &elm, const Real2d &p, const Real t=0.0) const
virtual FormulaPMLEdgeRadia * clone() const
Virtual constructor.
Definition: pml_edge.hh:60
std::complex< Real > Cmplx
Type for a complex number. It also depends on the setting of Real.
Definition: typedefs.hh:39
RCP< Formula< Real > > sigmaB() const
Definition: pml_edge.hh:74
RCP< Formula< Real > > sigma() const
Definition: pml_edge.hh:71
Reference-counting pointer.
Definition: bf_iddiv.hh:15
ElementFormulaContainer< Cmplx > getIdentityFormula() const
Returns formula related to the bilinear form.
Definition: pml_edge.hh:126
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
ElementFormulaContainer< MapCmplx2d > getGraduvFormula() const
Returns formula related to the bilinear form.
Definition: pml_edge.hh:158
Class for providing the formulas in bilinear forms coming from the PML transformation of the radial P...
Definition: pml_edge.hh:110
Cmplx gammaB_(Real2d &p) const
Returns the parameter on page 2067 (no equation number) of the above article.
Definition: pml_edge.hh:98
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
RCP< Formula< Real > > sigmaB_
Function .
Definition: pml_edge.hh:83
virtual Cmplx operator()(const ElementWithCell< Real > &elm, const Real3d &p, const Real t=0.0) const
ElementFormulaContainer< Cmplx > getRotRotFormula() const
Returns formula related to the bilinear form.
Definition: pml_edge.hh:134
Class providing an output operator.
virtual Cmplx operator()(const ElementWithCell< Real > &elm, const Real p, const Real t=0.0) const
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