# Diffuse Domain Finite Element Methods

[ddfem][0] 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.

The geometry subpackage provides several simple signed distance functions (SDF),
and operators to allow an easy definition of the complex domain.

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][2] and do not require any other external packages. 

While not required, we recommend using [Dune-Fem][1]
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.

## Getting started

How to install the package using `pip` is discussed in our [tutorial][4].

Enjoy - and let us know of any [issues][3] you encountered 

[0]: https://ddfem.readthedocs.io/en/latest/index.html
[1]: https://www.dune-project.org/modules/dune-fem/
[2]: https://github.com/FEniCS/ufl
[3]: https://gitlab.dune-project.org/dune-fem/ddfem/-/issues
[4]: https://ddfem.readthedocs.io/en/latest/installation.html
