# Locally-Conformal Perfectly Matched Layer implementation

**URL:** <https://fenicsproject.discourse.group/t/locally-conformal-perfectly-matched-layer-implementation/11635>\
**Category:** General\
**Created:** [June 28, 2023, 5:05pm UTC](https://fenicsproject.discourse.group/t/locally-conformal-perfectly-matched-layer-implementation/11635 "2023-06-28T17:05:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bay\_swiss](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/bay_swiss/32/8778_2.png) [@bay\_swiss](https://fenicsproject.discourse.group/u/bay_swiss)\
**Post date:** [June 28, 2023, 5:05pm UTC](https://fenicsproject.discourse.group/t/locally-conformal-perfectly-matched-layer-implementation/11635/1 "2023-06-28T17:05:58Z")

</div>

After presenting it at the FENICS2023 conference, I am sharing the updated version of the LC-PML.

The tool has been calibrated (I finally switched to an hyperbolic absorption function \sigma, way more accurate at low frequencies) and validated. You will find a demo that solves the helmholtz equation in a given domain (step file) with a monopole-like source in a point and a microphone in another one.  
The demo calls the actual code, available in autogen\_LC\_PML.py.  
I commented the code in the best way possible, hoping that you will understand all the steps.

You can find the code at the following link:

[https://github.com/bayswiss/autogen\_LC\_PML](https://github.com/bayswiss/autogen_LC_PML)

For more information about the underlying mathematics and the details of the code, please refer to my article:

[https://undabit.com/locally-conformal-perfectly-matched-layer-implementation-in-fenicsx](https://undabit.com/locally-conformal-perfectly-matched-layer-implementation-in-fenicsx)

Disclaimer: the tool was created with acoustics in mind, but it can easily be implemented in other wave problems.

Have fun!

Antonio
