pml_mapping_functions.h
Go to the documentation of this file.
1 // LIC// ====================================================================
2 // LIC// This file forms part of oomph-lib, the object-oriented,
3 // LIC// multi-physics finite-element library, available
4 // LIC// at http://www.oomph-lib.org.
5 // LIC//
6 // LIC// Copyright (C) 2006-2022 Matthias Heil and Andrew Hazel
7 // LIC//
8 // LIC// This library is free software; you can redistribute it and/or
9 // LIC// modify it under the terms of the GNU Lesser General Public
10 // LIC// License as published by the Free Software Foundation; either
11 // LIC// version 2.1 of the License, or (at your option) any later version.
12 // LIC//
13 // LIC// This library is distributed in the hope that it will be useful,
14 // LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // LIC// Lesser General Public License for more details.
17 // LIC//
18 // LIC// You should have received a copy of the GNU Lesser General Public
19 // LIC// License along with this library; if not, write to the Free Software
20 // LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 // LIC// 02110-1301 USA.
22 // LIC//
23 // LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24 // LIC//
25 // LIC//====================================================================
26 #ifndef OOMPH_PML_MAPPING_FUNCTIONS_HEADER
27 #define OOMPH_PML_MAPPING_FUNCTIONS_HEADER
28 
29 // Config header generated by autoconfig
30 #ifdef HAVE_CONFIG_H
31 #include <oomph-lib-config.h>
32 #endif
33 
34 #include "complex_matrices.h"
35 #include "oomph_utilities.h"
36 
37 namespace oomph
38 {
39  //
40  //=======================================================================
44  //=======================================================================
45  class PMLMapping
46  {
47  public:
50 
54  virtual std::complex<double> gamma(const double& nu_i,
55  const double& pml_width_i,
56  const double& wavenumber_squared,
57  const double& alpha_shift = 0.0) = 0;
58  };
59 
60  //=======================================================================
64  //=======================================================================
66  {
67  public:
70 
73  std::complex<double> gamma(const double& nu_i,
74  const double& pml_width_i,
75  const double& wavenumber_squared,
76  const double& alpha_shift = 0.0)
77  {
79  return 1.0 + MathematicalConstants::I / sqrt(wavenumber_squared) *
80  (1.0 / std::fabs(pml_width_i - nu_i));
81  }
82  };
83 
84  //=======================================================================
89  //=======================================================================
91  {
92  public:
95 
98  std::complex<double> gamma(const double& nu_i,
99  const double& pml_width_i,
100  const double& wavenumber_squared,
101  const double& alpha_shift = 0.0)
102  {
104  return 1.0 + MathematicalConstants::I / sqrt(wavenumber_squared) *
105  (1.0 / std::fabs(pml_width_i - nu_i) -
106  1.0 / std::fabs(pml_width_i));
107  }
108  };
109 
110 } // namespace oomph
111 
112 #endif
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
Definition: pml_mapping_functions.h:66
BermudezPMLMapping()
Default constructor (empty)
Definition: pml_mapping_functions.h:69
std::complex< double > gamma(const double &nu_i, const double &pml_width_i, const double &wavenumber_squared, const double &alpha_shift=0.0)
Definition: pml_mapping_functions.h:73
Definition: pml_mapping_functions.h:91
ContinuousBermudezPMLMapping()
Default constructor (empty)
Definition: pml_mapping_functions.h:94
std::complex< double > gamma(const double &nu_i, const double &pml_width_i, const double &wavenumber_squared, const double &alpha_shift=0.0)
Definition: pml_mapping_functions.h:98
Definition: pml_mapping_functions.h:46
virtual std::complex< double > gamma(const double &nu_i, const double &pml_width_i, const double &wavenumber_squared, const double &alpha_shift=0.0)=0
PMLMapping()
Default constructor (empty)
Definition: pml_mapping_functions.h:49
Real fabs(const Real &a)
Definition: boostmultiprec.cpp:117
const std::complex< double > I(0.0, 1.0)
The imaginary unit.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10