pml_formula.hh

Go to the documentation of this file.
1 
14 #ifndef waveprop_pmlformula_hh
15 #define waveprop_pmlformula_hh
16 
17 
18 #include <iostream>
19 #include <memory>
20 #include "stdio.h"
21 #include "basics.hh"
22 #include "formula/formula.hh"
24 #include "geometry/formula.hh"
25 #include "hp2D.hh"
26 
27 #include "pml_edge.hh"
28 
29 #define pmlHolger_D 0
30 
31 namespace concepts {
32 
33 
34  // **************************************************** FormulaPMLPowerSigma **
35 
36  // Sigma for Cartesian PML, see Collino & Monk
37 
38  template<typename F=Real>
39  class FormulaPMLPowerSigma : public Formula<F> {
40  public:
42  , const F sigma0 = 5.0, const Real center=0)
43  : offset_(offset)
44  , center_(center)
45  , power_(power)
46  , sigma0_(sigma0)
47  {}
48 
49  virtual FormulaPMLPowerSigma* clone() const {
51  }
52 
53  bool inPMLregion(const Real p, const Real t = 0.0)
54  {
55  Real arg = fabs(p - center_) - offset_;
56 
57  return arg >= 0;
58  }
59 
60  virtual F operator() (const Real p, const Real t = 0.0) const {
61  Real arg = fabs(p - center_) - offset_;
62  if (arg < 0)
63  return F(0);
64  return sigma0_ * powi(arg , power_);
65  }
66 
67  virtual F operator() (const Real2d& p, const Real t = 0.0) const {
68  return (*this)(p[0], t);
69  }
70 
71  virtual F operator() (const Real3d& p, const Real t = 0.0) const {
72  return (*this)(p[0], t);
73  }
74  template<typename Real>
75  static inline Real powi(Real x, int powercoeff) {
76 #if 1
77  Real res(1);
78  for(int i = 0; i < powercoeff; ++i) {
79  res *= x;
80  }
81  return res;
82 #else
83  return pow(x, powercoeff);
84 #endif
85  }
86  protected:
87  virtual std::ostream& info(std::ostream& os) const {
88  return os << concepts::typeOf(*this)<<"(" << sigma0_ << " * ( |x - (" << center_
89  << ")| - " << offset_ << ")_+^" << power_ << ")))";
90  }
91  private:
92  const Real offset_;
93  const Real center_;
94  const int power_;
95  const F sigma0_; // PML strength
96  };
97 
98  // ************************************************** FormulaPMLPowerSigma2D **
99 
114  template<typename F=Real>
115  class FormulaPMLPowerSigma2D : public Formula<F> {
116  public:
124  FormulaPMLPowerSigma2D(const Real offset, const int power = 2,
125  const F sigma0 = 5.0,
126  const Real2d& center = Real2d(0,0))
128  }
129 
130  virtual FormulaPMLPowerSigma2D* clone() const {
132  }
133 
134  virtual F operator() (const Real p, const Real t = 0.0) const {
135  conceptsThrowSimpleE("FormulaPMLPowerSigma2D currently only supports 2D!");
136  assert(false);
137  }
138 
139  inline bool inPMLregion(const Real2d& p, const Real t = 0.0) const
140  {
141 
142  Real arg = (p-center_).l2() - offset_;
143  return arg >= 0;
144  }
145 
146  virtual F operator() (const Real2d& p, const Real t = 0.0) const {
147  Real dist = (p-center_).l2() - offset_;
148  if (dist < 0)
149  return F(0);
150  return sigma0_ * powi(dist, power_);
151  }
152 
153  virtual F operator() (const Real3d& p, const Real t = 0.0) const {
154  return (*this)( Real2d(p[0], p[1]), t);
155  }
156 
157  template<typename Real>
158  static inline Real powi(Real x, int powercoeff) {
159 #if 1
160  Real res(1);
161  for (int i = 0; i < powercoeff; ++i) {
162  res *= x;
163  }
164  return res;
165 #else
166  return pow(x, powercoeff);
167 #endif
168  }
169  protected:
170  virtual std::ostream& info(std::ostream& os) const{
171  return os << concepts::typeOf(*this)<<"(" << sigma0_ << " * ( |x - (" << center_[0]
172  << "," << center_[1] << ")| - " << offset_ << ")_+^" << power_ << ")))";
173  }
174  private:
176  const Real offset_;
179  // PML exponent
180  const int power_;
181  // PML strength
182  const F sigma0_;
183  };
184 
185  // ************************************************* FormulaPMLPowerSigmaB2D **
186 
203  template<typename F=Real>
204  class FormulaPMLPowerSigmaB2D : public Formula<F> {
205  public:
213  FormulaPMLPowerSigmaB2D(const Real offset, const int power = 2,
214  const F sigma0 = 5.0,
215  const Real2d& center = Real2d(0,0))
217 
218  virtual FormulaPMLPowerSigmaB2D* clone() const {
220  }
221 
222  virtual F operator() (const Real p, const Real t = 0.0) const {
224  ("FormulaPMLPowerSigmaB2D currently only supports 2D!"); assert(false);
225  }
226 
227  inline bool inPMLregion(const Real2d& p, const Real t = 0.0) const
228  {
229  Real arg = (p-center_).l2() - offset_;
230  return arg >= 0;
231  }
232 
233  virtual F operator() (const Real2d& p, const Real t = 0.0) const {
234  Real rho = (p-center_).l2();
235  Real arg = rho - offset_;
236  if (arg<0)
237  return F(0);
238  return sigma0_ * powi( arg , power_ + 1) / (rho) / (power_ + 1);
239  }
240 
241  virtual F operator() (const Real3d& p, const Real t = 0.0) const {
242  return (*this)( Real2d(p[0], p[1]), t);
243  }
244 
245  template<typename Real>
246  static inline Real powi(Real x, int powercoeff) {
247 #if 1
248  Real res(1);
249  for (int i = 0; i < powercoeff; ++i) {
250  res *= x;
251  }
252  return res;
253 #else
254  return pow(x, powercoeff);
255 #endif
256  }
257  protected:
258  virtual std::ostream& info(std::ostream& os) const {
259  return os << concepts::typeOf(*this)<<"(" << sigma0_ << " * ( |x - ("
260  << center_[0] << "," << center_[1] << ")| - "
261  << offset_ << ")_+^" << power_ << ")))";
262  }
263  private:
265  const Real offset_;
268  // PML exponent
269  const int power_;
270  // PML strength
271  const F sigma0_;
272  };
273 
274  // ********************************************************** FomulaPMLCart **
275 
279  class FormulaPMLCart : public ElementFormula<Cmplx> {
280  public:
281  enum PMLMode { DXDX, DYDY, IDENT, DX, DY };
282 
287  , PMLMode mode
288  , double omega
289  )
290  : coeff_a_(coeff_a)
291  , coeff_b_(coeff_b)
292  , sigma_x_(sigma_x)
293  , sigma_y_(sigma_y)
294  , mode_(mode)
295  , omega_(omega)
296  {}
297 
298  virtual FormulaPMLCart* clone() const {
299  return new FormulaPMLCart(*this);
300  }
301 
302  virtual Cmplx operator() (const ElementWithCell< Real > &elm, const Real3d &p, const Real t=0.0) const
303  {
304  Real2d px = elm.elemMap(p);
305  return operator()(elm, p, px, t);
306  }
307  virtual Cmplx operator() (const ElementWithCell< Real > &elm, const Real2d &p, const Real t=0.0) const
308  {
309  Real2d px = elm.elemMap(p);
310  return operator()(elm, p, px, t);
311  }
312  virtual Cmplx operator() (const ElementWithCell< Real > &elm, const Real p, const Real t=0.0) const
313  {
314  Real2d px = elm.elemMap(p);
315  return operator()(elm, p, px, t);
316  }
317 
318  Cmplx gammaX(Real x) const {
319  return Cmplx(1, (*sigma_x_)(x) / omega_);
320  }
321 
322  Cmplx gammaY(Real y) const {
323  return Cmplx(1, (*sigma_y_)(y) / omega_);
324  }
325 
326  template <class RealNd>
327  inline Cmplx operator() (const ElementWithCell< Real > &elm, const RealNd &p, Real2d px,
328  const Real t=0.0) const
329  {
330  switch(mode_) {
331  case DXDX: return gammaY(px[1]) / gammaX(px[0]) * coeff_a_(elm, p);
332  case DX: return gammaY(px[1]) * coeff_a_(elm, p);
333  case DYDY: return gammaX(px[0]) / gammaY(px[1]) * coeff_a_(elm, p);
334  case DY: return gammaX(px[0]) * coeff_a_(elm, p);
335  case IDENT: return gammaX(px[0]) * gammaY(px[1]) * coeff_b_(elm, p);
336  }
337  conceptsThrowSimpleE("FormulaPMLCart has gone mad!"); assert(false);
338  }
339 
340 
341  protected:
342  virtual std::ostream& info(std::ostream& os) const {
343  return os << concepts::typeOf(*this)<<"(coeffs: "
344  << coeff_a_ << ", " << coeff_b_ << ", sigmas:"
345  << *sigma_x_ << ", " << *sigma_y_
346  << ")";
347  }
348  private:
354  double omega_;
355  };
356 
357  // ************************************************ FormulaPMLBoxRestriction **
358 
359  template <class F, typename G = typename Realtype<F>::type>
360  class FormulaPMLBoxRestriction : public ElementFormula<F, G> {
361  public:
366  )
367  : sigma_x(sigma_x)
368  , sigma_y(sigma_y)
369  , formula(formula)
370  { }
371 
372  virtual F operator() (const ElementWithCell< Real > &elm, const Real3d &p, const Real t=0.0) const
373  {
374  Real2d px = elm.elemMap(p);
375  return operator()(elm, p, px, t);
376  }
377 
378  virtual F operator() (const ElementWithCell< Real > &elm, const Real2d &p, const Real t=0.0) const
379  {
380  Real2d px = elm.elemMap(p);
381  return operator()(elm, p, px, t);
382  }
383 
384  virtual F operator() (const ElementWithCell< Real > &elm, const Real p, const Real t=0.0) const
385  {
386  Real2d px = elm.elemMap(p);
387  return operator()(elm, p, px, t);
388  }
389 
390  template <class RealNd>
391  F operator() (const ElementWithCell< Real > &elm, const RealNd &p, Real2d px,
392  const Real t=0.0) const
393  {
394  if ( sigma_x->inPMLregion(px[0], t) || sigma_y->inPMLregion(px[1], t)) {
395  return formula->operator()(elm, p, t);
396  } else {
397  //cout << "out: " << px << p << formula->operator()(elm, p, t) << endl;
398 
399  return F(0);
400  //return formula->operator()(elm, p, t);
401  }
402  }
403 
404  virtual FormulaPMLBoxRestriction* clone() const {
405  return new FormulaPMLBoxRestriction(*this);
406  }
407 
408  protected:
409  virtual std::ostream& info(std::ostream& os) const {
410  return os << concepts::typeOf(*this)<<"(" << formula << " :" << *sigma_x << ", " << sigma_y << ")))";
411  }
412  private:
416  };
417 
418  // ******************************************************** FormulaPMLRadia **
419 
432  class FormulaPMLRadia : public ElementFormula<Cmplx> {
433  public:
434  enum PMLMode { AD1, AD2, AS1, AS2, IDENT};
435 
448  PMLMode mode, const Real2d& center = Real2d(0,0));
449 
450  virtual FormulaPMLRadia* clone() const {
451  return new FormulaPMLRadia(*this);
452  }
453 
455  const Real p, const Real t = 0.0) const;
457  const Real2d &p, const Real t = 0.0) const;
459  const Real3d &p, const Real t = 0.0) const;
460 
461  inline RCP<Formula<Real> > sigma() const { return sigma_; }
462  inline RCP<Formula<Real> > sigmaB() const { return sigmaB_; }
463  protected:
464  virtual std::ostream& info(std::ostream& os) const;
465  private:
474 
475 
479  inline Cmplx gamma_(Real2d &p) const{
480  return Cmplx(1, (*sigma_) (p));
481  }
485  inline Cmplx gammaB_(Real2d &p) const{
486  return Cmplx(1, (*sigmaB_)(p));
487  }
488  };
489 
490  // ******************************************************* RadialPMLFormulas **
491 
498  public:
506  RadialPMLFormulas(const Real offset, const int power = 2,
507  const Real sigma0 = 5.0,
508  const Real2d& center = Real2d(0,0));
509 
515  return A_;
516  }
522  return M_;
523  }
524 
525  inline RCP<Formula<Real> > sigma() const { return M_.sigma(); }
526  inline RCP<Formula<Real> > sigmaB() const { return M_.sigmaB(); }
527  protected:
528  virtual std::ostream& info(std::ostream& os) const;
529  private:
540  };
541 
542 
543 
544 
545  // ******************************************************* new cartesian PML **
546 
553  class FormulaPMLCartNew : public ElementFormula<Cmplx> {
554  public:
555  enum PMLMode { DXDX, DYDY, IDENT, DX, DY , ZERO};
556 
558  RCP<Formula<Real> > sigma_y,
559  PMLMode mode )
560  : sigma_x_(sigma_x),
561  sigma_y_(sigma_y),
562  mode_(mode)
563  {}
564 
565  virtual FormulaPMLCartNew* clone() const {
566  return new FormulaPMLCartNew(*this);
567  }
568 
569  virtual Cmplx operator() (const ElementWithCell< Real > &elm, const Real3d &p, const Real t=0.0) const
570  {
571  Real2d px = elm.elemMap(p);
572  return operator()(elm, p, px, t);
573  }
574  virtual Cmplx operator() (const ElementWithCell< Real > &elm, const Real2d &p, const Real t=0.0) const
575  {
576  Real2d px = elm.elemMap(p);
577  return operator()(elm, p, px, t);
578  }
579  virtual Cmplx operator() (const ElementWithCell< Real > &elm, const Real p, const Real t=0.0) const
580  {
581  Real2d px = elm.elemMap(p);
582  return operator()(elm, p, px, t);
583  }
584 
585  inline RCP<Formula<Real> > sigmax() const { return sigma_x_; }
586  inline RCP<Formula<Real> > sigmay() const { return sigma_y_; }
587 
588  Cmplx gammaX(Real x) const {
589  return Cmplx(1., (*sigma_x_)(x) );
590  }
591 
592  Cmplx gammaY(Real y) const {
593  return Cmplx(1., (*sigma_y_)(y) );
594  }
595 
596  template <class RealNd>
597  inline Cmplx operator() (const ElementWithCell< Real > &elm, const RealNd &p, Real2d px, const Real t=0.0) const
598  {
599  switch(mode_) {
600  case DXDX: return gammaY(px[1]) / gammaX(px[0]);
601  case DX: return gammaY(px[1]) ;
602  case DYDY: return gammaX(px[0]) / gammaY(px[1]) ;
603  case DY: return gammaX(px[0]) ;
604  case ZERO : return 0.0;
605  case IDENT: return gammaX(px[0]) * gammaY(px[1]) ;
606  }
607  conceptsThrowSimpleE("FormulaPMLCart has gone mad!"); assert(false);
608  }
609 
610 
611  protected:
612  virtual std::ostream& info(std::ostream& os) const {
613  return os << concepts::typeOf(*this)<<"( sigma x ="
614  << *sigma_x_ << ", sigma y = " << *sigma_y_
615  << ")";
616  }
617  private:
621 
622  };
623 
629 
630  private:
639 
640  public:
650  CartesianPMLFormulas(const Real offset_x, const Real offset_y,
651  const int power = 2,
652  const Real sigma0 = 5.0,
653  const Real center_x =0,
654  const Real center_y = 0);
655 
660  return A_;
661  }
666  return M_;
667  }
668 
669  inline RCP<Formula<Real> > sigmax() const { return M_.sigmax(); }
670  inline RCP<Formula<Real> > sigmay() const { return M_.sigmay(); }
671 
672  friend std::ostream& operator<<(std::ostream& out, const CartesianPMLFormulas &ca)
673  {
674  return(ca.info(out));
675  }
676 protected:
677  virtual std::ostream& info(std::ostream& os) const;
678  };
679 
680 
681 
682  // *********************************************************** hamburger PML **
687  class FormulaPMLHamburger : public ElementFormula<Cmplx>{
688  public:
689  enum PMLMode {M1, M2, M3, M4, IDENT};
690  private:
693  int power;
701 
703  {
704  // modeCart
705  switch (mode){
706  case M1: return(FormulaPMLCartNew::DXDX);
707  case M2: return(FormulaPMLCartNew::ZERO);
708  case M3: return(FormulaPMLCartNew::ZERO);
709  case M4: return(FormulaPMLCartNew::DYDY);
710  case IDENT: return(FormulaPMLCartNew::IDENT);
711  }
712  return(FormulaPMLCartNew::IDENT);
713  }
715  {
716  // modeRadia
717  switch (mode){
718  case M1: return(FormulaPMLRadia::AD1);
719  case M2: return(FormulaPMLRadia::AS1);
720  case M3: return(FormulaPMLRadia::AS2);
721  case M4: return(FormulaPMLRadia::AD2);
722  case IDENT: return(FormulaPMLRadia::IDENT);
723  }
724  return(FormulaPMLRadia::IDENT);
725  }
726  public:
728  const Real d_,
729  const int power_,
730  const Real sigma0_,
731  const Real center_x_,
732  const Real center_y_,
733  PMLMode mode_)
734  : R(R_),
735  d(d_),
736  power(power_),
737  sigma0(sigma0_),
738  center_x(center_x_),
739  center_y(center_y_),
742  mode(mode_),
743  Cart(
745  makeRCP(new ConstFormula<Real>(0)),
747  RadiaUp(
752  RadiaDown(
757 
758  {
759 
760  }
761 
762  virtual FormulaPMLHamburger* clone() const {
763  return new FormulaPMLHamburger(*this);
764  }
765 
766  virtual Cmplx operator() (const ElementWithCell< Real > &elm, const Real3d &p, const Real t=0.0) const
767  {
768  Real2d px = elm.elemMap(p);
769  return operator()(elm, p, px, t);
770  }
771 
772  virtual Cmplx operator() (const ElementWithCell< Real > &elm, const Real2d &p, const Real t=0.0) const
773  {
774  Real2d px = elm.elemMap(p);
775  return operator()(elm, p, px, t);
776  }
777 
778  virtual Cmplx operator() (const ElementWithCell< Real > &elm, const Real p, const Real t=0.0) const
779  {
780  Real2d px = elm.elemMap(p);
781  return operator()(elm, p, px, t);
782  }
783 
784 
785  template <class RealNd>
786  inline Cmplx operator() (const ElementWithCell< Real > &elm, const RealNd &p, Real2d px, const Real t=0.0) const
787  {
788 
789  // px is the point in global coordinates
790  if (px[1]>d/2.){
791  // Upper "Bread" Part
792  return RadiaUp(elm, p, t);
793  }
794  else if (px[1]< -d/2.){
795  // Lower "Bread" Part
796  return(RadiaDown(elm, p, t));
797  }
798  else {
799  // "Steak" Part
800  return(Cart(elm, p, px, t));
801  }
802  }
803 
804 
805  protected:
806  virtual std::ostream& info(std::ostream& os) const {
807  return os << concepts::typeOf(*this)<<"( sigma x ="
808  << *Cart.sigmax() << ", sigma y = " << *Cart.sigmay()
809  << ", sigma up = "<< *RadiaUp.sigma()
810  << ", sigma down = " << *RadiaDown.sigma() << ")";
811  }
812  };
813 
825 
826  private:
828  int power_;
838 
839  public:
853  const Real d,
854  const int power = 2,
855  const Real sigma0 = 5.0,
856  const Real center_x =0,
857  const Real center_y = 0);
858 
863  return A_;
864  }
869  return M_;
870  }
871 
872 
873 
874  friend std::ostream& operator<<(std::ostream& out, const HamburgerPMLFormulas &ca)
875  {
876  return(ca.info(out));
877  }
878 protected:
879  virtual std::ostream& info(std::ostream& os) const;
880  };
881 
882 
883 } // namespace concepts
884 
885 #endif // waveprop_pmlformula_hh
886 
PMLMode mode
The choosen mode.
Definition: pml_formula.h:927
ElementFormulaContainer< Cmplx > M() const
Returns formula related to the bilinear form .
Definition: pml_formula.hh:868
#define conceptsThrowSimpleE(msg)
Throws a equivalent to conceptsAssert(false, exc)
Definition: exceptions.hh:411
Class for the function for radial PML, see INRIA report of Collino & Monk.
Definition: pml_formula.h:551
FormulaPMLHamburger M_
Formula related to the bilinear form .
Definition: pml_formula.hh:837
Cmplx gammaX(Real x) const
Definition: pml_formula.hh:318
virtual std::ostream & info(std::ostream &os) const
Definition: pml_formula.hh:87
RCP< Formula< Real > > sigmaB() const
Definition: pml_formula.hh:526
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Class for PML in polar coordinates.
Definition: pml_formula.h:834
bool inPMLregion(const Real2d &p, const Real t=0.0) const
Definition: pml_formula.hh:139
RCP< Formula< Real > > sigmay() const
Definition: pml_formula.hh:586
RCP< Formula< Real > > sigmax() const
Definition: pml_formula.hh:585
const ElementFormulaContainer< Cmplx > coeff_b_
Definition: pml_formula.hh:350
RCP< Formula< Real > > sigma() const
Definition: pml_formula.hh:525
FormulaPMLPowerSigma2D(const Real offset, const int power=2, const F sigma0=5.0, const Real2d &center=Real2d(0, 0))
Constructor.
Definition: pml_formula.hh:124
Class for a constant formula.
Definition: constFormula.hh:26
friend std::ostream & operator<<(std::ostream &out, const CartesianPMLFormulas &ca)
Definition: pml_formula.hh:672
ElementFormulaContainer< Cmplx > M() const
Returns formula related to the bilinear form.
Definition: pml_formula.hh:521
RCP< Formula< Real > > sigma() const
Definition: pml_formula.hh:461
RadialPMLFormulas(const Real offset, const int power=2, const Real sigma0=5.0, const Real2d &center=Real2d(0, 0))
Constructor.
virtual F operator()(const Real p, const Real t=0.0) const
Application operator.
Definition: pml_formula.h:509
CartesianPMLFormulas(const Real offset_x, const Real offset_y, const int power=2, const Real sigma0=5.0, const Real center_x=0, const Real center_y=0)
Constructor.
Point< Real, 2 > Real2d
concepts::Real arg(const concepts::Point< concepts::Real, 2 > &p)
Returns the phase angle of a real 2D vector.
RCP< concepts::Formula< Real > > sigmaB
sigma bar function, given in the above article page 2067, the average of sigma
Definition: pml_formula.h:925
ElementFormulaContainer< MapCmplx2d > A() const
Returns formula related to the bilinear form .
Definition: pml_formula.hh:862
Real3d elemMap(const Real coord_local) const
Definition: element.hh:86
virtual Cmplx operator()(const ElementWithCell< Real > &elm, const Real3d &p, const Real t=0.0) const
Definition: pml_formula.hh:569
PMLMode mode_
The choosen mode.
Definition: pml_formula.hh:471
Interface for a formula.
Definition: lform.hh:18
bool inPMLregion(const Real p, const Real t=0.0)
Definition: pml_formula.hh:53
Class for hamburger PML A hamburger PML is divided in three parts one rectangle in the middle region,...
Definition: pml_formula.hh:824
FormulaPMLPowerSigma(const Real offset, const int power=2, const F sigma0=5.0, const Real center=0)
Definition: pml_formula.hh:41
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
FormulaPMLHamburger(const Real R_, const Real d_, const int power_, const Real sigma0_, const Real center_x_, const Real center_y_, PMLMode mode_)
Definition: pml_formula.hh:727
Cmplx gammaB_(Real2d &p) const
Returns the parameter on page 2067 (no equation number) of the above article.
Definition: pml_formula.hh:485
Real2d center_
Center of PML.
Definition: pml_formula.hh:473
virtual FormulaPMLBoxRestriction * clone() const
Virtual constructor.
Definition: pml_formula.hh:404
RCP< ElementFormula< F > > formula
Definition: pml_formula.hh:415
RCP< concepts::ElementFormula< F > > formula
Definition: pml_formula.h:813
virtual FormulaPMLRadia * clone() const
Virtual constructor.
Definition: pml_formula.hh:450
Cmplx gammaY(Real y) const
Definition: pml_formula.hh:592
RCP< const concepts::ElementFormula< Cmplx > > coeff_b
Definition: pml_formula.h:748
Cmplx gammaX(Real x) const
Definition: pml_formula.hh:588
static Real powi(Real x, int powercoeff)
Definition: pml_formula.hh:75
virtual F operator()(const Real p, const Real t=0.0) const
Application operator.
Definition: pml_formula.h:561
RCP< Formula< Real > > sigma_y_
Definition: pml_formula.hh:619
RCP< FormulaPMLPowerSigma< Real > > sigma_y
Definition: pml_formula.hh:414
virtual std::ostream & info(std::ostream &os) const
Definition: pml_formula.hh:258
FormulaPMLPowerSigmaB2D(const Real offset, const int power=2, const F sigma0=5.0, const Real2d &center=Real2d(0, 0))
Constructor.
Definition: pml_formula.hh:213
RCP< concepts::Formula< Real > > sigma
sigma function, which takes the general form of
Definition: pml_formula.h:923
ElementFormulaContainer< MapCmplx2d > A() const
Returns formula related to the bilinear form .
Definition: pml_formula.hh:659
FormulaPMLBoxRestriction(RCP< concepts::FormulaPMLPowerSigma< Real > > sigma_x, RCP< concepts::FormulaPMLPowerSigma< Real > > sigma_y, RCP< concepts::ElementFormula< F, G > > formula)
Definition: pml_formula.h:760
New class for Cartesian PML that gets rid of the equation coefficients in the PML structure.
Definition: pml_formula.hh:553
RCP< concepts::Formula< Real > > sigma_x
Definition: pml_formula.h:749
virtual FormulaPMLHamburger * clone() const
Virtual constructor.
Definition: pml_formula.hh:762
MatrixElementFormula< Cmplx, 2 > A_
Formula related to the bilinear form .
Definition: pml_formula.hh:634
FormulaPMLCart(RCP< const ElementFormula< Cmplx > > coeff_a, RCP< const ElementFormula< Cmplx > > coeff_b, RCP< concepts::Formula< Real > > sigma_x, RCP< concepts::Formula< Real > > sigma_y, PMLMode mode, double omega)
Definition: pml_formula.h:678
friend std::ostream & operator<<(std::ostream &out, const HamburgerPMLFormulas &ca)
Definition: pml_formula.hh:874
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition: pml_formula.hh:806
ElementFormulaContainer< MapCmplx2d > A() const
Returns formula related to the bilinear form.
Definition: pml_formula.hh:514
FormulaPMLRadia M_
Formula related to the bilinear form.
Definition: pml_formula.hh:539
Class for Cartesian PML, see Collino & Monk.
Definition: pml_formula.h:674
static Real powi(Real x, int powercoeff)
Definition: pml_formula.hh:158
virtual Cmplx operator()(const ElementWithCell< Real > &elm, const Real3d &p, const Real t=0.0) const
Definition: pml_formula.h:698
RCP< concepts::FormulaPMLPowerSigma< Real > > sigma_x
Definition: pml_formula.h:811
Interface for a formula defined element by element.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual F operator()(const ElementWithCell< Real > &elm, const Real3d &p, const Real t=0.0) const
Definition: pml_formula.h:770
MatrixElementFormula< Cmplx, 2 > A_
Formula related to the bilinear form .
Definition: pml_formula.hh:833
static Real powi(Real x, int power)
Definition: pml_formula.h:525
FormulaPMLRadia::PMLMode convert_mode_to_radia(FormulaPMLHamburger::PMLMode mode)
Definition: pml_formula.hh:714
FormulaPMLCartNew M_
Formula related to the bilinear form .
Definition: pml_formula.hh:638
RCP< Formula< Real > > sigmaB_
Function .
Definition: pml_formula.hh:469
RCP< FormulaPMLPowerSigma< Real > > sigma_x
Definition: pml_formula.hh:413
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition: pml_formula.hh:612
RCP< Formula< Real > > sigma_x_
Definition: pml_formula.hh:618
virtual Cmplx operator()(const ElementWithCell< Real > &elm, const Real3d &p, const Real t=0.0) const
Definition: pml_formula.hh:766
FormulaPMLCartNew::PMLMode convert_mode_to_cart(FormulaPMLHamburger::PMLMode mode)
Definition: pml_formula.hh:702
Class for Cartesian PML.
Definition: pml_formula.hh:628
std::complex< Real > Cmplx
Type for a complex number. It also depends on the setting of Real.
Definition: typedefs.hh:39
RCP< concepts::FormulaPMLPowerSigma< Real > > sigma_y
Definition: pml_formula.h:812
virtual FormulaPMLCart * clone() const
Virtual constructor.
Definition: pml_formula.hh:298
static Real powi(Real x, int powercoeff)
Definition: pml_formula.hh:246
RCP< T > makeRCP(T *x)
Function to create a RCP which deletes the object when no RCP points on it anymore.
virtual FormulaPMLPowerSigmaB2D * clone() const
Definition: pml_formula.hh:218
Reference-counting pointer.
Definition: bf_iddiv.hh:15
Cmplx gammaY(Real y) const
Definition: pml_formula.hh:322
const ElementFormulaContainer< Cmplx > coeff_a_
Definition: pml_formula.hh:349
RCP< Formula< Real > > sigmaB() const
Definition: pml_formula.hh:462
virtual Cmplx operator()(const ElementWithCell< Real > &elm, const Real3d &p, const Real t=0.0) const
Definition: pml_formula.h:868
bool inPMLregion(const Real2d &p, const Real t=0.0) const
Definition: pml_formula.hh:227
const Real2d center_
Center of circular domain.
Definition: pml_formula.hh:178
FormulaPMLRadia(RCP< Formula< Real > > sigma, RCP< Formula< Real > > sigmaB, PMLMode mode, const Real2d &center=Real2d(0, 0))
Constructor.
MatrixElementFormula< Cmplx, 2 > A_
Formula related to the bilinear form.
Definition: pml_formula.hh:534
virtual FormulaPMLPowerSigma2D * clone() const
Definition: pml_formula.hh:130
virtual FormulaPMLCartNew * clone() const
Virtual constructor.
Definition: pml_formula.hh:565
RCP< const concepts::ElementFormula< Cmplx > > coeff_a
Definition: pml_formula.h:747
const Real offset_
Distance of PML interface to center of circular domain.
Definition: pml_formula.hh:176
RCP< Formula< Real > > sigma_y_
Definition: pml_formula.hh:352
FormulaPMLCartNew(RCP< Formula< Real > > sigma_x, RCP< Formula< Real > > sigma_y, PMLMode mode)
Definition: pml_formula.hh:557
Class for providing the formulas in bilinear forms coming from the PML transformation of the radial P...
Definition: pml_formula.hh:497
RCP< Formula< Real > > sigma_
Function .
Definition: pml_formula.hh:467
ElementFormulaContainer< Cmplx > M() const
Returns formula related to the bilinear form .
Definition: pml_formula.hh:665
RCP< Formula< Real > > sigmax() const
Definition: pml_formula.hh:669
Class for the function for radial PML, see INRIA report of Collino & Monk.
Definition: pml_formula.h:614
HamburgerPMLFormulas(const Real R, const Real d, const int power=2, const Real sigma0=5.0, const Real center_x=0, const Real center_y=0)
Constructor.
RCP< Formula< Real > > sigmay() const
Definition: pml_formula.hh:670
FormulaPMLCart(const ElementFormulaContainer< Cmplx > coeff_a, const ElementFormulaContainer< Cmplx > coeff_b, RCP< Formula< Real > > sigma_x, RCP< Formula< Real > > sigma_y, PMLMode mode, double omega)
Definition: pml_formula.hh:283
FormulaPMLBoxRestriction(RCP< FormulaPMLPowerSigma< Real > > sigma_x, RCP< FormulaPMLPowerSigma< Real > > sigma_y, RCP< ElementFormula< F, G > > formula)
Definition: pml_formula.hh:362
virtual F operator()(const Real p, const Real t=0.0) const
Application operator.
Definition: pml_formula.h:624
FormulaPMLRadia(const ElementFormulaContainer< Cmplx > coeff_a, const ElementFormulaContainer< Cmplx > coeff_b, RCP< concepts::Formula< Real > > sigma, RCP< concepts::Formula< Real > > sigmaB, PMLMode mode, double omega)
Constructor.
Definition: pml_formula.h:849
std::string typeOf(const T &t)
Return the typeid name of a class object.
Definition: output.hh:43
RCP< Formula< Real > > sigma_x_
Definition: pml_formula.hh:351
const Real2d center_
Center of circular domain.
Definition: pml_formula.hh:267
virtual std::ostream & info(std::ostream &os) const
Definition: pml_formula.hh:170
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition: pml_formula.hh:409
Class providing an output operator.
static Real powi(Real x, int power)
Definition: pml_formula.h:649
Cmplx gamma_(Real2d &p) const
Returns the parameter on page 2067 (no equation number) of the above article.
Definition: pml_formula.hh:479
Class providing the formulas for hamburger PML.
Definition: pml_formula.hh:687
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
RCP< concepts::Formula< Real > > sigma_y
Definition: pml_formula.h:750
virtual FormulaPMLPowerSigma * clone() const
Definition: pml_formula.hh:49
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition: pml_formula.hh:342
static Real powi(Real x, int power)
Definition: pml_formula.h:586
const Real offset_
Distance of PML interface to center of circular domain.
Definition: pml_formula.hh:265
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