Skip to content

Commit 9c0e00c

Browse files
committed
refine fenics sections
1 parent c87a40a commit 9c0e00c

File tree

1 file changed

+27
-30
lines changed

1 file changed

+27
-30
lines changed

docs/software/cae/fenics.md

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
[FEniCS](https://fenicsproject.org/) is a popular open-source computing platform for solving partial differential equations (PDEs) using the finite element method ([FEM](https://en.wikipedia.org/wiki/Finite_element_method)). Originally developed in 2003, the earlier version is now known as legacy FEniCS. In 2020, the next-generation framework [FEniCSx](https://docs.fenicsproject.org/) was introduced, with the latest stable [release v0.9.0](https://fenicsproject.org/blog/v0.9.0/) in October 2024. Though it builds on the legacy FEniCS but introduces significant improvements over the legacy libraries. FEniCSx is composed of the following libraries that support typical workflows: [UFL](https://github.com/FEniCS/ufl) → [FFCx](https://github.com/FEniCS/ffcx) → [Basix](https://github.com/FEniCS/basix) → [DOLFINx](https://github.com/FEniCS/dolfinx), which are the build blocks of it. And new users are encouraged to adopt [FEniCSx](https://fenicsproject.org/documentation/) for its modern features and active development support.
66

7-
8-
(Maybe add a short intro into the stack the software depends on, and further more the internal dependencies UFL->FFCx ...)
9-
10-
11-
12-
137
FEniCSx can be installed on [ULHPC](https://www.uni.lu/research-en/core-facilities/hpc/) systems using [Easybuild](https://docs.easybuild.io) or [Spack](https://spack.io/), Below are detailed instructions for each method,
148

159
<!-- Intro end -->
@@ -27,47 +21,50 @@ Building FEniCSx with Spack on the [ULHPC](https://www.uni.lu/research-en/core-f
2721
Create and Activate a Spack Environment:
2822

2923
To maintain an isolated installation, create a dedicated Spack environment in a chosen directory.
30-
The following example builds FEniCSx in the `home` directory:
24+
The following example sets up a stable release of FEniCSx `v0.9.0` in the `fenicsx-test` directory inside the `home` directory:
3125

3226
cd ~
33-
spack env create -d fenicsx-0.9.0/
34-
spack env activate fenicsx-0.9.0/
27+
spack env create -d fenicsx-test/
28+
spack env activate fenicsx-test/
29+
3530

3631

3732
Add the core FEniCSx components and common dependencies:
3833

3934
spack add [email protected]+petsc4py fenics-dolfinx+adios2+petsc adios2+python petsc+mumps
4035

41-
# Change @0.9.0 to any version in the above if you want a another version.
42-
spack concretize
43-
spack install -j16
44-
45-
46-
!!! question " why concretize and -j16 ? "
36+
!!! Additional
4737

48-
`spack concretize` resolves all dependencies and selects compatible versions for the specified packages. `-j16` sets the number cores to use for building. Using a higher number can speed up the build but should be chosen based on available CPU cores and cluster policies.
38+
The spack `add command` add abstract specs of packages to the currently active environment and registers them as root `specs` in the environment’s `spack.yaml` file. Alternatively, packages can be predefined directly in the `spack.yaml` file located in`$SPACK_ENV`.
4939

40+
spack:
41+
# add package specs to the `specs` list
42+
specs:
43+
- [email protected]+petsc4py
44+
- fenics-dolfinx+adios2+petsc
45+
- petsc+mumps
46+
- adios2+python
5047

48+
view: true
49+
concretizer:
50+
unify: true
51+
!!! note
52+
Replace `@0.9.0` with a different version if you prefer to install others release.
5153

52-
or its also possible to define build packages in `$SPACK_ENV` in a `spack.yaml` file.
53-
54-
spack:
55-
# add package specs to the `specs` list
56-
specs:
57-
- [email protected]+petsc4py
58-
- fenics-dolfinx+adios2+petsc
59-
- petsc+mumps
60-
- adios2+python
61-
62-
view: true
63-
concretizer:
64-
unify: true
6554

66-
!!! question " why unify : true ? "
55+
??? question " why unify : true ? "
6756

6857
`unify: true` ensures all packages share the same dependency versions, preventing multiple builds of the same library. Without it, each `spec` could resolve dependencies independently, leading to potential conflicts and redundant installations.
6958

59+
Once Packages `specs` have been added to the current environment, they need to be concretized.
60+
61+
spack concretize
62+
spack install -j16
63+
64+
!!! note
7065

66+
Here, [`spack concretize`](https://spack.readthedocs.io/en/latest/environments.html#spec-concretization) resolves all dependencies and selects compatible versions for the specified packages. In addition to adding individual specs to an environment, the `spack install` command installs the entire environment at once and `-j16` option sets the number of CPU cores used for building, which can speed up the installation.
67+
Once installed, the FEniCSx environment is ready to use on the cluster.
7168

7269
The following are also common dependencies used in FEniCS scripts:
7370

0 commit comments

Comments
 (0)