Add a demo showing how submeshes can be used to represent boundary data #2666
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: macOS build | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- "main" | |
tags: | |
- "v*" | |
merge_group: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
mac-os-build: | |
name: macOS Homebrew install and test | |
runs-on: macos-15 | |
env: | |
PETSC_ARCH: arch-darwin-c-opt | |
PETSC_DIR: ${{ github.workspace }}/petsc | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Load environment variables | |
run: | | |
cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV | |
echo DYLD_LIBRARY_PATH=/usr/local/lib >> $GITHUB_ENV | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install Homebrew dependencies | |
run: | | |
brew install adios2 boost catch2 cmake hdf5-mpi make ninja open-mpi pkgconf pugixml spdlog # FEniCS | |
brew install bison flex gfortran scalapack scotch # PETSc | |
- name: Install Python dependencies (petsc4py) | |
run: | | |
python -m pip install mpi4py numpy | |
python -m pip install cython setuptools wheel | |
- name: Install minimal PETSc and petsc4py | |
run: | | |
export PATH="$(brew --prefix gfortran)/bin:$(brew --prefix bison)/bin:$PATH" | |
export PATH="$(brew --prefix make)/libexec/gnubin:$PATH" | |
git clone -b release https://gitlab.com/petsc/petsc.git petsc | |
cd petsc | |
python ./configure \ | |
--with-64-bit-indices=no \ | |
--with-debugging=no \ | |
--with-fortran-bindings=no \ | |
--with-scalar-type=real \ | |
--with-shared-libraries \ | |
--with-scalar-type=real \ | |
--with-ptscotch-dir=$(brew --prefix scotch) \ | |
--with-scalapack-dir=$(brew --prefix scalapack) \ | |
--download-metis \ | |
--download-metis-commit=08c3082720ff9114b8e3cbaa4484a26739cd7d2d \ | |
--download-parmetis \ | |
--download-parmetis-commit=53c9341b6c1ba876c97567cb52ddfc87c159dc36 \ | |
--download-mumps \ | |
--download-mumps-avoid-mpi-in-place | |
make all | |
cd src/binding/petsc4py | |
arch -arm64 python -m pip -v install --no-build-isolation --no-cache-dir . | |
- name: Install FEniCSx dependencies | |
run: | | |
python -m pip install git+https://github.com/fenics/ufl.git@${{ env.ufl_ref }} | |
python -m pip install git+https://github.com/fenics/basix.git@${{ env.basix_ref }} | |
python -m pip install git+https://github.com/fenics/ffcx.git@${{ env.ffcx_ref }} | |
- name: Build and install DOLFINx C++ library | |
run: | | |
cmake -G Ninja -B build -S cpp/ | |
cmake --build build | |
sudo cmake --install build | |
- name: Build C++ unit tests | |
run: | | |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build/test/ -S cpp/test/ | |
cmake --build build/test | |
- name: Run C++ unit tests (serial) | |
run: | | |
cd build/test | |
mpiexec -np 1 ctest -V --output-on-failure -R unittests | |
- name: Run C++ unit tests (MPI) | |
run: | | |
cd build/test | |
mpiexec -np 3 ctest -V --output-on-failure -R unittests | |
- name: Build and install DOLFINx Python interface | |
run: | | |
python -m pip install -r python/build-requirements.txt | |
python -m pip install --check-build-dependencies --no-build-isolation 'python/[test]' | |
- name: Basic test | |
run: | | |
mpiexec -np 1 python -c "import dolfinx; from mpi4py import MPI; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))" | |
mpiexec -np 2 python -c "import dolfinx; from mpi4py import MPI; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))" | |
- name: Run Python unit tests (serial) | |
run: | | |
python -m pip install pytest-xdist | |
mpiexec -np 1 python3 -m pytest -n=auto --durations=50 python/test/unit/ | |
- name: Run Python unit tests (MPI, np=3) | |
run: | | |
mpiexec -np 3 python3 -m pytest python/test/unit/ |