Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
3701531
move old examples to separate folder
FrederikSchnack Nov 21, 2025
0096b01
move performance scripts to examples folder
FrederikSchnack Nov 21, 2025
a584de5
Merge branch 'devel' into new_examples
FrederikSchnack Nov 21, 2025
1b28d0c
Merge branch 'devel' into new_examples
FrederikSchnack Nov 25, 2025
7c75c0e
try nbsphinx
FrederikSchnack Nov 25, 2025
f5dc200
copy notebooks into docs by CI
FrederikSchnack Nov 25, 2025
a6dbd86
also install pandoc
FrederikSchnack Nov 25, 2025
06559fe
install pandoc globally
FrederikSchnack Nov 25, 2025
6bb798d
clear notebook output
FrederikSchnack Nov 25, 2025
33a5a65
install psydac in doc ci
FrederikSchnack Nov 25, 2025
cad20f8
remove metadata using nb-clean
FrederikSchnack Nov 25, 2025
36d672a
change cp folder
FrederikSchnack Nov 25, 2025
ebd1195
fix error in notebook and test ipytest
FrederikSchnack Nov 25, 2025
9866070
remove failing test from notebook
FrederikSchnack Nov 25, 2025
c4b08e2
make the notebook tests a little nicer
FrederikSchnack Nov 25, 2025
bff0fed
Merge branch 'devel' into new_examples
FrederikSchnack Nov 27, 2025
44e6760
remove performance folder from header script
FrederikSchnack Nov 27, 2025
f00c89c
add test to Helmholtz notebook
FrederikSchnack Nov 27, 2025
97fe8bc
add notebook with example of L2 fem projection
campospinto Nov 28, 2025
859ff0e
Merge branch 'devel' into new_examples
FrederikSchnack Nov 28, 2025
e4fc59d
added the case of a vector-valued space
campospinto Nov 28, 2025
cbc527a
test transparency in docs logo
FrederikSchnack Dec 1, 2025
ce6ce7b
enable github annotations in doc
FrederikSchnack Dec 1, 2025
4316045
don't specify parser
FrederikSchnack Dec 1, 2025
c783976
add new notebook; change md to rst files
FrederikSchnack Dec 1, 2025
b835af6
rm md files
FrederikSchnack Dec 1, 2025
f4ab560
update links in README to documentation
FrederikSchnack Dec 1, 2025
89dd5d8
move files out of psydac/feec/multipatch
FrederikSchnack Dec 2, 2025
a053c7b
add Poisson and curl-curl EV example
FrederikSchnack Dec 2, 2025
15fd156
rename md so it shows up on github
FrederikSchnack Dec 2, 2025
ae18af6
add time-harmonic Maxwell
FrederikSchnack Dec 2, 2025
de75920
fix td example
FrederikSchnack Dec 3, 2025
31a4703
finish multipatch examples
FrederikSchnack Dec 3, 2025
ffaf555
add examples to test workflow
FrederikSchnack Dec 3, 2025
580c524
purge feec/multipatch
FrederikSchnack Dec 3, 2025
afbd14c
update feec doc
FrederikSchnack Dec 3, 2025
6035e9a
fix broken imports
FrederikSchnack Dec 3, 2025
c002659
remove feec.multipatch from script
FrederikSchnack Dec 3, 2025
799c757
remove failing example testing
FrederikSchnack Dec 3, 2025
34620f8
move script and add examples test
FrederikSchnack Dec 4, 2025
1131dc1
add example 3D VTK positive Helmholtz
e-moral-sanchez Dec 4, 2025
bd0043b
clear output cells
e-moral-sanchez Dec 4, 2025
7d7610f
nb-clean and put new notebook in docs
FrederikSchnack Dec 4, 2025
0d9ef72
add petsc notebook
e-moral-sanchez Dec 5, 2025
c343e45
add curl-curl ev notebook
FrederikSchnack Dec 5, 2025
3ba04e7
add time-harmonic example
FrederikSchnack Dec 5, 2025
6770814
update notebook
FrederikSchnack Dec 5, 2025
dd955d2
update typos
FrederikSchnack Dec 5, 2025
fc698ba
update fem L2 proj example notebook
campospinto Dec 11, 2025
d0bbcec
Update PETSc version in installation docs
yguclu Dec 11, 2025
02a0ddb
update fem L2 proj notebook
campospinto Dec 11, 2025
931bed5
minor cleaning on fem L2 proj notebook
campospinto Dec 11, 2025
2c65add
delete plt.show
e-moral-sanchez Dec 12, 2025
8100732
rephrase sentence for callable source
e-moral-sanchez Dec 12, 2025
eb19a23
rename examples, remark mu positive
e-moral-sanchez Dec 12, 2025
71dcf10
forgot update list names
e-moral-sanchez Dec 12, 2025
68a75ca
delete unneeded files, fix rename vtk files
e-moral-sanchez Dec 12, 2025
a8f50ac
Merge branch 'devel' into new_examples
yguclu Dec 13, 2025
cfa5c19
Use docs/requirements.txt for pip caching
yguclu Dec 13, 2025
c41fce0
update curlcurl title and remove static plot, but plot it for docs
FrederikSchnack Dec 16, 2025
e047fb5
Merge branch 'devel' into new_examples
campospinto Dec 17, 2025
2416ce6
add vector_potential notebook, delete old example
jowezarek Dec 23, 2025
849dd0d
move cp from CI to makefile
FrederikSchnack Dec 23, 2025
1747931
Merge branch 'devel' into new_examples
FrederikSchnack Dec 23, 2025
1334c30
change backend to pyccel
FrederikSchnack Dec 23, 2025
9054f1f
change backend to pyccel
FrederikSchnack Dec 23, 2025
a439c06
Make 'success' entry of linear solvers 'info' dict a Python bool
yguclu Dec 24, 2025
4b95e7a
Plot grid in plot_field_2d for the single-patch case
yguclu Dec 24, 2025
6a7e681
Add notebook w/ 2D Poisson's eqn. on single-patch domain
yguclu Dec 24, 2025
f64b62b
Write PSYDAC in all caps
yguclu Dec 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 100 additions & 4 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,124 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN}}
PSYDAC_MESH_DIR: ${{ github.workspace }}/mesh
OMP_NUM_THREADS: 2
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install non-Python dependencies on Ubuntu
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: gfortran openmpi-bin libopenmpi-dev libhdf5-openmpi-dev
version: 1.0
execute_install_scripts: true

- name: Reconfigure non-Python dependencies on Ubuntu
run: |
sudo apt-get update
sudo apt-get install --reinstall openmpi-bin libhdf5-openmpi-dev liblapack-dev libblas-dev
sudo apt install graphviz pandoc

- name: Print information on MPI and HDF5 libraries
run: |
ompi_info
h5pcc -showconfig -echo || true

- name: Upgrade pip, setuptools, and wheel
run: |
python -m pip install --upgrade pip setuptools wheel

- name: Determine directory of parallel HDF5 library
run: |
if [[ "${{ matrix.os }}" == "ubuntu-24.04" ]]; then
HDF5_DIR=$(dpkg -L libhdf5-openmpi-dev | grep libhdf5.so | xargs dirname)
elif [[ "${{ matrix.os }}" == "macos-14" ]]; then
HDF5_DIR=$(brew list hdf5-mpi | grep "libhdf5.dylib" | xargs dirname | xargs dirname)
fi
echo $HDF5_DIR
echo "HDF5_DIR=$HDF5_DIR" >> $GITHUB_ENV

- name: Cache PETSc
uses: actions/cache@v4
id: cache-petsc
env:
cache-name: cache-PETSc
with:
path: "./petsc"
key: petsc-${{ matrix.os }}-${{ matrix.python-version }}

- if: steps.cache-petsc.outputs.cache-hit != 'true'
name: Download a specific release of PETSc
run: |
git clone --depth 1 --branch v3.23.2 https://gitlab.com/petsc/petsc.git

- if: steps.cache-petsc.outputs.cache-hit != 'true'
name: Install PETSc with complex support
working-directory: ./petsc
run: |
export PETSC_DIR=$(pwd)
export PETSC_ARCH=petsc-cmplx
./configure --with-scalar-type=complex --with-fortran-bindings=0 --have-numpy=1
make all
echo "PETSC_DIR=$PETSC_DIR" > petsc.env
echo "PETSC_ARCH=$PETSC_ARCH" >> petsc.env

# This step is not really necessary and could be combined with PETSc install
# step; however it's good to verify if the cached PETSc installation really works!
- name: Test PETSc installation
working-directory: ./petsc
run: |
source petsc.env
make check
echo "PETSC_DIR=$PETSC_DIR" >> $GITHUB_ENV
echo "PETSC_ARCH=$PETSC_ARCH" >> $GITHUB_ENV

- name: Install petsc4py
working-directory: ./petsc
run: |
python -m pip install wheel Cython numpy
python -m pip install src/binding/petsc4py

- name: Install h5py in parallel mode
run: |
export CC="mpicc"
export HDF5_MPI="ON"
python -m pip install h5py --no-cache-dir --no-binary h5py
python -m pip list

- name: Check parallel h5py installation
run: |
python -c "
from mpi4py import MPI
import h5py
# This particular instantiation of h5py.File will fail if parallel h5py isn't installed
f = h5py.File('parallel_test.hdf5', 'w', driver='mpio', comm=MPI.COMM_WORLD)
print(f)"

- name: Install project
run: |
sudo apt update
sudo apt install graphviz
- name: Install Python dependencies
python -m pip install .[test]
python -m pip freeze

- name: Install Python dependencies for Documentation
run: |
python -m pip install -r docs/requirements.txt

- name: Make the sphinx doc
run: |
rm -rf docs/source/modules/STUBDIR
make -C docs clean
make -C docs html
python docs/update_links.py

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
- name: Initialize test directory
run: |
mkdir pytest
cp mpi_tester.py pytest
cp scripts/mpi_tester.py pytest

- name: Run coverage tests on macOS
if: matrix.os == 'macos-14'
Expand Down Expand Up @@ -203,6 +203,11 @@ jobs:
run: |
python mpi_tester.py --mpirun="mpiexec -n 4 ${MPI_OPTS}" --pyargs psydac -m "parallel and petsc"

- name: Run single-process example tests with Pytest on Ubuntu
if: matrix.os == 'ubuntu-24.04'
run: |
python -m pytest examples/feec

- name: Remove test directory
if: always()
run: |
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 align="center">
<img src="https://raw.githubusercontent.com/pyccel/psydac/devel/docs/source/logo/psydac_banner.svg" width="600" alt="Shows the psydac logo.">
<img src="https://raw.githubusercontent.com/pyccel/psydac/devel/docs/source/logo/psydac_banner.svg" width="600" alt="Shows the psydac logo." class="dark-light">
</h1><br>

[![devel_tests](https://github.com/pyccel/psydac/actions/workflows/testing.yml/badge.svg)](https://github.com/pyccel/psydac/actions/workflows/testing.yml) [![docs](https://github.com/pyccel/psydac/actions/workflows/documentation.yml/badge.svg)](https://github.com/pyccel/psydac/actions/workflows/documentation.yml)
Expand Down Expand Up @@ -38,7 +38,7 @@ PSYDAC requires a certain number of components to be installed on the machine:

The installation instructions depend on the operating system and on the packaging manager used.
It is particularly important to determine the **HDF5 root folder**, as this will be needed to install the [`h5py`](https://docs.h5py.org/en/latest/build.html#source-installation) package in parallel mode.
Detailed instructions can be found in the [documentation](https://github.com/pyccel/psydac/blob/devel/docs/installation.md).
Detailed instructions can be found in the [documentation](https://pyccel.github.io/psydac/installation.html).

Once those components are installed, we recommend using [`venv`](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment) to set up a fresh Python virtual environment at a location `<ENV-PATH>`:
```bash
Expand All @@ -65,12 +65,12 @@ pip install meson-python "pyccel>=2.1.0"
pip install --no-build-isolation --editable ./psydac
```

Again, for more details we refer to our [documentation](https://github.com/pyccel/psydac/blob/devel/docs/installation.md).
Again, for more details we refer to our [documentation](https://pyccel.github.io/psydac/installation.html).

> [!TIP]
> PSYDAC provides the functionality to convert its MPI-parallel matrices and vectors to their [PETSc](https://petsc.org) equivalent, and back.
> This gives the user access to a wide variety of linear solvers and other algorithms.
> Instructions for installing [PETSc](https://petsc.org) and `petsc4py` can be found in our [documentation](https://github.com/pyccel/psydac/blob/devel/docs/installation.md#optional-petsc-installation).
> Instructions for installing [PETSc](https://petsc.org) and `petsc4py` can be found in our [documentation](https://pyccel.github.io/psydac/installation.html#id9).

## Running Tests

Expand Down Expand Up @@ -108,14 +108,15 @@ This command applies Pyccel to all the kernel files in the source directory. The

## Examples and Tutorials

A [tutorial](https://pyccel.github.io/IGA-Python/intro.html) on isogeometric analysis, with many example notebooks where various PDEs are solved with PSYDAC, is under construction in the [IGA-Python](https://github.com/pyccel/IGA-Python) repository.
Our [documentation](https://pyccel.github.io/psydac/examples.html) provides Jupyter notebooks that present many aspects of this library.
Additional [tutorials](https://pyccel.github.io/IGA-Python/intro.html) on isogeometric analysis, with many example notebooks where various PDEs are solved with PSYDAC, is under construction in the [IGA-Python](https://github.com/pyccel/IGA-Python) repository.
Some other examples can be found [here](https://github.com/pyccel/psydac/blob/devel/examples).

## Library Documentation

- [Output formats](https://github.com/pyccel/psydac/blob/devel/docs/output.md)
- [Mesh generation](https://github.com/pyccel/psydac/blob/devel/docs/psydac-mesh.md)
- [Library reference](https://pyccel.github.io/psydac/)
- [Output formats](https://pyccel.github.io/psydac/output.html)
- [Mesh generation](https://pyccel.github.io/psydac/psydac-mesh.html)
- [Modules](https://pyccel.github.io/psydac/modules.html)

## Contributing

Expand Down
4 changes: 4 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@mkdir -p source/examples
@cp -r ../examples/notebooks/* source/examples/
@cp *.md source/

@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
7 changes: 1 addition & 6 deletions docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,4 @@ post.export_to_vtk('filename_vtk', grid=grid, npts_per_cell=npts_per_cell, snaps
```

## Further Examples
Further examples are present in the following files:

* `examples/poisson_3d_target_torus.py`
* `examples/sample_multipatch_parallel.py`
* `examples/notebooks/Poisson_non_periodic.ipynb`
* `psydac/api/tests/test_postprocessing.py`
Further examples are present in the [example notebooks](https://pyccel.github.io/psydac/examples.html).
2 changes: 1 addition & 1 deletion docs/psydac-mesh.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ After installation, the command `psydac-mesh` will be available.

```bash
psydac-mesh -n='16,16' -d='3,3' square mesh.h5
```
```
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ pydata_sphinx_theme
numpydoc
tomli
sphinx-math-dollar
nbsphinx
ipykernel
ipytest
myst-parser
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def fixed_init(self, app):
'sphinx.ext.githubpages',
'sphinx_math_dollar',
'sphinx.ext.mathjax',
'nbsphinx',
'myst_parser',
]

Expand Down
47 changes: 44 additions & 3 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,47 @@
Examples
========

+------------------------------------------------------------------------------------------------------------------------+
| Here you will find examples of how to use PSYDAC and explanations thereof as well as links to notebooks in the future. |
+------------------------------------------------------------------------------------------------------------------------+
.. +------------------------------------------------------------------------------------------------------------------------+
.. | Here you will find examples of how to use PSYDAC and explanations thereof as well as links to notebooks in the future. |
.. +------------------------------------------------------------------------------------------------------------------------+

.. The notebooks get copied into the source directory by the continuous integration pipeline.
.. The notebooks should have all output cleared before being committed to the repository.
Notebooks
---------
For the documentation, we provide several Jupyter notebooks that illustrate how to use PSYDAC to solve different types of problems.
They can be found in the `notebooks directory <https://github.com/pyccel/psydac/tree/devel/examples/notebooks>`_,
but are also generated as part of the documentation and can be accessed here:


.. toctree::
:maxdepth: 1
:caption: Notebooks:

examples/poisson_2d_square
examples/Poisson_non_periodic
examples/Helmholtz_non_periodic
examples/fem_L2_projection
examples/regularized_curlcurl_3D_VTK
examples/petsc_eigenvalues_regularized_curlcurl
examples/feec_curlcurl_eigenvalue
examples/feec_time_harmonic_Maxwell
examples/feec_vector_potential_torus

FEEC Examples
-------------

In the `FEEC examples directory <https://github.com/pyccel/psydac/tree/devel/examples/feec>`_,
you will find several examples of how to use PSYDAC to solve problems arising within the Finite Element Exterior Calculus (FEEC) framework.
These examples include:


* Poisson problems
* General curl-curl eigenvalue problems
* Time-harmonic Maxwell equations with source terms
* Time-dependent Maxwell equations


Performance
-----------
There are also some examples in the `performance directory <https://github.com/pyccel/psydac/tree/devel/examples/performance>`_ explaining the assembly algorithms used in PSYDAC.
11 changes: 4 additions & 7 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
Welcome to PSYDAC's documentation!
==================================

.. _note:
.. note::

This documentation is still under construction.
For the time being, its purpose is to assist the developers.

.. include:: ../../README.md
:parser: myst_parser.sphinx_

Expand All @@ -21,6 +15,9 @@ Welcome to PSYDAC's documentation!
:maxdepth: 1
:hidden:

modules
installation
examples
output
modules
psydac-mesh
maintenance
12 changes: 0 additions & 12 deletions docs/source/modules/feec.multipatch.rst

This file was deleted.

8 changes: 1 addition & 7 deletions docs/source/modules/feec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ feec
feec.derivatives
feec.global_geometric_projectors
feec.hodge
feec.multipatch_domain_utilities
feec.pull_push
feec.pushforward

feec submodules
---------------
.. toctree::
:maxdepth: 1

feec.multipatch
2 changes: 1 addition & 1 deletion docs/update_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'cmd',
'core',
'ddm',
'feec', 'feec.multipatch',
'feec',
'fem',
'linalg', 'linalg.kernels',
'mapping',
Expand Down
7 changes: 7 additions & 0 deletions examples/feec/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
In this directory, we present the following examples arising within the FEEC framework:
* Poisson problem
* General curl-curl eigenvalue problem (with DG and FEEC)
* Time-harmonic Maxwell problem
* Time-dependent Maxwell problem

All provide visualizing using the VTK plotting utilities of PSYDAC.
Loading