Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

phiFEM: a convenience package for using $\varphi$-FEM with FEniCSx

This package provides convenience tools that help with the implementation of $\varphi$-FEM schemes in the FEniCSx computation platform.

$\varphi$-FEM (or phiFEM) is an immersed boundary finite element method leveraging levelset functions to avoid the use of any non-standard finite element spaces or non-standard quadrature rules near the boundary of the domain. More information about $\varphi$-FEM can be found in the various publications (see e.g. 1 and 2).

phiFEM Pypi webpage

Dependencies

See phifem-env.yml.

⚠️ Note that all these dependencies (except phifem) are already included in dolfinx Docker container.

Installation

Pixi environment

  • Given the pixi.lock file in the source directory, create and run a phifem Pixi environment via:
    pixi shell
    

Conda environment

  • Create a phifem Conda environment from the spec file phifem-env.yml:
    conda create -f phifem-env.yml
    
  • Activate the phifem environment:
    conda activate phifem
    

Docker container

The phiFEM package can be used inside the dolfinx container (e.g. ghcr.io/fenics/dolfinx/dolfinx:stable)

  • Launch the dolfinx container in interactive mode using, e.g. Docker (see the docker documentation for the meaning of the different arguments):
    docker run -ti -v $(pwd):/home/dolfinx/shared -w /home/dolfinx/shared dolfinx/dolfinx:stable
    
  • Inside the container install phiFEM via pip:
    pip install phifem
    

Usage

See here.

Run the demos

The demos can be found on the phiFEM Github repository. To run the demos first clone the repository.

Inside the Docker container/Conda environment:

  • Install the demos dependencies:

    XXX install polars Pyaml
    

    with XXX=pip in the Docker container and XXX=conda in the conda environment.

  • Navigate the demo directory and run it e.g.:

    cd demo/weak-dirichlet/flower
    python main.py bg
    

⚠️ The demo files require arguments, for more info run python main.py -h.

Run the tests

Inside the Docker container/Conda environment:

  • Install pytest:

    XXX install pytest
    

    with XXX=pip in the Docker container and XXX=conda in the Conda environment.

  • Run the tests:

    cd tests
    pytest
    

Disclaimer

The author Raphaël Bulle guarantees that his contributions to this project are generative-ai-free.

For more information, see here (in french).

License

phiFEM is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with phiFEM. If not, see http://www.gnu.org/licenses/.

Logo credit

Frédérique Lecourtier (https://mimesis.inria.fr/members/frederique-lecourtier/)

  1. M. DUPREZ and A. LOZINSKI, $\varphi$-FEM: A finite element method on domains defined by level-sets, SIAM J. Numer. Anal., 58 (2020), pp. 1008-1028, https://epubs.siam.org/doi/10.1137/19m1248947 ↩

  2. S. COTIN, M. DUPREZ, V. LLERAS, A. LOZINSKI, and K. VUILLEMOT, $\varphi$-FEM: An efficient simulation tool using simple meshes for problems in structure mechanics and heat transfer, Partition of Unity Methods, (2023), pp. 191-216, https://www.semanticscholar.org/paper/%CF%86-FEM%3A-an-efficient-simulation-tool-using-simple-in-Cotin-Duprez/82f2015ac98f66af115ae57f020b0b1a45c46ad0. ↩

Metadata

Release files for phiFEM 0.7.2.dev2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for phiFEM 0.7.2.dev2
File Size Uploaded
phifem-0.7.2.dev2.tar.gz 2.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for phiFEM 0.7.2.dev2
File Interpreter ABI Platform
phifem-0.7.2.dev2-py3-none-any.whl Python 3 none any Details

Total release size: 2.3 MB

Release files / phifem-0.7.2.dev2.tar.gz

Download URL phifem-0.7.2.dev2.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
8b5fae0d5a80a9d298fd01f4b2e6557b8aa9aab3c66a18a2c517ae780584aa11
BLAKE2b-256 checksum
How to use checksums
721cd18dd8af94b999d5edb176d50c9d0c1331db51a3d5132ec6f9f20c8ee15a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release files / phifem-0.7.2.dev2-py3-none-any.whl

Download URL phifem-0.7.2.dev2-py3-none-any.whl
Size 25.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a91cea0eb0aeb3749af617ca21bd176dab88da70942c9f236f4f33c740d96e7
BLAKE2b-256 checksum
How to use checksums
a8babc583c36be7474f79af43470c3d49fe7280d54fba56eca17600c92e60966
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page