boundary treatment for time domain waves


I am looking into time domain wave simulation with explicit DG methods, say acoustics scattering.
I was wondering how a proper boundary treatment in the farfield could be realized in NGSolve.

As an example, how to modify the demo code
to fit for an unbounded domain? I tried to use PML, but it gives me errors…


the PML implementation in NGSolve can only be used for the time harmonic case.
For PML in time domain you would need to use a formulation like e.g. in

Hi Guosheng,

we just now set up some time-domain PML examples …

Here is a 2D time-domain PML with cartesian PML.

Here is a reference on the method:

best, Joachim


WOW! Thanks, Joachim.
this is perfect. I will look into your code
I was actually planning to implement pml today, following the reference by Atkins…

I am working on time domain wave simulations, it’s very fun! It’s also super easy to code in NGsolve!

Just a follow-up question.
I want to check the accuracy of a pml implementation by comparing the solution with another solution simulated using a larger domain.
Say, how to project/interpolate the solution defined on a larger mesh to the smaller mesh?

Hi Guosheng,

you have two options:

  1. using one mesh, define two different subdomains for the pml, an inner and an outer. setup two problems. then you can compare two fields from the same mesh.

  2. using two different meshes. With gf.Set(…) you can project a field from an independent mesh. But of course, it comes at some price (cost + possibly accuracy). It should also work to integrate a field from an independent mesh.

Best, Joachim

I see… thanks

I have a follow-up question. In some cases, the pml parameter may be complex-valued, can I do this? – I tried to set a complex-valued pml parameter, it produces “netgen.libngpy._meshing.NgException: real Evaluate called for complex ScaleCF”.

Thank you!

This is for a time domain simulation. There is no problem with the time harmonic pml.

I guess you need to make your finite element spaces complex then?
The solution will be complex valued then or not?