Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT SQUASH Absorb TSFC #3904

Merged
merged 1,040 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
1040 commits
Select commit Hold shift + click to select a range
e299c95
Test impero flop counting by comparing to loopy
AndrewWhitmell Jun 23, 2021
9ca4cdb
Correct shapes for Variables representing Real coefficients
wence- Jul 9, 2021
50c70e9
Merge pull request #252 from AWhitmell/andrew/benchmarking
wence- Jul 12, 2021
4e6c2d2
Refactor prepare_coefficients
connorjward Aug 17, 2021
cdec3fd
WIP Track argument metadata
connorjward Aug 16, 2021
9c89988
WIP Tests now passing
connorjward Aug 17, 2021
80a4067
Remove old-style class declaration
connorjward Aug 17, 2021
3543bd7
finatinterface: Handle Real space on quads/hexes
wence- Aug 18, 2021
f1915a9
compile_expression: Remove coffee option
wence- Aug 18, 2021
8e88be3
kernels: move responsibility for flop counting to builder
wence- Aug 18, 2021
4bfaba4
compile_expression: Remove loopy-specific return arg construction
wence- Aug 18, 2021
30ef396
coffee: Remove expression kernel builder
wence- Aug 18, 2021
45bd741
Add CoordinatesKernelArg class
connorjward Aug 18, 2021
11bc205
Track unflattened shape information
connorjward Aug 18, 2021
897adba
Make {Interior,Exterior}FacetKernelArg into classes again
connorjward Aug 18, 2021
ab408a9
Add ConstantKernelArg
connorjward Aug 19, 2021
4e76a30
Fix constructor bug and add safeguard
connorjward Aug 23, 2021
7fdf0ee
Modify return_shape to work with interpolation
connorjward Aug 23, 2021
f7fa936
Nasty hack for interpolation shapes
connorjward Aug 24, 2021
22ca847
Merge pull request #256 from firedrakeproject/wence/feature/swarm-upd…
wence- Aug 25, 2021
2404c96
c_e_d_e: Move dual evaluation to FInAT
mkan88 Jun 5, 2020
26942fd
c_e_d_e: UFLtoGEMCallback -> DualEvaluationCallable
ReubenHill Jun 18, 2021
ea56fd1
c_e_d_e: Remove unnecessary tensor finite element optimisation
ReubenHill Jul 14, 2021
0ae6bad
c_e_d_e: adjust to new FInAT dual_evaluation API
ReubenHill Jul 22, 2021
17ef560
c_e_d_e: Fix translation context dispatch
ReubenHill Jul 27, 2021
bdf838c
c_e_d_e: Remove .factors in DualEvaluationCallable
ReubenHill Aug 19, 2021
839da10
c_e_d_e: Rename ir -> evaluation for clarity
ReubenHill Aug 20, 2021
9074dad
c_e_d_e: restore QuadratureElement interpolation
ReubenHill Aug 23, 2021
293c97e
tests: Check that interpolation sum factorises for simple cases
wence- Aug 25, 2021
6454c66
Merge pull request #250 from firedrakeproject/ReubenHill/finat-dual-eval
wence- Aug 26, 2021
99f16f9
Merge remote-tracking branch 'origin/master' into connorjward/track-a…
connorjward Sep 20, 2021
3b72357
Some more firedrake interpolation tests passing
connorjward Sep 21, 2021
914be97
Add new KernelArg types for different rank outputs
connorjward Sep 21, 2021
8c2b362
Split basis_shape and node_shape - Firedrake assembly working
connorjward Sep 22, 2021
f296925
Add tensor element checks - now onto coeffs
connorjward Sep 22, 2021
5b47a7a
Add basis_shape to more objects
connorjward Sep 22, 2021
8a0b4e6
Add is_output option to kernel args
connorjward Sep 22, 2021
a8f6f76
Add split_shape method as part of refactor
connorjward Sep 23, 2021
000949b
Handle UFL real family case for argument
connorjward Sep 23, 2021
970e64e
Remove breakpoint
connorjward Sep 30, 2021
986f95c
Made some updates
connorjward Oct 6, 2021
dc9b62f
WIP
connorjward Oct 6, 2021
0b4f3c5
finatinterface: Handle tensor elements with shaped sub element
wence- Aug 27, 2021
0c948a9
interpolation: New API
wence- Aug 27, 2021
29c6938
utils: Generalise apply_mapping to handle arbitrary rank expressions
wence- Aug 27, 2021
5c8a294
utils: Implement pullback inverse for symmetries
wence- Aug 27, 2021
ea6d56f
Merge pull request #260 from firedrakeproject/wence/feature/faster-ty…
wence- Oct 11, 2021
fe784f2
Merge pull request #262 from firedrakeproject/wence/feature/interpola…
wence- Oct 12, 2021
fd3b337
All tests passing following arg refactor
connorjward Oct 14, 2021
d0dca01
Refactor facet kernel arguments
connorjward Oct 14, 2021
e563c9e
WIP
connorjward Oct 15, 2021
c84a5c3
Fix silly typo breaking mixed-space tests in Firedrake
connorjward Oct 15, 2021
9099a7e
Linting
connorjward Oct 15, 2021
0ad2b9b
Merge remote-tracking branch 'origin/master' into connorjward/track-a…
connorjward Oct 15, 2021
604d69d
Add function space ID information to kernel args
connorjward Oct 19, 2021
5d98478
Empty kernels included in output
connorjward Oct 25, 2021
3153275
Expunge function_space_id
connorjward Nov 1, 2021
3442124
Stop returning empty kernels
connorjward Nov 3, 2021
ad653a6
Ugly hack for interior facet horiz integrals
connorjward Nov 4, 2021
af4c715
Refactor kernel_args.py
connorjward Nov 5, 2021
20e7972
Add TabulationKernelArg
connorjward Nov 5, 2021
2c3f3a7
Add empty arguments to old interface kernel
connorjward Nov 8, 2021
b5f57c2
Track real tensor product information
connorjward Nov 10, 2021
88a3edc
Fix tensor tensorproduct elements
connorjward Nov 10, 2021
b3b1a1d
Fix linting
connorjward Nov 17, 2021
8143b72
Expunge isreal nonsense
connorjward Nov 17, 2021
523ce6d
Make some changes
connorjward Dec 3, 2021
0637ec5
Cleanup
connorjward Dec 7, 2021
20a87a1
Also works for COFFEE
connorjward Dec 7, 2021
01005cc
Tidy up
connorjward Dec 7, 2021
ee84be7
Tidying up
connorjward Dec 7, 2021
cb10595
Added fdm variant for TP elements
pbrubeck Dec 7, 2021
1d29686
reorder CG variants
pbrubeck Dec 7, 2021
2c50e0d
Linting and docstrings
connorjward Jan 13, 2022
3b31531
Remove deprecated argument to get_op_map
connorjward Jan 13, 2022
731db9e
Merge branch 'fix-deprecated-numpy-types' into connorjward/track-arg-…
connorjward Jan 13, 2022
b0baabb
add FDMHermite, and wrap FDMLagrange with DiscontinuousElement for DG…
pbrubeck Jan 17, 2022
6b19423
Merge pull request #266 from firedrakeproject/fix-deprecated-numpy-types
wence- Jan 17, 2022
747f11f
Merge remote-tracking branch 'origin/master' into pbrubeck/fdm-element
pbrubeck Jan 18, 2022
7331481
Merge pull request #257 from firedrakeproject/connorjward/track-arg-info
dham Feb 3, 2022
d30d819
Merge pull request #265 from firedrakeproject/pbrubeck/fdm-element
dham Feb 3, 2022
36d2690
refactor: introduce prepare_parameters()
ksagiyam Sep 1, 2021
99ed32e
refactor: add set_quad_rule()
ksagiyam Sep 1, 2021
df1ea4a
refactor: add get_index_ordering()/get_index_names()
ksagiyam Sep 4, 2021
f49b3ff
refactor: KernelBuilder takes TSFCIntegralDataInfo
ksagiyam Sep 1, 2021
75a2fac
refactor: introduce KernelBuilderMixin()
ksagiyam Sep 1, 2021
7993ae0
refactor: add builder.create_context()
ksagiyam Sep 2, 2021
9c246fb
refactor: change builder.set_arguments()
ksagiyam Sep 3, 2021
0a1421c
refactor: add builder.fem_config()
ksagiyam Sep 3, 2021
e06901d
refactor: add builder.compile_integrand()
ksagiyam Sep 3, 2021
db77ffb
refactor: add builder.construct_integrals()
ksagiyam Sep 4, 2021
fe135bd
refactor: add builder.stash_integrals()
ksagiyam Sep 4, 2021
137ec77
refactor: add builder.compile_gem()
ksagiyam Sep 4, 2021
47143ac
refactor: pass ctx to builder.construct_kernel()
ksagiyam Sep 4, 2021
46fc000
refactor: move get_index_names()
ksagiyam Sep 4, 2021
a37d85b
refactor: remove unused 'quadrature_rule' attribute from Kernel
ksagiyam Sep 4, 2021
f1019d6
refactor: construct Kernel in one shot
ksagiyam Sep 4, 2021
8076e8b
refactor: move some functions from driver to kernel_interface/common
ksagiyam Sep 4, 2021
c33c15d
Merge pull request #261 from firedrakeproject/ksagiyam/tsfc_refactor_1
dham Feb 10, 2022
f5d59b2
driver: raise NotImplementedError for diagonal + interior_facet
wence- Feb 25, 2022
ff2842c
TSFC loopy: translate bessel functions with right naming depending on…
sv2518 Mar 1, 2022
e28cd46
Loopy: set standard target to CWithGNULibcTarget in params.
sv2518 Mar 2, 2022
6fffdbf
Merge pull request #269 from firedrakeproject/wence/fix/diagonal-inte…
wence- Mar 4, 2022
bde743f
Merge pull request #270 from firedrakeproject/bessel_functions
dham Mar 4, 2022
e51d39e
Replace ExpressionKernel coefficients with coefficient_numbers
connorjward Feb 16, 2022
6160a17
Profiling: add profiling to local kernels. Memory for events is alloc…
sv2518 Feb 11, 2022
57c9d7f
Profiling: Set event id to default value and let PyOP2 generate the e…
sv2518 Feb 15, 2022
2f59112
Rename first_coefficient_fake_coords to needs_external_coords
connorjward Apr 1, 2022
dc05052
fem: Constant fold literal zeros when compiling UFL
wence- Apr 7, 2022
98cb64d
tests: Introduce test for #274
wence- Apr 7, 2022
9d80519
Merge pull request #268 from firedrakeproject/connorjward/expunge-dua…
dham Apr 8, 2022
845ee8b
Merge branch 'master' into sv/profiling-local-kernels-trackevents
dham Apr 8, 2022
7fd72da
Merge pull request #273 from firedrakeproject/sv/profiling-local-kern…
dham Apr 8, 2022
1cffc2e
Fix for conflicting merges
connorjward Apr 8, 2022
9f9dbf3
Merge pull request #276 from firedrakeproject/fix-coefficient_numbers
dham Apr 8, 2022
a3a0c00
kernel builder: generate kernel args in builder.construct_kernel
ksagiyam Feb 28, 2022
244d3d4
kernel builder: only generate/include kernel args for active coeffici…
ksagiyam Mar 2, 2022
0764497
Merge remote-tracking branch 'origin/master' into trimmedSerendipity
rckirby Jun 23, 2022
6181953
fiatinterface bye bye
rckirby Jun 29, 2022
459125a
Merge pull request #277 from firedrakeproject/trimmedSerendipity
dham Jun 29, 2022
820ce05
Merge pull request #271 from firedrakeproject/ksagiyam/only_use_enabl…
dham Jun 30, 2022
475b778
Merge pull request #275 from firedrakeproject/wence/fix/issue-274-maybe
dham Jul 28, 2022
cbac105
Revert "Maybe fix issue 274"
ksagiyam Aug 3, 2022
19584f8
Merge pull request #281 from firedrakeproject/revert-275-wence/fix/is…
wence- Aug 3, 2022
b95735e
fem: Constant fold literal zeros when compiling UFL
wence- Aug 3, 2022
9057cb4
tests: Introduce test for #274
wence- Aug 3, 2022
7205eab
optimise: New pass for ListTensor in constant_fold_zero()
ksagiyam Aug 3, 2022
f9b6659
Merge pull request #282 from firedrakeproject/ksagiyam/fix-issue-274-…
ksagiyam Sep 8, 2022
ae5681c
finatinterface: set hexahedral_tcp = interval x interval x interval
ksagiyam Nov 13, 2022
e4bb737
driver: disallow interior facet integration in hex meshes
ksagiyam Nov 16, 2022
5bc89cf
Merge pull request #284 from firedrakeproject/ksagiyam/orientations
ksagiyam Dec 8, 2022
95208e2
don't import GREEN from ufl.log
mscroggs Dec 21, 2022
7cea651
Merge pull request #285 from mscroggs/GREEN
wence- Jan 9, 2023
1282243
Interface for hierarchical and FDM variants
pbrubeck Feb 13, 2023
45503fc
replace ufl_domain with extract_unique_domain
APaganini Feb 13, 2023
c5bd9ec
more replacements in fem.py
APaganini Feb 14, 2023
ee18d00
Use .subfunctions instead of .split()
angus-g Mar 10, 2023
21d0ba7
Merge pull request #289 from angus-g/patch-1
ReubenHill Mar 10, 2023
961fafb
Merge pull request #288 from firedrakeproject/ap/extract_unique_domain
JDBetteridge Apr 26, 2023
650004b
Expunge COFFEE (#291)
connorjward May 10, 2023
51c8790
Merge pull request #287 from firedrakeproject/pbrubeck/fdm-discontinuous
dham May 10, 2023
3da48a0
Constant refactoring (#294)
JDBetteridge Jun 14, 2023
f2c26af
Fix logical not
connorjward Jun 26, 2023
a293610
Merge pull request #296 from firedrakeproject/connorjward/fix-logical…
connorjward Jun 27, 2023
96b42c0
Adapt to UFL changes in subdomain_id (#297)
connorjward Sep 12, 2023
2da821c
Register BDMc elements (#197)
cyruscycheng21 Sep 20, 2023
f37037a
UFL have changed spelling of atan2
dham Sep 22, 2023
41f6c15
Merge pull request #299 from firedrakeproject/fix_atan2
dham Sep 22, 2023
06e4ec2
Do not use constant names in generated code (#298)
connorjward Sep 26, 2023
92f8d1e
Default spectral variant on simplices
pbrubeck Oct 14, 2023
dc674da
fix most tests
pbrubeck Nov 10, 2023
c8b0805
Update UFL element interface: move elements to FInAT (#302)
mscroggs Nov 15, 2023
868111b
Merge branch 'master' into pbrubeck/simplex-spectral
pbrubeck Nov 15, 2023
106b651
Apply suggestions from code review
pbrubeck Nov 15, 2023
362e893
Apply suggestions from code review
pbrubeck Nov 15, 2023
49cf025
Merge pull request #301 from firedrakeproject/pbrubeck/simplex-spectral
connorjward Nov 17, 2023
a3ebf0c
Expunge Expr.ufl_domain()
pbrubeck Nov 23, 2023
c28cb76
Merge pull request #304 from firedrakeproject/pbrubeck/expunge-ufl-do…
dham Nov 29, 2023
33eeb06
CG/DG integral variants on simplices
pbrubeck Dec 2, 2023
1620ed9
Support IntegratedLegendre variants
pbrubeck Dec 31, 2023
ab84e03
geometric -> topological
mscroggs Jan 22, 2024
bf8b9c4
value_shape(mesh)
mscroggs Jan 22, 2024
8a90e36
fix tests
mscroggs Jan 22, 2024
21f29cc
move value_shape to function space
mscroggs Jan 29, 2024
6c5abf1
missing space
mscroggs Jan 29, 2024
bb94ad5
didn't mean to commit that line
mscroggs Jan 29, 2024
cf44ac9
Merge pull request #308 from firedrakeproject/pbrubeck/cg-dg-integral
dham Feb 7, 2024
1ce1d0a
Implementation of Hu-Zhang elements
FAznaran Mar 20, 2024
40cf2cd
Merge remote-tracking branch 'origin/master' into faznaran/hu-zhang
FAznaran Mar 26, 2024
34b4d59
Let FIAT handle general CG/DG variants
pbrubeck Mar 28, 2024
7b2fb38
pass the variant
pbrubeck Mar 28, 2024
769e707
fix tests
pbrubeck Apr 2, 2024
d22862d
WIP: enable macro-quadrature
rckirby Apr 3, 2024
5322882
flake8
rckirby Apr 3, 2024
18e544e
Merge branch 'rckirby/feature/macro' of github.com:firedrakeproject/t…
pbrubeck Apr 3, 2024
6cc1cbb
Handle quadrature for macro elements
pbrubeck Apr 3, 2024
49a92f6
do not create complex on Real (Constant) spaces
pbrubeck Apr 4, 2024
19d1357
handle integral variants
pbrubeck Apr 4, 2024
f705034
use finat's max complex logic
rckirby Apr 4, 2024
2c04072
fix an error, flake8
rckirby Apr 4, 2024
a16c5da
lower integral type on the final cell
pbrubeck Apr 4, 2024
a6eb85e
merging
rckirby Apr 5, 2024
aabac3c
merge conflict
pbrubeck Apr 6, 2024
e1baceb
Merge branch 'rckirby/feature/macro' of github.com:firedrakeproject/t…
rckirby Apr 10, 2024
71411c2
register HCT
pbrubeck Apr 12, 2024
a915e8b
Merge branch 'rckirby/feature/macro' of github.com:firedrakeproject/t…
rckirby Apr 16, 2024
47653dc
Add reduced element
rckirby Apr 20, 2024
9a3b947
add the Johnson-Mercier macro element
pbrubeck Apr 28, 2024
cce81db
Merge pull request #310 from firedrakeproject/rckirby/feature/macro
rckirby May 1, 2024
c1ee748
Merge branch 'master' into pbrubeck/feature/johnson-mercier
pbrubeck May 1, 2024
faa1bc0
Merge branch 'master' into mscroggs/gdim
mscroggs May 3, 2024
c8cb7d7
Support covariant contravariant piola mapping for H(curl div)
pbrubeck May 6, 2024
9a5cc7b
Add GLS H(curl div) element
pbrubeck May 6, 2024
17776a2
JDBetteridge/numpy2 rebase (#313)
JDBetteridge Jun 7, 2024
aaf1877
Remove ReducedJohnsonMercier
pbrubeck Jun 11, 2024
1ea9a33
Zany transformations in 3D
pbrubeck Jun 17, 2024
dc0c5fb
make failure explicit in non-triangle physical normal
rckirby Jun 18, 2024
b9e298f
merging fem.py
rckirby Jun 18, 2024
df877b8
disable the physical normals on non-ufc-triangle
rckirby Jun 18, 2024
a7bc5f4
lint
rckirby Jun 18, 2024
63d7203
Update logic
rckirby Jun 19, 2024
4b0e76e
Merge pull request #311 from firedrakeproject/pbrubeck/feature/johnso…
dham Jun 19, 2024
8abe8b3
Enable variants for Argyris
pbrubeck Jun 27, 2024
3b0d579
numpy 2.0 fix
pbrubeck Jun 28, 2024
1f7c9c0
Merge branch 'master' into mscroggs/gdim
mscroggs Jul 4, 2024
d9811bf
Merge pull request #314 from firedrakeproject/pbrubeck/argyris-variant
rckirby Jul 11, 2024
01a3ee1
Add PS6 element
rckirby Jul 18, 2024
162bde1
add PS12 to finat interface
rckirby Jul 19, 2024
2e46fbf
Add QuadraticPowellSabin{6|12} (#315)
pbrubeck Jul 23, 2024
bdb8daf
Clean up variants
pbrubeck Aug 19, 2024
c360b14
Merge pull request #316 from firedrakeproject/pbrubeck/cleanup-variants
rckirby Aug 19, 2024
d4fb7d8
Add the Alfeld-Sorokina triangular macroelement
pbrubeck Sep 14, 2024
91dc72d
Add the Arnold-Qin and Reduced Arnold-Qin macroelements
pbrubeck Sep 19, 2024
c419e1a
Add Bernardi-Raugel
pbrubeck Sep 25, 2024
9e08e47
add Christiansen-Hu
pbrubeck Oct 1, 2024
6d992c5
add Guzman-Neilan
pbrubeck Oct 3, 2024
13ea69f
Add Guzman-Neilan Bubble
pbrubeck Oct 3, 2024
00a180d
add Bernardi-Raugel Bubble
pbrubeck Oct 6, 2024
4a15ff4
Merge pull request #319 from firedrakeproject/pbrubeck/alfeld-sorokina
rckirby Oct 8, 2024
efa8e4a
Guzman-Neilan H1(div) macroelement (#320)
pbrubeck Oct 16, 2024
bb08e00
Remove old warning about COFFEE (#321)
connorjward Oct 21, 2024
88319e6
Use make_kernel to force entrypoint registration
connorjward Oct 22, 2024
617f28d
Merge branch 'master' into pbrubeck/hcurldiv
pbrubeck Oct 24, 2024
aee878a
Refactor variants
pbrubeck Oct 24, 2024
52e26a6
Merge branch 'pbrubeck/hhj' into pbrubeck/hcurldiv
pbrubeck Oct 25, 2024
cd7db4d
Merge branch 'master' into faznaran/hu-zhang
pbrubeck Oct 27, 2024
53d6ca7
Merge branch 'pbrubeck/hhj' into faznaran/hu-zhang
pbrubeck Oct 28, 2024
5db6c26
Merge branch 'faznaran/hu-zhang' into pbrubeck/hcurldiv
pbrubeck Oct 28, 2024
c9449e8
GLS 1st and 2nd kinds
pbrubeck Oct 30, 2024
090e304
generalise VariableIndex and FlexiblyIndexed (#317)
ksagiyam Nov 6, 2024
51cd87d
Merge pull request #312 from firedrakeproject/pbrubeck/hcurldiv
pbrubeck Nov 6, 2024
830b26f
Merge pull request #325 from firedrakeproject/faznaran/hu-zhang
pbrubeck Nov 6, 2024
9fa7e7f
Merge branch 'master' into pbrubeck/hhj
pbrubeck Nov 6, 2024
1762644
Merge branch 'pbrubeck/hhj' of github.com:firedrakeproject/tsfc into …
pbrubeck Nov 6, 2024
d88a0fe
merge conflict
pbrubeck Nov 12, 2024
07aa702
Get value_value size from FunctionSpace
pbrubeck Nov 13, 2024
dc51465
get physical_value_shape from ufl.pullback
pbrubeck Nov 13, 2024
ec99b2b
Merge pull request #307 from firedrakeproject/mscroggs/gdim
pbrubeck Nov 15, 2024
8458d3a
Merge branch 'master' into pbrubeck/hhj
pbrubeck Nov 18, 2024
7552cfc
Merge pull request #324 from firedrakeproject/pbrubeck/hhj
pbrubeck Nov 19, 2024
8e5c18c
Clean up variants
pbrubeck Nov 20, 2024
8abfc99
gem: attach dtype to every node (#327)
ksagiyam Nov 20, 2024
3447cbc
Merge branch 'master' into pbrubeck/fix/variants
pbrubeck Nov 25, 2024
8e690c6
Merge pull request #332 from firedrakeproject/pbrubeck/fix/variants
pbrubeck Nov 25, 2024
00b7477
Redo loopy loop priorities (#333)
connorjward Nov 28, 2024
bafe45d
Merge remote-tracking branch 'tsfc/master' into connorjward/add-tsfc
connorjward Dec 4, 2024
5dad275
Move TSFC into Firedrake repository
connorjward Dec 4, 2024
d952afc
Fixup firedrake-zenodo
connorjward Dec 5, 2024
bb0d8fd
Make firedrake-update handle archived repos
connorjward Dec 6, 2024
c9f4d32
Point at the correct FIAT branch
connorjward Dec 6, 2024
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
26 changes: 15 additions & 11 deletions .github/workflows/pyop2.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
name: PyOP2
name: Test PyOP2 and TSFC

# Trigger the workflow on push or pull request,
# but only for the master branch
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
Expand Down Expand Up @@ -88,29 +84,37 @@ jobs:
make
make install

- name: Checkout PyOP2
- name: Checkout Firedrake
uses: actions/checkout@v4
with:
path: PyOP2
path: firedrake

- name: Install PyOP2 dependencies
shell: bash
working-directory: PyOP2
working-directory: firedrake
run: |
source ../venv/bin/activate
python -m pip install -U pip
python -m pip install -U pytest-timeout

- name: Install PyOP2
shell: bash
working-directory: PyOP2
working-directory: firedrake
run: |
source ../venv/bin/activate
python -m pip install -v ".[test]"

- name: Run tests
- name: Run TSFC tests
shell: bash
working-directory: firedrake
run: |
source ../venv/bin/activate
pytest --tb=native --timeout=480 --timeout-method=thread -o faulthandler_timeout=540 -v tests/tsfc
timeout-minutes: 10

- name: Run PyOP2 tests
shell: bash
working-directory: PyOP2
working-directory: firedrake
run: |
source ../venv/bin/activate
# Running parallel test cases separately works around a bug in pytest-mpi
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ lint:
@python -m flake8 $(FLAKE8_FORMAT) pyop2
@echo " Linting PyOP2 scripts"
@python -m flake8 $(FLAKE8_FORMAT) pyop2/scripts --filename=*
@echo " Linting TSFC"
@python -m flake8 $(FLAKE8_FORMAT) tsfc

actionlint:
@echo " Pull latest actionlint image"
Expand Down
16 changes: 3 additions & 13 deletions firedrake/scripts/firedrake-zenodo
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,25 @@ import datetime

# Change this to https://sandbox.zenodo.org/api for testing
ZENODO_URL = "https://zenodo.org/api"
# TODO: Remove "petsc4py" once all users have switched to "petsc/src/binding/petsc4py".
# And the same for slepc4py.
descriptions = OrderedDict([
("firedrake", "an automated finite element system"),
("tsfc", "The Two Stage Form Compiler"),
("ufl", "The Unified Form Language"),
("FInAT", "a smarter library of finite elements"),
("fiat", "The Finite Element Automated Tabulator"),
("petsc", "Portable, Extensible Toolkit for Scientific Computation"),
("petsc4py", "The Python interface to PETSc"),
("loopy", "Transformation-Based Generation of High-Performance CPU/GPU Code"),
("slepc", "Scalable Library for Eigenvalue Problem Computations"),
("slepc4py", "The Python interface to SLEPc")])
("slepc", "Scalable Library for Eigenvalue Problem Computations")])

projects = dict(
[("firedrake", "firedrakeproject"),
("tsfc", "firedrakeproject"),
connorjward marked this conversation as resolved.
Show resolved Hide resolved
("ufl", "firedrakeproject"),
("FInAT", "FInAT"),
("fiat", "firedrakeproject"),
("petsc", "firedrakeproject"),
("petsc4py", "firedrakeproject"),
("loopy", "firedrakeproject"),
("slepc", "firedrakeproject"),
("slepc4py", "firedrakeproject")])
("slepc", "firedrakeproject")])

components = list(descriptions.keys())

optional_components = ("slepc", "slepc4py", "petsc4py")
optional_components = ("slepc",)

parser = ArgumentParser(description="""Create Zenodo DOIs for specific versions of Firedrake components.

Expand Down
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ dependencies = [
"scipy",
"sympy",
"fenics-ufl @ git+https://github.com/firedrakeproject/ufl.git",
"fenics-fiat @ git+https://github.com/firedrakeproject/fiat.git",
"finat @ git+https://github.com/FInAT/FInAT.git",
"tsfc @ git+https://github.com/firedrakeproject/tsfc.git",
"fenics-fiat @ git+https://github.com/firedrakeproject/fiat.git@connorjward/add-finat-gem",
connorjward marked this conversation as resolved.
Show resolved Hide resolved
"pyadjoint-ad @ git+https://github.com/dolfin-adjoint/pyadjoint.git",
"loopy @ git+https://github.com/firedrakeproject/loopy.git@main",
]
Expand Down
4 changes: 1 addition & 3 deletions requirements-git.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
git+https://github.com/firedrakeproject/ufl.git#egg=fenics-ufl
git+https://github.com/firedrakeproject/fiat.git#egg=fenics-fiat
git+https://github.com/FInAT/FInAT.git#egg=finat
git+https://github.com/firedrakeproject/tsfc.git#egg=tsfc
git+https://github.com/firedrakeproject/fiat.git@connorjward/add-finat-gem#egg=fenics-fiat
connorjward marked this conversation as resolved.
Show resolved Hide resolved
git+https://github.com/dolfin-adjoint/pyadjoint.git#egg=pyadjoint-ad
git+https://github.com/firedrakeproject/loopy.git@main#egg=loopy
git+https://github.com/firedrakeproject/pytest-mpi.git@main#egg=pytest-mpi
Expand Down
30 changes: 30 additions & 0 deletions tests/tsfc/test_codegen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import pytest

from gem import impero_utils
from gem.gem import Index, Indexed, IndexSum, Product, Variable


def test_loop_fusion():
i = Index()
j = Index()
Ri = Indexed(Variable('R', (6,)), (i,))

def make_expression(i, j):
A = Variable('A', (6,))
s = IndexSum(Indexed(A, (j,)), (j,))
return Product(Indexed(A, (i,)), s)

e1 = make_expression(i, j)
e2 = make_expression(i, i)

def gencode(expr):
impero_c = impero_utils.compile_gem([(Ri, expr)], (i, j))
return impero_c.tree

assert len(gencode(e1).children) == len(gencode(e2).children)


if __name__ == "__main__":
import os
import sys
pytest.main(args=[os.path.abspath(__file__)] + sys.argv[1:])
78 changes: 78 additions & 0 deletions tests/tsfc/test_coffee_optimise.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import pytest

from gem.gem import Index, Indexed, Product, Variable, Division, Literal, Sum
from gem.optimise import replace_division
from tsfc.coffee_mode import optimise_expressions


def test_replace_div():
i = Index()
A = Variable('A', ())
B = Variable('B', (6,))
Bi = Indexed(B, (i,))
d = Division(Bi, A)
result, = replace_division([d])
expected = Product(Bi, Division(Literal(1.0), A))

assert result == expected


def test_loop_optimise():
I = 20
J = K = 10
i = Index('i', I)
j = Index('j', J)
k = Index('k', K)

A1 = Variable('a1', (I,))
A2 = Variable('a2', (I,))
A3 = Variable('a3', (I,))
A1i = Indexed(A1, (i,))
A2i = Indexed(A2, (i,))
A3i = Indexed(A3, (i,))

B = Variable('b', (J,))
C = Variable('c', (J,))
Bj = Indexed(B, (j,))
Cj = Indexed(C, (j,))

E = Variable('e', (K,))
F = Variable('f', (K,))
G = Variable('g', (K,))
Ek = Indexed(E, (k,))
Fk = Indexed(F, (k,))
Gk = Indexed(G, (k,))

Z = Variable('z', ())

# Bj*Ek + Bj*Fk => (Ek + Fk)*Bj
expr = Sum(Product(Bj, Ek), Product(Bj, Fk))
result, = optimise_expressions([expr], (j, k))
expected = Product(Sum(Ek, Fk), Bj)
assert result == expected

# Bj*Ek + Bj*Fk + Bj*Gk + Cj*Ek + Cj*Fk =>
# (Ek + Fk + Gk)*Bj + (Ek+Fk)*Cj
expr = Sum(Sum(Sum(Sum(Product(Bj, Ek), Product(Bj, Fk)), Product(Bj, Gk)),
Product(Cj, Ek)), Product(Cj, Fk))
result, = optimise_expressions([expr], (j, k))
expected = Sum(Product(Sum(Sum(Ek, Fk), Gk), Bj), Product(Sum(Ek, Fk), Cj))
assert result == expected

# Z*A1i*Bj*Ek + Z*A2i*Bj*Ek + A3i*Bj*Ek + Z*A1i*Bj*Fk =>
# Bj*(Ek*(Z*A1i + Z*A2i) + A3i) + Z*A1i*Fk)

expr = Sum(Sum(Sum(Product(Z, Product(A1i, Product(Bj, Ek))),
Product(Z, Product(A2i, Product(Bj, Ek)))),
Product(A3i, Product(Bj, Ek))),
Product(Z, Product(A1i, Product(Bj, Fk))))
result, = optimise_expressions([expr], (j, k))
expected = Product(Sum(Product(Ek, Sum(Sum(Product(Z, A1i), Product(Z, A2i)), A3i)),
Product(Fk, Product(Z, A1i))), Bj)
assert result == expected


if __name__ == "__main__":
import os
import sys
pytest.main(args=[os.path.abspath(__file__)] + sys.argv[1:])
150 changes: 150 additions & 0 deletions tests/tsfc/test_create_fiat_element.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
import pytest

import FIAT
from FIAT.discontinuous_lagrange import DiscontinuousLagrange as FIAT_DiscontinuousLagrange

import ufl
import finat.ufl
from tsfc.finatinterface import create_element as _create_element


supported_elements = {
# These all map directly to FIAT elements
"Brezzi-Douglas-Marini": FIAT.BrezziDouglasMarini,
"Brezzi-Douglas-Fortin-Marini": FIAT.BrezziDouglasFortinMarini,
"Lagrange": FIAT.Lagrange,
"Nedelec 1st kind H(curl)": FIAT.Nedelec,
"Nedelec 2nd kind H(curl)": FIAT.NedelecSecondKind,
"Raviart-Thomas": FIAT.RaviartThomas,
"Regge": FIAT.Regge,
}
"""A :class:`.dict` mapping UFL element family names to their
FIAT-equivalent constructors."""


def create_element(ufl_element):
"""Create a FIAT element given a UFL element."""
finat_element = _create_element(ufl_element)
return finat_element.fiat_equivalent


@pytest.fixture(params=["BDM",
"BDFM",
"Lagrange",
"N1curl",
"N2curl",
"RT",
"Regge"])
def triangle_names(request):
return request.param


@pytest.fixture
def ufl_element(triangle_names):
return finat.ufl.FiniteElement(triangle_names, ufl.triangle, 2)


def test_triangle_basic(ufl_element):
element = create_element(ufl_element)
assert isinstance(element, supported_elements[ufl_element.family()])


@pytest.fixture(params=["CG", "DG", "DG L2"], scope="module")
def tensor_name(request):
return request.param


@pytest.fixture(params=[ufl.interval, ufl.triangle,
ufl.quadrilateral],
ids=lambda x: x.cellname(),
scope="module")
def ufl_A(request, tensor_name):
return finat.ufl.FiniteElement(tensor_name, request.param, 1)


@pytest.fixture
def ufl_B(tensor_name):
return finat.ufl.FiniteElement(tensor_name, ufl.interval, 1)


def test_tensor_prod_simple(ufl_A, ufl_B):
tensor_ufl = finat.ufl.TensorProductElement(ufl_A, ufl_B)

tensor = create_element(tensor_ufl)
A = create_element(ufl_A)
B = create_element(ufl_B)

assert isinstance(tensor, FIAT.TensorProductElement)

assert tensor.A is A
assert tensor.B is B


@pytest.mark.parametrize(('family', 'expected_cls'),
[('P', FIAT.GaussLobattoLegendre),
('DP', FIAT.GaussLegendre),
('DP L2', FIAT.GaussLegendre)])
def test_interval_variant_default(family, expected_cls):
ufl_element = finat.ufl.FiniteElement(family, ufl.interval, 3)
assert isinstance(create_element(ufl_element), expected_cls)


@pytest.mark.parametrize(('family', 'variant', 'expected_cls'),
[('P', 'equispaced', FIAT.Lagrange),
('P', 'spectral', FIAT.GaussLobattoLegendre),
('DP', 'equispaced', FIAT_DiscontinuousLagrange),
('DP', 'spectral', FIAT.GaussLegendre),
('DP L2', 'equispaced', FIAT_DiscontinuousLagrange),
('DP L2', 'spectral', FIAT.GaussLegendre)])
def test_interval_variant(family, variant, expected_cls):
ufl_element = finat.ufl.FiniteElement(family, ufl.interval, 3, variant=variant)
assert isinstance(create_element(ufl_element), expected_cls)


def test_triangle_variant_spectral():
ufl_element = finat.ufl.FiniteElement('DP', ufl.triangle, 2, variant='spectral')
create_element(ufl_element)


def test_triangle_variant_spectral_l2():
ufl_element = finat.ufl.FiniteElement('DP L2', ufl.triangle, 2, variant='spectral')
create_element(ufl_element)


def test_quadrilateral_variant_spectral_q():
element = create_element(finat.ufl.FiniteElement('Q', ufl.quadrilateral, 3, variant='spectral'))
assert isinstance(element.element.A, FIAT.GaussLobattoLegendre)
assert isinstance(element.element.B, FIAT.GaussLobattoLegendre)


def test_quadrilateral_variant_spectral_dq():
element = create_element(finat.ufl.FiniteElement('DQ', ufl.quadrilateral, 1, variant='spectral'))
assert isinstance(element.element.A, FIAT.GaussLegendre)
assert isinstance(element.element.B, FIAT.GaussLegendre)


def test_quadrilateral_variant_spectral_dq_l2():
element = create_element(finat.ufl.FiniteElement('DQ L2', ufl.quadrilateral, 1, variant='spectral'))
assert isinstance(element.element.A, FIAT.GaussLegendre)
assert isinstance(element.element.B, FIAT.GaussLegendre)


def test_quadrilateral_variant_spectral_rtcf():
element = create_element(finat.ufl.FiniteElement('RTCF', ufl.quadrilateral, 2, variant='spectral'))
assert isinstance(element.element._elements[0].A, FIAT.GaussLobattoLegendre)
assert isinstance(element.element._elements[0].B, FIAT.GaussLegendre)
assert isinstance(element.element._elements[1].A, FIAT.GaussLegendre)
assert isinstance(element.element._elements[1].B, FIAT.GaussLobattoLegendre)


def test_cache_hit(ufl_element):
A = create_element(ufl_element)
B = create_element(ufl_element)

assert A is B


if __name__ == "__main__":
import os
import sys
pytest.main(args=[os.path.abspath(__file__)] + sys.argv[1:])
Loading
Loading