Skip to content
Draft

pyop3 #3318

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
894 commits
Select commit Hold shift + click to select a range
0ede752
Move debug code
connorjward Jan 27, 2026
4a05b7d
extrusion wip
connorjward Jan 27, 2026
c1d0012
Progress on getting things to work
Jan 28, 2026
af5b097
working ish
Jan 28, 2026
48d22ce
It appears to work
Jan 28, 2026
894a926
Big comment
Jan 28, 2026
ed03bf4
Fix boundary condition application for extruded meshes
Jan 28, 2026
7f8a52a
Fix the memory leak, cleanup needed
Jan 29, 2026
6d49580
Fix caching
Jan 29, 2026
9414085
Refactor config
Feb 3, 2026
5e736a6
Make heavy caches into context managers
Feb 3, 2026
cfa58d0
Expand docstring
Feb 3, 2026
ec31e14
Fix hex tests in parallel
Feb 6, 2026
31ba7ca
Fix one deadlock, now hitting another
Feb 6, 2026
83086dd
Fix another deadlock
Feb 6, 2026
ce4bfe5
Merge remote-tracking branch 'origin/main' into connorjward/pyop3-dev…
Feb 6, 2026
f3cc8fe
Various fixes
Feb 9, 2026
21d22dd
Various little fixes
Feb 9, 2026
7ec4a3f
fixup
Feb 9, 2026
5cbfa77
Merge remote-tracking branch 'origin/main' into connorjward/pyop3-dev…
Feb 9, 2026
24f2d15
fixup
Feb 9, 2026
cb98405
Small perf improvements
connorjward Feb 10, 2026
788f206
Merge remote-tracking branch 'origin/main' into connorjward/pyop3-dev…
connorjward Feb 10, 2026
8a47cd3
skip periodic extr test
Feb 11, 2026
48ec222
Merge remote-tracking branch 'origin/main' into connorjward/pyop3-dev…
connorjward Feb 11, 2026
48e93bc
Small periodic extrusion fix, still getting confused
connorjward Feb 11, 2026
9987823
Fix for periodic extrusion
Feb 11, 2026
63a2010
Fix facet integrals for periodic extruded meshes
Feb 11, 2026
ed362f6
Fix boundary nodes
Feb 11, 2026
2eedeea
Fix high order extrusion
Feb 12, 2026
6593fd9
Real space fix
Feb 12, 2026
b75810a
more fixes
Feb 12, 2026
e2355d0
Remove old breakpoints
Feb 12, 2026
bdd6200
MG fixes
Feb 12, 2026
9c21377
Implement missing abstract methods for Neg
Feb 12, 2026
49a51d4
supermesh fix
Feb 12, 2026
ff40408
supermesh fix
Feb 12, 2026
9442f1b
supermesh fix
Feb 12, 2026
2127aeb
give up on stochastic supermesh fix
Feb 13, 2026
372b81b
fixup
Feb 13, 2026
5da1b37
fic func plotter
Feb 17, 2026
f866186
num_cells etc now properties
Feb 17, 2026
85c31c9
ensemble fixes, but pain lies ahead
Feb 17, 2026
3a05e02
fixup
Feb 17, 2026
73018c6
Ensemble tests are passing
connorjward Feb 17, 2026
e67cdbc
Fix extruded coords
connorjward Feb 17, 2026
5503c07
Fix the first RFS test
Feb 18, 2026
c0be2e3
RFS fix
connorjward Feb 20, 2026
54fa89a
fix rfs mixed
connorjward Feb 20, 2026
c9b7ed3
fixup
connorjward Feb 20, 2026
8eec154
Split apart utils to sensible pieces, will need a few final import fixes
connorjward Feb 20, 2026
80bb1a5
Refactor done
connorjward Feb 22, 2026
7644ace
Bits
connorjward Feb 23, 2026
beb86c4
Some matis fixes
connorjward Feb 23, 2026
b04f77d
fixes
connorjward Feb 23, 2026
c5f88d9
fixes
connorjward Feb 23, 2026
3d04677
fixes
connorjward Feb 24, 2026
2c8741e
fixup
connorjward Feb 24, 2026
7a476dd
Implement more node maps
connorjward Feb 24, 2026
eaf0c57
fixup
connorjward Feb 24, 2026
2dfe5bf
Return to .dat.vec throughout
connorjward Feb 25, 2026
82637d3
Fix caching bug, and hopefully the memory bomb
connorjward Feb 25, 2026
bea5df3
Undo more .dat.vecs
connorjward Feb 25, 2026
8980368
Fix for fieldsplit
connorjward Feb 26, 2026
2847cad
fixup
connorjward Feb 26, 2026
f76f302
Fix extruded mesh hierarchies (coarse to fine only)
connorjward Feb 27, 2026
2b46fdf
extr fine to coarse also works but very slow
connorjward Feb 27, 2026
0c7b93d
Small optimisation, still very slow!
connorjward Feb 27, 2026
cfcb2fe
spped investigating
connorjward Mar 3, 2026
126e32a
Speed up MG tests by adding a lot more caching
connorjward Mar 3, 2026
f8d336e
Remove old mixin type
connorjward Mar 3, 2026
1e4fad8
remove refs to dof_dset
connorjward Mar 3, 2026
eb099e9
skip periodic extr case
connorjward Mar 3, 2026
0be2d1b
fixup
connorjward Mar 3, 2026
273d7a9
Speed up covariance sampling
connorjward Mar 4, 2026
fcf088c
Use DMPlex.createBoxMesh to create our periodic meshes
connorjward Mar 3, 2026
6a4fd9a
linting
connorjward Mar 6, 2026
f4af999
vom fix
connorjward Mar 6, 2026
8bf3ca2
submesh fix
connorjward Mar 6, 2026
077d1d4
More fixes, all of them?
connorjward Mar 6, 2026
8a9b10e
WIP on better parloop caching
connorjward Mar 9, 2026
b3bcb90
Refactor buffer ref to streamline things
connorjward Mar 9, 2026
1bcc5a2
matrix fixup
connorjward Mar 9, 2026
42d8edb
caching appears to work
connorjward Mar 9, 2026
c0de549
More bufferref fixes
connorjward Mar 9, 2026
939257c
Caching now appears to work, moving on
connorjward Mar 10, 2026
6619fcc
vom fixup
connorjward Mar 10, 2026
500ab99
fix riesz error, now conv issues
connorjward Mar 10, 2026
cefe5e2
Major refactor so caching will work
connorjward Mar 11, 2026
76ab04f
Apply suggestions from code review
connorjward Mar 12, 2026
a31b8f2
Things are now running, even if they're very slow...
connorjward Mar 12, 2026
1f80b72
fixup
connorjward Mar 12, 2026
02d222d
fixes
connorjward Mar 12, 2026
695eb15
test_assemble fixes
connorjward Mar 12, 2026
93e0019
Test fixes
connorjward Mar 12, 2026
9ce5532
Add warning for empty subdomains
connorjward Mar 12, 2026
65167c0
Various fixes
connorjward Mar 13, 2026
c9eaa0c
Remove functionspacedata.py
connorjward Mar 13, 2026
7df1d98
Small fixes for extruded+linesmoother
connorjward Mar 16, 2026
21dc737
Fix some submesh issues
connorjward Mar 17, 2026
e6a5fff
Fixes for submesh
connorjward Mar 17, 2026
b703762
All working apart from equationbc
connorjward Mar 17, 2026
e52bd3f
VoM fixes, all appears to work in serial
connorjward Mar 17, 2026
939d36c
Fixes
connorjward Mar 17, 2026
15100c5
Finally remove the 'XXX' horror
connorjward Mar 17, 2026
3b8b917
Fix for fieldsplit, still has conv issues
connorjward Mar 17, 2026
a644c69
debugging
connorjward Mar 17, 2026
4596631
Fixed, over-zealous caching
connorjward Mar 17, 2026
8548c74
Make assignment and zeroing a lot faster by preferring array ops
connorjward Mar 18, 2026
3b27dbc
Apply suggestions from code review
connorjward Mar 18, 2026
74e918c
Tidy up copy semantics
connorjward Mar 18, 2026
8db721f
Small fixes, ebc tests are now passing
connorjward Mar 19, 2026
c064ab7
fixup
connorjward Mar 19, 2026
4302a46
Merge remote-tracking branch 'origin/main' into connorjward/periodic-…
connorjward Mar 20, 2026
d69102f
Begin getting fdm pc to work, tricky because of passthrough mats
connorjward Mar 20, 2026
c30abea
Small fixes, major pc issues
connorjward Mar 23, 2026
5d55c68
PatchPC is still wrong - and oh so complicated!
connorjward Mar 23, 2026
9483513
Try final PETSc fix
connorjward Mar 24, 2026
bd41890
Hackery re pcpatch, still not working and another approach needed
connorjward Mar 24, 2026
9edd899
Initial refactor ideas
connorjward Mar 25, 2026
439f1c2
This partially works now
connorjward Mar 25, 2026
e0d74a2
fixup
connorjward Mar 26, 2026
04f1093
cleanup
connorjward Mar 26, 2026
6994f3f
things are working
connorjward Mar 26, 2026
cb29c59
some cleanup
connorjward Mar 26, 2026
ee31879
Commentary
connorjward Mar 26, 2026
98afa77
wip
connorjward Mar 27, 2026
edaab52
Apply suggestion from @connorjward
connorjward Mar 27, 2026
12d8b91
Add missing PetscFunctionBegin calls to tinyASM
connorjward Mar 27, 2026
6b4509b
Store refs
connorjward Mar 27, 2026
85fc57d
Prep for SNESPatch, still fairly tidy looking
connorjward Mar 27, 2026
2f95da8
Merge branch 'main' into connorjward/patch-refactor
connorjward Mar 27, 2026
b976dbe
Residuals nearly there, more state work needed
connorjward Mar 27, 2026
6c73411
SNES fixes, now just seeing GC errors and exterior facets?
connorjward Mar 29, 2026
baed8e6
ext facet fix and cleanup
connorjward Mar 29, 2026
02fc095
fixes, still segfaulting
connorjward Mar 30, 2026
43938b3
fixup
connorjward Mar 30, 2026
5eb8d99
fixups
connorjward Mar 30, 2026
2a0f7b7
cleanup
connorjward Mar 30, 2026
0ff2778
Merge remote-tracking branch 'origin/main' into connorjward/pyop3-dev…
connorjward Mar 30, 2026
67e3ce7
Merge remote-tracking branch 'origin/connorjward/periodic-dmplex' int…
connorjward Mar 30, 2026
cb29ca3
Merge remote-tracking branch 'origin/connorjward/patch-refactor' into…
connorjward Mar 30, 2026
541828f
fixup
connorjward Mar 31, 2026
648f760
Prefer petsctools over pyop2.utils for certain utility methods
connorjward Mar 31, 2026
57a5acc
cleanup, move lower->exec
connorjward Mar 31, 2026
1973cd3
fixup
connorjward Mar 31, 2026
ecb7950
Merge remote-tracking branch 'origin/connorjward/petsctools-getpetscd…
connorjward Mar 31, 2026
23f5106
Merge remote-tracking branch 'origin/connorjward/petsctools-getpetscd…
connorjward Mar 31, 2026
6564ee7
fixup
connorjward Mar 31, 2026
cf9d6e1
fixup
connorjward Mar 31, 2026
001b2a5
fixes for mg and ensemble
connorjward Mar 31, 2026
fb2b33c
fixup
connorjward Mar 31, 2026
8b63143
fixup
connorjward Mar 31, 2026
5cc2e42
linting tests mostly
connorjward Apr 8, 2026
903e123
fixup
connorjward Apr 8, 2026
7c651d9
Hackery to get opaque working, nearly there
connorjward Apr 8, 2026
50cb2c9
passthrough mat kinda works
connorjward Apr 9, 2026
fae6b00
Hiptmair tests passing
connorjward Apr 13, 2026
a439d78
Cleanup opaque bits, now speedup
connorjward Apr 13, 2026
d136168
Put some bits in Cython
connorjward Apr 13, 2026
680efb6
Cythonise nodal axes
connorjward Apr 14, 2026
f574a60
fdm fixes
connorjward Apr 14, 2026
44f1728
Progress on fdm
connorjward Apr 14, 2026
8a7f7d2
Fix a segfault
connorjward Apr 14, 2026
b02f708
Bunch of fixes, matnest/matpython much much nicer
connorjward Apr 16, 2026
57743c8
test_bcs entirely passing
connorjward Apr 16, 2026
2cda1dd
Redo cell node stuff for mixed things
connorjward Apr 17, 2026
9fb08f8
Refactor section and axis bits, should be better now
connorjward Apr 22, 2026
6c26792
Global section and sf wrangling
connorjward Apr 22, 2026
708a5fb
Mixed test passes without coeff
connorjward Apr 23, 2026
7973612
Fix PCPatch for 2D
connorjward Apr 23, 2026
febc387
Fix node map shapes
connorjward Apr 24, 2026
7846398
Fix some transfer stuff by fixing the node maps
connorjward Apr 24, 2026
60e26e9
cleanup assign behaviour
connorjward Apr 24, 2026
6528907
debugging pmg
connorjward Apr 24, 2026
a27ecf8
pmg actually was working, dont know why it failed before
connorjward Apr 24, 2026
69807f8
fixup
connorjward Apr 24, 2026
35020bc
fix modified tests
connorjward Apr 24, 2026
f451067
little fixes, including a tricksy subfunctions one
connorjward Apr 24, 2026
d289309
fixes for real sections
connorjward Apr 25, 2026
434197a
Various fixes
connorjward Apr 27, 2026
beb0c11
Fix weakref issue
connorjward Apr 27, 2026
532741e
Fix pcpatch for vector valued things
connorjward Apr 27, 2026
556de4f
wip on refactor of mask_lgmap, seems much much better
connorjward Apr 28, 2026
fe084fa
Runs but gives the wrong result, progress!
connorjward Apr 28, 2026
7813b7c
Fix linesmoother tests by getting mask_lgmap working
connorjward Apr 29, 2026
ab4fd3c
cleanup
connorjward Apr 29, 2026
42f3417
cleanup
connorjward Apr 29, 2026
0afa226
Add a cache
connorjward Apr 29, 2026
be2b00f
Try to handle constraints in sections
connorjward Apr 29, 2026
d6c01ac
WIP on RFS for pmg
connorjward Apr 30, 2026
91cacf1
context fixes
connorjward Apr 30, 2026
d8b0cd4
Rejig visitors
connorjward May 1, 2026
071d0be
More traversal changes
connorjward May 1, 2026
0f92654
wip
connorjward May 2, 2026
dfc186b
wip
connorjward May 2, 2026
e0ad7f3
Traversal stuff there, now seeing a segfault
connorjward May 3, 2026
7c2a45c
Unpack tree subpackage
connorjward May 3, 2026
d3d2888
Move lower.py
connorjward May 3, 2026
1e9004f
more cleanup
connorjward May 3, 2026
1dae5c3
fixup
connorjward May 4, 2026
377ac91
Imports all fixed
connorjward May 5, 2026
8c74335
debugging, nicer tho
connorjward May 5, 2026
51bb7fe
Compilation improvements, make sure we aren't preprocessing and fix a…
connorjward May 6, 2026
c10b43a
It now runs but convergence is v bad
connorjward May 6, 2026
53b3363
RFS fixes, now just failing assign and mixed
connorjward May 7, 2026
6f541f0
fix for mixed bcs
connorjward May 7, 2026
cf3f83b
Fix lgmap a little
connorjward May 7, 2026
3d6c177
Redo assign
connorjward May 8, 2026
59055d5
Fixes for RFS
connorjward May 8, 2026
a648ee7
hacky fix for fieldsplit
connorjward May 8, 2026
8934202
only one rfs test failing
connorjward May 8, 2026
7e65be8
found the bug, bad node ordering for mg
connorjward May 8, 2026
8ed3511
rfs+mg fix
connorjward May 12, 2026
b50dccd
Move lgmaps code into generic location
connorjward May 12, 2026
30d2cbe
pmg fix for lgmaps
connorjward May 12, 2026
9406269
fixups, heading home
connorjward May 12, 2026
389f9f8
ArrayBuffer Lazy-assignment for GPU Context (#5076)
SamSJackson May 13, 2026
5dfaf75
Caching fix
connorjward May 13, 2026
83a0ee6
Slate fixes, nothing I can't handle
connorjward May 13, 2026
fa5fe59
Fix slate errs, buffers need a shape
connorjward May 15, 2026
a993af2
SLATE fixes, more to come
connorjward May 15, 2026
947e840
Fix for RT parloops, gah
connorjward May 15, 2026
8fd8987
Only a small handful of SLATE tests now failing
connorjward May 15, 2026
cb9e4ed
Fix for Real+PETSc
connorjward May 18, 2026
a86baef
Real fixes
connorjward May 18, 2026
ab702f7
Fix for .sub()
connorjward May 18, 2026
62949d2
Merge remote-tracking branch 'origin/connorjward/pyop3' into connorjw…
connorjward May 18, 2026
0e58f19
Merge remote-tracking branch 'origin/main' into connorjward/pyop3-dev…
connorjward May 18, 2026
d567270
Post merge fixes and start on MATIS
connorjward May 19, 2026
eac26c8
matis fix
connorjward May 19, 2026
435885a
wip
connorjward May 19, 2026
8723e58
skip parallel tests for the moment
connorjward May 19, 2026
c9b92a9
fixup
connorjward May 19, 2026
9afe6c5
add breakpoints, lgmaps look to be bad
connorjward May 19, 2026
43f9448
test fixed
connorjward May 19, 2026
ae11e15
VFS BCs tests passing now
connorjward May 20, 2026
6de1551
fixup
connorjward May 20, 2026
12a5e47
Fix mg transfer tests
connorjward May 20, 2026
f6d5e68
Fix all vom tests
connorjward May 21, 2026
18ba866
Lots and lots of nice fixes
connorjward May 21, 2026
92cd3be
netgen fixes
connorjward May 21, 2026
db115ff
WIP redoing nodal axes
connorjward May 22, 2026
feab02e
Start refactor of RFS sections
connorjward May 22, 2026
b465ff8
Fix things for RFS, now apparently mostly correct
connorjward May 22, 2026
c1afa82
fixups
connorjward May 26, 2026
e1f05b7
Fix form splitting and label propagation
connorjward May 26, 2026
345a922
fixup and undo regionless old hack
connorjward May 26, 2026
3698a0e
Get a parallel test passing and clean up exec.py
connorjward May 27, 2026
8101e69
Merge remote-tracking branch 'origin/main' into connorjward/pyop3-dev…
connorjward May 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/actions/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ runs:
run: |
: # Clone PETSc
if [ ${{ inputs.base_ref }} = 'main' ]; then
git clone --depth 1 https://gitlab.com/petsc/petsc.git
git clone --depth 1 https://gitlab.com/petsc/petsc.git --branch connorjward/pcpatch-fixups
elif [ ${{ inputs.base_ref }} = 'release' ]; then
git clone --depth 1 \
--branch $(python3 ./firedrake-repo/scripts/firedrake-configure --show-petsc-version) \
Expand Down
24 changes: 9 additions & 15 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,27 +123,21 @@ jobs:
firedrake-run-split-tests 1 1 -n 8 "$EXTRA_PYTEST_ARGS" firedrake-repo/tests/tsfc
timeout-minutes: 10

- name: Run PyOP2 tests
if: success() || steps.install.conclusion == 'success'
run: |
. venv/bin/activate
: # Use pytest-xdist here so we can have a single collated output (not possible
: # for parallel tests)
firedrake-run-split-tests 1 1 -n 8 "$EXTRA_PYTEST_ARGS" --timeout 30 firedrake-repo/tests/pyop2
firedrake-run-split-tests 2 4 "$EXTRA_PYTEST_ARGS" --timeout 30 firedrake-repo/tests/pyop2
firedrake-run-split-tests 3 2 "$EXTRA_PYTEST_ARGS" --timeout 30 firedrake-repo/tests/pyop2
firedrake-run-split-tests 4 2 "$EXTRA_PYTEST_ARGS" --timeout 30 firedrake-repo/tests/pyop2
timeout-minutes: 10

# TODO: parallel tests as well
# - name: Run pyop3 tests
# if: success() || steps.install.conclusion == 'success'
# run: |
# . venv/bin/activate
# firedrake-run-split-tests 1 1 -n 8 "$EXTRA_PYTEST_ARGS" --timeout 30 firedrake-repo/tests/pyop3
# timeout-minutes: 10

- name: Run Firedrake tests (nprocs = 1)
if: success() || steps.install.conclusion == 'success'
run: |
. venv/bin/activate
: # Use pytest-xdist here so we can have a single collated output (not possible
: # for parallel tests)
firedrake-run-split-tests 1 1 -n 8 "$EXTRA_PYTEST_ARGS" firedrake-repo/tests/firedrake
timeout-minutes: 90
# UNDO ME
timeout-minutes: 180

- name: Run tests (nprocs = 2)
if: success() || steps.install.conclusion == 'success'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ PyOP2.egg-info
sparsity.so
sparsity.c
sparsity.cpython*.so
*_cy.c
# Docs
pyop2.coffee.rst
pyop2.rst
Expand Down
4 changes: 2 additions & 2 deletions demos/boussinesq/boussinesq.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ implements a boundary condition that fixes a field at a single point. ::
# Take the basis function with the largest abs value at bc_point
v = TestFunction(V)
F = assemble(interpolate(inner(v, v), Fvom))
with F.dat.vec as Fvec:
with F.vec_ro as Fvec:
max_index, _ = Fvec.max()
nodes = V.dof_dset.lgmap.applyInverse([max_index])
nodes = V._lgmap.applyInverse([max_index])
nodes = nodes[nodes >= 0]
return nodes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ using a sparse direct LU factorization. ::
Moving on to a more complicated solver, we'll employ a two-level solver with
the lowest-order coarse space via :class:`~.P1PC`. As the fine level
relaxation we define an additive Schwarz method on vertex-star patches
implemented via :class:`~.ASMExtrudedStarPC` as we have an extruded mesh.
implemented via :class:`~.ASMStarPC`.
In addition we specify `"use_coloring"` to group non-overlapping subsets of
patches into sparse block-diagonal matrices via a mesh coloring, which reduces
the overhead of calling many KSP solves for each patch.::
Expand All @@ -116,7 +116,8 @@ the overhead of calling many KSP solves for each patch.::
"ksp_max_it": 1,
"ksp_type": "chebyshev",
"pc_type": "python",
"pc_python_type": "firedrake.ASMExtrudedStarPC",
"pc_python_type": "firedrake.ASMStarPC",
"pc_star_column": 0,
"pc_star_use_coloring": True,
"pc_star_sub_sub_pc_type": "lu",
},
Expand Down
2 changes: 1 addition & 1 deletion demos/immersed_fem/immersed_fem.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ We can load and check the generated meshes in Firedrake. ::
fig, ax = plt.subplots(len(meshes), 1, figsize = (8, len(meshes)*3), tight_layout=True)
for m, ax in zip(meshes, ax):
triplot(m, axes=ax)
ax.set_title(f'Mesh via {m.name}, # cells: {m.num_cells()}')
ax.set_title(f'Mesh via {m.name}, # cells: {m.num_cells}')
ax.legend(loc='upper left')

fig.savefig("gmsh_demo.png", dpi = 400)
Expand Down
4 changes: 2 additions & 2 deletions demos/multicomponent/multicomponent.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,9 @@ mathematically valid to do this)::
# Take the basis function with the largest abs value at bc_point
v = TestFunction(V)
F = assemble(interpolate(inner(v, v), Fvom))
with F.dat.vec as Fvec:
with F.vec as Fvec:
max_index, _ = Fvec.max()
nodes = V.dof_dset.lgmap.applyInverse([max_index])
nodes = V._lgmap.applyInverse([max_index])
nodes = nodes[nodes >= 0]
return nodes

Expand Down
6 changes: 3 additions & 3 deletions demos/netgen/netgen_mesh.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Then a SLEPc Eigenvalue Problem Solver (``EPS``) is initialised and set up to us
E.setST(ST)
E.solve()
vr, vi = Asc.getVecs()
with uh.dat.vec_wo as vr:
with uh.vec_wo as vr:
lam = E.getEigenpair(0, vr, vi)
return (lam, uh, V)

Expand All @@ -198,8 +198,8 @@ In order to do so we begin by computing the value of the indicator using a piece
part = .2
mark = Function(W)
# Filling in the marked element vector using eta.
with mark.dat.vec as markedVec:
with eta.dat.vec as etaVec:
with mark.vec as markedVec:
with eta.vec as etaVec:
sum_eta = etaVec.sum()
if sum_eta < tolerance:
return markedVec
Expand Down
8 changes: 4 additions & 4 deletions demos/parallel-printing/parprint.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ reports on the portion of the mesh it owns::

mesh = UnitSquareMesh(3, 3)
PETSc.Sys.Print(' rank %d owns %d elements and can access %d vertices' \
% (mesh.comm.rank, mesh.num_cells(), mesh.num_vertices()),
% (mesh.comm.rank, mesh.num_cells, mesh.num_vertices),
comm=COMM_SELF)

The *elements* of the mesh are owned uniquely in parallel, while the
Expand Down Expand Up @@ -64,15 +64,15 @@ To print the solution vector in serial one could write ``print(u.dat.data)``
but then in parallel each processor would show its data separately.
So using PETSc we do a "view" of the solution vector::

with u.dat.vec_ro as vu:
with u.vec_ro as vu:
vu.view()

Here ``vu`` is an instance of the PETSc.Vec class and ``vu.view()`` is the
equivalent of ``VecView(vu,NULL)`` using PETSc's C API. This Vec is "global",
meaning that each degree of freedom is stored on a unique process. The context manager
in the above usage (i.e. ``with ...``) allows Firedrake to generate a global Vec
by halo exchanges if needed. Here we only need read-only access here so we use
``u.dat.vec_ro``; note ``u.dat.vec`` would allow read-write access.
``u.vec_ro``; note ``u.vec`` would allow read-write access.

Finally we compute and print the numerical error, relative to the exact
solution, in two norms. The :math:`L^2` norm is computed with
Expand All @@ -88,7 +88,7 @@ gets the max over the process-owned entries. So again we use the ``PETSc.Vec``
approach::

udiffabs = Function(V).interpolate(abs(udiff))
with udiffabs.dat.vec_ro as v:
with udiffabs.vec_ro as v:
L_inf_err = v.max()[1]
PETSc.Sys.Print('L_2 error norm = %g, L_inf error norm = %g' \
% (L_2_err,L_inf_err))
Expand Down
12 changes: 6 additions & 6 deletions demos/saddle_point_pc/saddle_point_systems.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Finally, at each mesh size, we print out the number of cells in the
mesh and the number of iterations the solver took to converge ::

#
print(w.function_space().mesh().unique().num_cells(), solver.snes.ksp.getIterationNumber())
print(w.function_space().mesh().unique().num_cells, solver.snes.ksp.getIterationNumber())

The resulting convergence is unimpressive:

Expand Down Expand Up @@ -282,7 +282,7 @@ applying the action of blocks, so we can use a block matrix format. ::
for n in range(8):
solver, w = build_problem(n, parameters, block_matrix=True)
solver.solve()
print(w.function_space().mesh().unique().num_cells(), solver.snes.ksp.getIterationNumber())
print(w.function_space().mesh().unique().num_cells, solver.snes.ksp.getIterationNumber())

The resulting convergence is algorithmically good, however, the larger
problems still take a long time.
Expand Down Expand Up @@ -367,7 +367,7 @@ Let's see what happens. ::
for n in range(8):
solver, w = build_problem(n, parameters, block_matrix=True)
solver.solve()
print(w.function_space().mesh().unique().num_cells(), solver.snes.ksp.getIterationNumber())
print(w.function_space().mesh().unique().num_cells, solver.snes.ksp.getIterationNumber())

This is much better, the problem takes much less time to solve and
when observing the iteration counts for inverting :math:`S` we can see
Expand Down Expand Up @@ -422,7 +422,7 @@ and so we no longer need a flexible Krylov method. ::
for n in range(8):
solver, w = build_problem(n, parameters, block_matrix=True)
solver.solve()
print(w.function_space().mesh().unique().num_cells(), solver.snes.ksp.getIterationNumber())
print(w.function_space().mesh().unique().num_cells, solver.snes.ksp.getIterationNumber())

This results in the following GMRES iteration counts

Expand Down Expand Up @@ -487,7 +487,7 @@ variable. We can provide it as an :class:`~.AuxiliaryOperatorPC` via a python pr
for n in range(8):
solver, w = build_problem(n, parameters, aP=None, block_matrix=False)
solver.solve()
print(w.function_space().mesh().unique().num_cells(), solver.snes.ksp.getIterationNumber())
print(w.function_space().mesh().unique().num_cells, solver.snes.ksp.getIterationNumber())

This actually results in slightly worse convergence than the diagonal
approximation we used above.
Expand Down Expand Up @@ -571,7 +571,7 @@ Let's see what the iteration count looks like now. ::
for n in range(8):
solver, w = build_problem(n, parameters, aP=riesz, block_matrix=True)
solver.solve()
print(w.function_space().mesh().unique().num_cells(), solver.snes.ksp.getIterationNumber())
print(w.function_space().mesh().unique().num_cells, solver.snes.ksp.getIterationNumber())

============== ==================
Mesh elements GMRES iterations
Expand Down
7 changes: 1 addition & 6 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['old_pyop2']
exclude_patterns = []

# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
Expand Down Expand Up @@ -141,10 +141,6 @@
(r'py:.*', r'ufl\..*'),
(r'py:.*', r'PETSc\..*'),
(r'py:.*', r'progress\..*'),
# Ignore undocumented PyOP2
('py:class', 'pyop2.caching.Cached'),
('py:class', 'pyop2.op2.Kernel'),
('py:class', 'pyop2.types.mat.Mat'),
# Ignore mission docs from Firedrake internal "private" code
# Any "Base" class eg:
# firedrake.adjoint.checkpointing.CheckpointBase
Expand Down Expand Up @@ -425,7 +421,6 @@
# -- Options for intersphinx ---------------------------------------------

intersphinx_mapping = {
'pyop2': ('https://op2.github.io/PyOP2', None),
'ufl': ('https://docs.fenicsproject.org/ufl/main/', None),
'FIAT': ('https://firedrakeproject.org/fiat', None),
'petsctools': ('https://firedrakeproject.org/petsctools/', None),
Expand Down
4 changes: 2 additions & 2 deletions docs/source/ensemble_parallelism.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ on each ensemble member.
Internally, the :class:`~.EnsembleFunction` creates a ``PETSc.Vec``
on the ``Ensemble.global_comm`` which contains the data for all
local components on all ensemble members. This ``Vec`` can be accessed
with a context manager, similarly to the ``Function.dat.vec`` context
with a context manager, similarly to the ``Function.vec`` context
managers used to access :class:`~.Function` data. There are also
analogous ``vec_ro`` and ``vec_wo`` context managers for read/write
only accesses. However note that, unlike the ``Function.dat.vec``
only accesses. However note that, unlike the ``Function.vec``
context managers, the ``EnsembleFunction.vec`` context managers
need braces i.e. ``vec()`` not ``vec``.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/external_operators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ of `N` can be assembled:
integral_types = set(['cell'])
assembly_opts = kwargs.get('assembly_opts')
J = self._matrix_builder((), assembly_opts, integral_types)
with dNdu.dat.vec as vec:
with dNdu.vec_ro as vec:
J.petscmat.setDiagonal(vec)
return J

Expand Down
2 changes: 0 additions & 2 deletions docs/source/old_pyop2/Makefile

This file was deleted.

Loading
Loading