Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
cd34ead
i think cg4 defined by fiat works
indiamai Feb 18, 2026
693e374
under very precise conditions cg4 works
indiamai Feb 19, 2026
9ccf3aa
tidy up, make real test
indiamai Feb 19, 2026
36f08b3
fix branch
indiamai Feb 19, 2026
109dfb0
try pip installing firedrake and tidy
indiamai Feb 19, 2026
ba8526a
try changing docker image
indiamai Feb 19, 2026
80d172b
try changing docker image
indiamai Feb 19, 2026
70e8951
experiment with petsctools
indiamai Feb 19, 2026
a70a981
try purging and specifically install petsc4py
indiamai Feb 19, 2026
e06063f
fix directory
indiamai Feb 19, 2026
e4bd65f
remove added petsctools
indiamai Feb 19, 2026
ec7756e
try installing specific version of petsctools
indiamai Feb 19, 2026
32d82c4
try installing specific version of petsctools - better url
indiamai Feb 19, 2026
e7da800
uninstall + python -m everywhere
indiamai Feb 19, 2026
9fc414f
remove uninstall
indiamai Feb 19, 2026
eb96b9a
fix syntax issue
indiamai Feb 19, 2026
6edc919
try installing fresh firedrake
indiamai Feb 19, 2026
c9b9dd9
fix syntax
indiamai Feb 19, 2026
297d543
add directory back in
indiamai Feb 19, 2026
97673f3
add directory back in... again
indiamai Feb 19, 2026
2e9c9f3
try building everything from scratch
indiamai Feb 19, 2026
cc0c9f1
more fixing
indiamai Feb 19, 2026
ed97883
more fixing
indiamai Feb 19, 2026
4f5ce53
steal firedrake workflow
indiamai Feb 23, 2026
dcc2e12
incorrect attribute
indiamai Feb 23, 2026
803c19e
change petsc path
indiamai Feb 23, 2026
3d60b85
try different firedrake branch
indiamai Feb 23, 2026
82c94f9
try different firedrake branch
indiamai Feb 23, 2026
0a7c56b
try different firedrake branch
indiamai Feb 23, 2026
cb7e952
finalise sub ents change
indiamai Feb 23, 2026
e312e84
try installing one branch then using another
indiamai Feb 23, 2026
c9cf9e0
try not building sdist to get editable
indiamai Feb 24, 2026
f0a27b1
fix directory
indiamai Feb 24, 2026
6123d48
cd into fuse before making test
indiamai Feb 24, 2026
ff901a6
run make
indiamai Feb 24, 2026
45028d3
Fix tests now i have ci
indiamai Feb 24, 2026
1de0038
clean up tests, xfail ned2
indiamai Feb 25, 2026
9d2451c
fix final test
indiamai Feb 25, 2026
87262ee
redo non trivial transform groups
indiamai Feb 26, 2026
35dc8a1
try to run ci using split tests
indiamai Mar 2, 2026
2410d17
fix path
indiamai Mar 2, 2026
f785def
maybe nd2 on tets
indiamai Mar 2, 2026
86ab83b
use different group for cg4
indiamai Mar 3, 2026
fc0bbdd
fix up RT
indiamai Mar 3, 2026
f1a21b8
lint
indiamai Mar 3, 2026
9c2b5b8
...it might be working
indiamai Mar 4, 2026
9bf3a1b
switch group for cg4 back over
indiamai Mar 4, 2026
3a1f6fc
some tidying
indiamai Mar 4, 2026
6ae8526
xfail test
indiamai Mar 5, 2026
c12608e
fix quadrature degree, implement bdm and ned 2nd kind on triangles
indiamai Mar 5, 2026
16a67c2
remember to add test files
indiamai Mar 5, 2026
76a650b
lint
indiamai Mar 5, 2026
9593bce
tet BDM and ned 2nd kind
indiamai Mar 5, 2026
a9c3dd6
lint
indiamai Mar 5, 2026
5072051
enable polynomial kernel to be vector valued, bdm2 on triangles
indiamai Mar 6, 2026
a54346c
remove breakpoint and lint
indiamai Mar 6, 2026
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
244 changes: 168 additions & 76 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,97 +1,189 @@
name: Run tests
# I stole this from the main firedrake repo

on:
# Run on pushes to main
push:
branches:
- main
# And all pull requests
# cd /opt/firedrake/
# git fetch
# git checkout indiamai/fuse-closures-with-pyop3
# git pull
pull_request:

jobs:
test:
name: Run tests
# Run on the Github hosted runner
runs-on: ubuntu-latest
name: Build and test Firedrake (Linux)
strategy:
# We want to know all of the tests which fail, so don't kill real if
# complex fails and vice-versa
fail-fast: false
matrix:
arch: [default]
runs-on: [self-hosted, Linux]
container:
#image: firedrakeproject/firedrake-vanilla-default:latest
image: firedrakeproject/firedrake-vanilla-default:dev-main
# Steps represent a sequence of tasks that will be executed as
# part of the jobs
image: ubuntu:latest
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMP_NUM_THREADS: 1
OPENBLAS_NUM_THREADS: 1
FIREDRAKE_CI: 1
PYOP2_SPMD_STRICT: 1
EXTRA_PYTEST_ARGS: --splitting-algorithm least_duration --timeout=600 --timeout-method=thread -o faulthandler_timeout=660 --durations-path=./fuse-repo/test/test_durations.json --durations=50
PYTEST_MPI_MAX_NPROCS: 8
FIREDRAKE_USE_FUSE: 1
steps:
- name: fix home
- name: Fix HOME
# For unknown reasons GitHub actions overwrite HOME to /github/home
# which will break everything unless fixed
# (https://github.com/actions/runner/issues/863)
run: echo "HOME=/root" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
- name: Checkout correct firedrake branch

- name: Pre-run cleanup
# Make sure the current directory is empty
run: find . -delete

# Use a different mirror to fetch apt packages from to get around
# temporary outage.
# (https://askubuntu.com/questions/1549622/problem-with-archive-ubuntu-com-most-of-the-servers-are-not-responding)
# The mirror was chosen from https://launchpad.net/ubuntu/+archivemirrors.
- name: Configure apt
run: |
/usr/bin/git config --global --add safe.directory /opt/firedrake/
cd /opt/firedrake/
git fetch
git checkout indiamai/indiamai/fuse-closures-with-pyop3
git pull
pip install pybind11 Cython
make
- name: Install checkedout fuse
sed -i 's|http://archive.ubuntu.com/ubuntu|http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/|g' /etc/apt/sources.list.d/ubuntu.sources
apt-get update

# Git is needed for actions/checkout and Python for firedrake-configure
- name: Install system dependencies (1)
run: apt-get -y install git python3

- uses: actions/checkout@v5
with:
repository: firedrakeproject/firedrake
path: firedrake-repo
ref: refs/heads/connorjward/pyop3-develop

- name: Validate single source of truth
run: ./firedrake-repo/scripts/check-config

# Check that the Dockerfile is using the latest Ubuntu version.
# The version is hardcoded into the Dockerfile so that the OS
# for each release is fixed.
- name: Check Dockerfile Ubuntu version
run: |
python3 -m pip install --break-system-packages -e '.[dev]'
- name: Checkout correct FIAT branch
latest_version=$(grep "VERSION_ID=" /etc/os-release | cut -d '"' -f 2)
docker_version=$(grep FROM firedrake-repo/docker/Dockerfile.vanilla | cut -d ':' -f 2)
echo "Latest version: $latest_version"
echo "Docker version: $docker_version"
if [[ "$docker_version" != "$latest_version" ]]; then
echo "Ubuntu version ${docker_version} in Dockerfile is out of date with latest version ${latest_version}"
exit 1
fi

- name: Install system dependencies (2)
run: |
/usr/bin/git config --global --add safe.directory ~/
cd ~
git clone https://github.com/firedrakeproject/fiat.git
/usr/bin/git config --global --add safe.directory ~/fiat
cd fiat
git fetch
git checkout indiamai/integrate_fuse
git status
python3 -m pip install --break-system-packages -e .
- name: Run tests
apt-get -y install \
$(python3 ./firedrake-repo/scripts/firedrake-configure --arch ${{ matrix.arch }} --show-system-packages)
apt-get -y install python3-venv
: # Dependencies needed to run the test suite
apt-get -y install fonts-dejavu graphviz graphviz-dev parallel poppler-utils

- name: Install PETSc
run: |
git clone --depth 1 https://gitlab.com/petsc/petsc.git
cd petsc
python3 ../firedrake-repo/scripts/firedrake-configure \
--arch ${{ matrix.arch }} --show-petsc-configure-options | \
xargs -L1 ./configure --with-make-np=8 --download-slepc
make PETSC_DIR=/__w/fuse/fuse/petsc PETSC_ARCH=arch-firedrake-${{ matrix.arch }}
make check
{
echo "PETSC_DIR=/__w/fuse/fuse/petsc"
echo "PETSC_ARCH=arch-firedrake-${{ matrix.arch }}"
echo "SLEPC_DIR=/__w/fuse/fuse/petsc/arch-firedrake-${{ matrix.arch }}"
} >> "$GITHUB_ENV"

- name: Install Firedrake
id: install
run: |
export $(python3 ./firedrake-repo/scripts/firedrake-configure --arch "${{ matrix.arch }}" --show-env)
python3 -m venv venv
. venv/bin/activate

: # Empty the pip cache to ensure that everything is compiled from scratch
pip cache purge

: # Fix for petsc4py+slepc4py build
echo 'setuptools<81' > constraints.txt
export PIP_CONSTRAINT=constraints.txt

: # Install build dependencies
pip install "$PETSC_DIR"/src/binding/petsc4py
pip install -r ./firedrake-repo/requirements-build.txt

: # Install runtime dependencies that have been removed from the pyproject.toml
: # because they rely on non-PyPI versions of petsc4py.
pip install --no-build-isolation --no-deps \
"$PETSC_DIR"/"$PETSC_ARCH"/externalpackages/git.slepc/src/binding/slepc4py
pip install --no-deps git+https://github.com/NGSolve/ngsPETSc.git netgen-mesher netgen-occt

: # We have to pass '--no-build-isolation' to use a custom petsc4py
EXTRA_BUILD_ARGS='--no-isolation'
EXTRA_PIP_FLAGS='--no-build-isolation'

: # Install from an sdist so we can make sure that it is not ill-formed
: # pip install build
: # python -m build ./firedrake-repo --sdist $EXTRA_BUILD_ARGS

: #pip install --verbose $EXTRA_PIP_FLAGS \
: # --no-binary h5py \
: # --extra-index-url https://download.pytorch.org/whl/cpu \
: # "$(echo ./firedrake-repo/dist/firedrake-*.tar.gz)[ci]"

pip install --verbose $EXTRA_PIP_FLAGS \
--no-binary h5py \
--extra-index-url https://download.pytorch.org/whl/cpu \
-e ./firedrake-repo[ci]

firedrake-clean
pip list
make tests
- name: Upload coverage
uses: actions/upload-artifact@v4

- uses: actions/checkout@v5
with:
repository: firedrakeproject/firedrake
path: firedrake-repo
ref: refs/heads/indiamai/fuse-closures-with-pyop3

- name: Make cython
run: |
. venv/bin/activate
cd ./firedrake-repo
make

- uses: actions/checkout@v5
with:
path: fuse-repo

- name: Install checked out fuse
run: |
. venv/bin/activate
python3 -m pip install --break-system-packages -e './fuse-repo[dev]'

- uses: actions/checkout@v5
with:
name: covdata
include-hidden-files: true
path: .coverage.*

coverage:
name: Coverage
needs: test
runs-on: ubuntu-latest
if: success() && github.ref == 'refs/heads/main'
container:
image: firedrakeproject/firedrake-vanilla-default:latest
# Steps represent a sequence of tasks that will be executed as
# part of the jobs
steps:
- name: "Check out the repo"
uses: "actions/checkout@v2"
- name: Install checkedout fuse
run: |
python3 -m pip install --break-system-packages -e '.[dev]'
- name: "Download coverage data"
uses: actions/download-artifact@v4
with:
name: covdata

- name: "Combine"
run: |
make coverage
export TOTAL=$(python3 -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY

- name: "Make badge"
uses: schneegans/dynamic-badges-action@v1.4.0
with:
# GIST_TOKEN is a GitHub personal access token with scope "gist".
auth: ${{ secrets.GIST_SECRET }}
gistID: 8d09e14999153441dba99d1759e90707 # replace with your real Gist id.
filename: covbadge.json
label: Coverage
message: ${{ env.total }}%
minColorRange: 50
maxColorRange: 90
valColorRange: ${{ env.total }}
repository: firedrakeproject/fiat
path: fiat-repo
ref: refs/heads/indiamai/integrate_fuse

- name: Install checked out FIAT
run: |
. venv/bin/activate
python3 -m pip install --break-system-packages -e './fiat-repo'

- name: Run tests
run: |
. venv/bin/activate
cd ./fuse-repo
firedrake-run-split-tests 1 1 -n 8 "$EXTRA_PYTEST_ARGS" ./test
2 changes: 1 addition & 1 deletion fuse/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from fuse.cells import Point, Edge, polygon, make_tetrahedron, constructCellComplex
from fuse.groups import S1, S2, S3, D4, Z3, Z4, C3, C4, S4, A4, tri_C3, tet_edges, tet_faces, sq_edges, GroupRepresentation, PermutationSetRepresentation, get_cyc_group, get_sym_group
from fuse.groups import S1, S2, S3, D4, Z3, Z4, C3, C4, S4, A4, diff_C3, tet_edges, tet_faces, sq_edges, GroupRepresentation, PermutationSetRepresentation, get_cyc_group, get_sym_group
from fuse.dof import DeltaPairing, DOF, L2Pairing, FuseFunction, PointKernel, VectorKernel, PolynomialKernel, ComponentKernel
from fuse.triples import ElementTriple, DOFGenerator, immerse
from fuse.traces import TrH1, TrGrad, TrHess, TrHCurl, TrHDiv
Expand Down
8 changes: 6 additions & 2 deletions fuse/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ def _subentity_traversal(self, sub_ents, min_ids):
# if self.oriented:
# connections = self.permute_entities(self.oriented, dim - 1)
# if self.dimension == 2:
# connections = [connections[-1]] + connections[:-1]
# print([self.get_node(c[0]).id - min_ids[1] for c in connections])
# print([c.point.id - min_ids[1] for c in self.connections])
for e, o in connections:
Expand Down Expand Up @@ -638,10 +639,10 @@ def permute_entities(self, g, d):

return reordered_entities

def basis_vectors(self, return_coords=True, entity=None):
def basis_vectors(self, return_coords=True, entity=None, order=False):
if not entity:
entity = self
self_levels = [sorted(generation) for generation in nx.topological_generations(self.G)]
self_levels = [generation for generation in nx.topological_generations(self.G)]
vertices = entity.ordered_vertices()
if self.dimension == 0:
# return [[]
Expand Down Expand Up @@ -934,6 +935,9 @@ def __init__(self, A, B, flat=False):
self.dimension = self.A.dimension + self.B.dimension
self.flat = flat

def ordered_vertices(self):
return self.A.ordered_vertices() + self.B.ordered_vertices()

def get_spatial_dimension(self):
return self.dimension

Expand Down
Loading