Toggle navigation
Documentation
Big picture
The finite element method
The data structure
Not-so-quick guide
Optimisation
Order of action functions
Example codes and tutorials
List of example codes and tutorials
Meshing
Solvers
MPI parallel processing
Post-processing/visualisation
Other
Change log
Creating documentation
Coding conventions
Index
FAQ
Installation
Installation guide
Copyright
About
People
Contact/Get involved
Publications
Acknowledgements
Picture show
Go
src
generic
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-2023 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
//=======================================================================
41
/// Class to hold the mapping function (gamma) for the Pml which defines
42
/// how the coordinates are transformed in the Pml. This class holds
43
/// the one dimensional or uniaxial case which is the most common
44
//=======================================================================
45
class
PMLMapping
46
{
47
public
:
48
/// Default constructor (empty)
49
PMLMapping
(){};
50
51
/// Pure virtual to return Pml mapping gamma, where gamma is the
52
/// \f$d\tilde x / d x\f$ as function of \f$\nu\f$ where \f$\nu = x - h\f$
53
/// where h is the vector from the origin to the start of the Pml
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
//=======================================================================
61
/// A mapping function propsed by Bermudez et al, appears to be the best
62
/// for the Helmholtz equations and so this will be the default mapping
63
/// (see definition of PmlHelmholtzEquations)
64
//=======================================================================
65
class
BermudezPMLMapping
:
public
PMLMapping
66
{
67
public
:
68
/// Default constructor (empty)
69
BermudezPMLMapping
(){};
70
71
/// Overwrite the pure Pml mapping coefficient function to return the
72
/// coeffcients proposed by Bermudez et al
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
{
78
/// return \f$\gamma=1 + (1/k)(i/|outer_boundary - x|)\f$
79
return
1.0 +
MathematicalConstants::I
/ sqrt(wavenumber_squared) *
80
(1.0 / std::fabs(pml_width_i - nu_i));
81
}
82
};
83
84
//=======================================================================
85
/// A mapping function proposed by Bermudez et al, similar to the one above
86
/// but is continuous across the inner Pml boundary
87
/// appears to be the best for TimeHarmonicLinearElasticity
88
/// and so this will be the default mapping
89
//=======================================================================
90
class
ContinuousBermudezPMLMapping
:
public
PMLMapping
91
{
92
public
:
93
/// Default constructor (empty)
94
ContinuousBermudezPMLMapping
(){};
95
96
/// Overwrite the pure Pml mapping coefficient function to return the
97
/// coeffcients proposed by Bermudez et al
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
{
103
/// return \f$\gamma=1 + (i/k)(1/|outer_boundary - x|-1/|pml width|)\f$
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
oomph::BermudezPMLMapping
A mapping function propsed by Bermudez et al, appears to be the best for the Helmholtz equations and ...
Definition:
pml_mapping_functions.h:66
oomph::BermudezPMLMapping::BermudezPMLMapping
BermudezPMLMapping()
Default constructor (empty)
Definition:
pml_mapping_functions.h:69
oomph::BermudezPMLMapping::gamma
std::complex< double > gamma(const double &nu_i, const double &pml_width_i, const double &wavenumber_squared, const double &alpha_shift=0.0)
Overwrite the pure Pml mapping coefficient function to return the coeffcients proposed by Bermudez et...
Definition:
pml_mapping_functions.h:73
oomph::ContinuousBermudezPMLMapping
A mapping function proposed by Bermudez et al, similar to the one above but is continuous across the ...
Definition:
pml_mapping_functions.h:91
oomph::ContinuousBermudezPMLMapping::ContinuousBermudezPMLMapping
ContinuousBermudezPMLMapping()
Default constructor (empty)
Definition:
pml_mapping_functions.h:94
oomph::ContinuousBermudezPMLMapping::gamma
std::complex< double > gamma(const double &nu_i, const double &pml_width_i, const double &wavenumber_squared, const double &alpha_shift=0.0)
Overwrite the pure Pml mapping coefficient function to return the coeffcients proposed by Bermudez et...
Definition:
pml_mapping_functions.h:98
oomph::PMLMapping
Class to hold the mapping function (gamma) for the Pml which defines how the coordinates are transfor...
Definition:
pml_mapping_functions.h:46
oomph::PMLMapping::gamma
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
Pure virtual to return Pml mapping gamma, where gamma is the as function of where where h is the v...
oomph::PMLMapping::PMLMapping
PMLMapping()
Default constructor (empty)
Definition:
pml_mapping_functions.h:49
complex_matrices.h
oomph::MathematicalConstants::I
const std::complex< double > I(0.0, 1.0)
The imaginary unit.
oomph
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Definition:
advection_diffusion_elements.cc:30
oomph_utilities.h