Perfectly Matched Layers¶
Perfectly Matched Layers are now implemented in NGSolve via a complex mesh deformation. All pre-implemented PMLs are of the form
where \(d(x)\) is some distance function and \(\alpha\) is the scaling parameter.
Creating a PML Transformation¶
A PML transformation is a mesh independent object, which can be created using its
generator function defined in the python module
Base PML object
can only be created by generator functions. Use PML(x, [y, z]) to evaluate the scaling.
the determinant of the jacobian as coefficient function
the inverse of the jacobian as coefficient function
the jacobian of the PML as coefficient function
the scaling as coefficient function
call_jacobian(*args) → ngsolve.bla.MatrixC¶
evaluate PML jacobian at point x, [y, z]
The following scalings are available by default:
Radial(origin: object, rad: float=1, alpha: complex=1j) → ngsolve.comp.pml.PML¶
radial pml transformation
origin is a list/tuple determining the dimenson
Cartesian(mins: object, maxs: object, alpha: complex=1j) → ngsolve.comp.pml.PML¶
cartesian pml transformation
mins and maxs are tuples/lists determining the dimension
BrickRadial(mins: object, maxs: object, origin: object=(0.0, 0.0, 0.0), alpha: complex=1j) → ngsolve.comp.pml.PML¶
radial pml on a brick
mins, maxs and origin are given as tuples/lists
HalfSpace(point: object, normal: object, alpha: complex=1j) → ngsolve.comp.pml.PML¶
half space pml
scales orthogonal to specified plane in direction of normal point and normal are given as tuples/lists determining the dimension
Creating your own scaling¶
Aside from the pre-implemented scalings, one can also create scalings using coefficient functions or combine available PMLs.
Custom(trafo: ngsolve.fem.CoefficientFunction, jac: ngsolve.fem.CoefficientFunction) → ngsolve.comp.pml.PML¶
custom pml transformation
trafo and jac are coefficient functions of the scaling and the jacobian
Compound(pml1: ngsolve.comp.pml.PML, pml2: ngsolve.comp.pml.PML, dims1: object=<ngsolve.ngstd.DummyArgument>, dims2: object=<ngsolve.ngstd.DummyArgument>) → ngsolve.comp.pml.PML¶
tensor product of two pml transformationsdimensions are optional, given as tuples/lists and start with 1
PML transformations can be added using the
Applying the Transformation to a Mesh¶
A PML object
pmlobj can be applied to a mesh
m on domain
After this is done all (symbolic) integrators will respect the additional complex transformation. Note that right now PMLs are tested on H1 spaces only.
Evaluating coordinate coefficient functions on complex mapped integration points will result only in evaluation of their real part. Thus, using non constant coefficient functions in the PML domain should be handled with caution.