Welcome to the ddfem tutorial (for version 1.0)
ddfem is a Python package that simplifies the transformation of a wide range of PDEs using the Diffuse Domain Method. While the original PDE will often be defined on a complex domain, after the transformation it can be solved on simple e.g. square domain. The original geometry is embedded in the simpler domain using a phase-field function representation. We provide implementations for different versions of the Diffuse Domain Method making it easy to compare and chose the most suitable version for the problem at hand. Adding new versions is also straightforward. Furthermore, we provide a new approach to combine multiple boundary conditions of different types on distinct boundary segments.
A detailed description of the diffuse domain method and of this package is provided in a preprint. All the experiments described there can be run using the ddm_experiments.py and the paper.sh scripts in the subfolder experiments.
We have designed the package to have a wide compatibility with existing finite element solvers, as all transformations are performed using the Unified Form Language, UFL and do not require any other external packages.
While not required, we recommend using Dune-Fem as it enables some optimisations for form compiling, and can improve the mesh by utilising the different grid views. We have used this package to test the package and for all examples used throughout this tutorial.
Table of Content
Introduction
Geometry subpackage
Transformers subpackage
Utilities for boundary treatment