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 Add PyOP2 to Firedrake repository #3817

Merged
merged 3,904 commits into from
Nov 27, 2024
Merged
Changes from 1 commit
Commits
Show all changes
3904 commits
Select commit Hold shift + click to select a range
5a89bfc
Use Firedrake PETSc and petsc4py
connorjward May 10, 2021
f1daf21
Merge pull request #617 from connorjward/test-ci
wence- May 10, 2021
c8d7ff6
actions: Build docs at end of successful test run
wence- May 11, 2021
9a90c9f
Merge pull request #618 from OP2/wence/fix/actions-doc-build
wence- May 11, 2021
afe4ad4
add standard set operations
ksagiyam Apr 14, 2020
df6f9aa
Loopy sprint (#612)
ReubenHill May 14, 2021
ded8578
codegen/api: New PermutedMap class corresponding to map o permutation
wence- May 7, 2021
dfeec40
codegen: No more regular expressions in node renaming
wence- May 14, 2021
a257d1d
tests: Squash numpy deprecation warnings
wence- May 14, 2021
07a47b3
Merge remote-tracking branch 'origin/master' into DataCarrier-object-…
nbouziani May 24, 2021
1e74cea
Add PETSc decorator to compile
connorjward May 25, 2021
2781213
add standard set operations
ksagiyam Apr 14, 2020
855ec95
Merge branch 'fs_filter' of github.com:OP2/PyOP2 into fs_filter
ksagiyam May 25, 2021
29973b1
Add some missing DataCarrier inits
nbouziani May 26, 2021
c45a751
Merge pull request #623 from OP2/connorjward/time-compilation
dham Jun 9, 2021
bb27936
Merge remote-tracking branch 'origin/master' into fs_filter
ksagiyam Jun 15, 2021
e56d26f
More loopy interface changes: arg_id_to_val -> arg_id_to_arg
sv2518 Jun 9, 2021
f057908
Add recreate to Arg
Melina97 Jun 25, 2021
3442f06
Recreate method of Arg
Melina97 Jun 25, 2021
92184de
Fix cache problem
Melina97 Jun 25, 2021
e9b73ab
Fix cache problem
Melina97 Jun 25, 2021
f24478a
Fix cache problem
Melina97 Jun 25, 2021
b28bf14
Requirements: update loopy fork.
sv2518 Jun 28, 2021
781201c
Merge pull request #627 from OP2/new-loopy-master
dham Jun 30, 2021
760dbe7
Merge remote-tracking branch 'origin/master' into Melina97/fix_cache_…
Melina97 Jul 1, 2021
899a543
Updated changes
Melina97 Jul 1, 2021
70c4b39
Don't use a parloop when not needed
dham Jul 13, 2021
58f89ef
added subset case for copy
Melina97 Jul 13, 2021
2460b37
@dham
Melina97 Jul 15, 2021
3ddc70a
Don't use a parloop when not needed
Melina97 Jul 15, 2021
88b23e0
Merging conflict resolved
Melina97 Jul 15, 2021
5b053cc
faster dat copy
Melina97 Jul 16, 2021
c048265
Lint fix
Melina97 Jul 16, 2021
82279dc
Ignore generated files
wence- Jul 21, 2021
dd5d060
Fix get_petsc_dir (#622)
connorjward Jul 21, 2021
1272f50
Edited iops for Dat
Melina97 Jul 21, 2021
15bd621
Merge remote-tracking branch 'origin/master' into fs_filter
ksagiyam Jul 21, 2021
ec55e8e
Merge pull request #620 from OP2/fs_filter
ksagiyam Jul 21, 2021
c57aafc
Fix cache-clearing to work with directories
connorjward Jul 21, 2021
8423537
recreate method only
Melina97 Jul 22, 2021
6e00f49
Remove entire cache directory
connorjward Jul 22, 2021
117e4b7
Merge pull request #632 from OP2/connorjward/fix-pyop2clean
dham Jul 27, 2021
6101f6b
Merge pull request #629 from OP2/Melina97/fix_cache_problem
dham Jul 27, 2021
c915003
Call apt update in workflow
connorjward Jul 27, 2021
edf5b3a
Merge pull request #634 from OP2/connorjward/call-apt-update
dham Jul 27, 2021
b48f65d
Shortcut dat copy (#630)
dham Aug 11, 2021
9230ed6
Merge pull request #621 from OP2/wence/feature/composed-map
dham Aug 11, 2021
c0b50cf
Allow optional flop count on kernel construction
AndrewWhitmell Jul 14, 2021
0007d46
test: Squash numpy deprecation warning
wence- Aug 25, 2021
d5f82d3
petsc: Use correct scalar type for datmat multiplication
wence- Aug 25, 2021
a98bb32
Fix compilation failures on Mac M1 machines
danshapero Sep 9, 2021
2d77e8f
Merge pull request #636 from danshapero/m1-fixes
dham Sep 23, 2021
7d3d4be
Merge master
nbouziani Sep 24, 2021
fb0ee93
Split apart and linting passes
connorjward Sep 29, 2021
24b7214
Moved pyparloop in parloop.py
connorjward Sep 29, 2021
222ee58
All tests passing
connorjward Sep 29, 2021
2e60434
Fix Arg _is_mat check
connorjward Sep 29, 2021
55d9637
Fix linting
connorjward Sep 29, 2021
e4a9de6
Add subpackage to setup.py
connorjward Sep 29, 2021
a43fcd3
Merge pull request #639 from OP2/connorjward/refactor-base.py
dham Oct 5, 2021
54aad3a
Make Global.zero accept subset kwarg
connorjward Oct 7, 2021
6286fc0
Merge pull request #637 from OP2/connorjward/fix-subset-kwarg-error
wence- Oct 7, 2021
bc7cd81
Bug fix empty extruded set with variable layers
connorjward Oct 7, 2021
86d1d57
Merge pull request #641 from OP2/rebase-ext-mesh-fix
wence- Oct 7, 2021
83cfe91
Matrix tests run correctly in parallel
connorjward Oct 12, 2021
be8adea
Merge pull request #642 from OP2/connorjward/make-test-matrices-work-…
dham Oct 14, 2021
b6710b5
codegen: Fix issue with permuted maps
wence- Nov 3, 2021
d8c7509
Add test using permuted maps
wence- Nov 3, 2021
a737a31
Merge pull request #643 from OP2/wence/fix/permuted-map
wence- Nov 8, 2021
6d39e69
Merge remote-tracking branch 'origin/master' into DataCarrier-object-…
nbouziani Nov 14, 2021
520078b
Add mat.py
nbouziani Nov 14, 2021
d89e93c
Refactor object versioning using PETSc state counter
nbouziani Nov 16, 2021
ca5e50d
Fix typo
nbouziani Nov 16, 2021
54dd188
Add tests for Dat
nbouziani Nov 16, 2021
18f9fa4
Remove spurious incrementations from VecAccessMixin
nbouziani Nov 16, 2021
2836c7a
Cleanup
nbouziani Nov 21, 2021
7bcde5a
Add dat_version to MixedDat + test
nbouziani Nov 21, 2021
0e879bd
Specify petsc branch in ci.yml
nbouziani Nov 24, 2021
55ad119
Update few things
nbouziani Nov 25, 2021
82f9ac5
Update test + remove @abstractmethod from increment_dat_version
nbouziani Nov 25, 2021
3edaf9a
Merge branch 'DataCarrier-object-versionning' of github.com:OP2/PyOP2…
nbouziani Nov 25, 2021
5fe6451
Major redesign of API
connorjward Jan 25, 2022
686857b
Merge pull request #624 from OP2/connorjward/purge-parloop-data-refs
dham Feb 3, 2022
658abaa
Add disk_cached and cached decorators
connorjward Jan 25, 2022
e3bb5a0
Merge pull request #644 from OP2/cached-decorator
connorjward Feb 4, 2022
8b04898
Fix dtypes for COFFEE local kernel
connorjward Feb 8, 2022
186fac5
Merge pull request #647 from OP2/fix-dtype-bug
connorjward Feb 8, 2022
6827bdb
Uniquify args for halo exchanges
connorjward Feb 8, 2022
13f0d33
Merge pull request #649 from OP2/fix-2341
wence- Feb 9, 2022
462da86
Fix deadlocking disk_cached decorator
connorjward Feb 18, 2022
527fb49
Loopy: Set target globally to CWithGNULibcTarget
sv2518 Mar 2, 2022
ebe8ccb
Merge pull request #656 from OP2/sv/set-targets
sv2518 Mar 4, 2022
b1bf667
Minor fixes
sv2518 Mar 4, 2022
4ba2952
Merge pull request #657 from OP2/sv/fix-print
sv2518 Mar 4, 2022
5fb8559
Merge pull request #650 from OP2/connorjward/fix-deadlocking-decorator
connorjward Mar 22, 2022
2d2c3aa
Add dtype check for parloops
connorjward Mar 28, 2022
5f4c036
JDBetteridge/more compilers (#655)
JDBetteridge Apr 1, 2022
d62a56c
Merge pull request #659 from OP2/connorjward/parloop-dtype-check
dham Apr 6, 2022
4530b0e
Compilation: fix the compiler sniffing for apple.
sv2518 Apr 7, 2022
80715ac
Merge pull request #660 from OP2/sv/fix-compiler-sniff
dham Apr 7, 2022
ee0b56e
Don't just drop C instructions...
sv2518 Jan 18, 2022
0c7a5c8
Logging: add PETSc events into the inverse and solve callables. The m…
sv2518 Feb 4, 2022
a0a2ab2
Logging: Generate events for logging all local kernels/callables in p…
sv2518 Feb 15, 2022
883d037
Fix typo in attribute name for M1 Mac.
dham Apr 8, 2022
fc9c34a
Merge pull request #658 from OP2/sv/profiling-local-kernels-trackevents
dham Apr 8, 2022
0a1e339
pass gcc dir to linker on M1
dham Apr 27, 2022
8697788
Merge pull request #662 from OP2/hardcode_m1_library
dham May 3, 2022
a4887c7
call super's constructor
kaushikcfd May 4, 2022
a33fedf
Merge pull request #663 from OP2/mapper_init_defn
wence- May 5, 2022
f277089
PyOP2 compilation: add a pathway to compile with gcc on Mac.
sv2518 May 6, 2022
ba81ee0
Merge pull request #664 from OP2/sv/mac-gnu
sv2518 Jul 7, 2022
e1f7598
Fix mpicc (#667)
sv2518 Jul 8, 2022
ba8d12c
Merge master
nbouziani Jul 13, 2022
0989f1d
Fix lint
nbouziani Jul 13, 2022
a1d9d9f
Update ci.yml
nbouziani Jul 14, 2022
9eabf60
Add tests for Dat context managers
nbouziani Jul 21, 2022
ff58332
Merge branch 'DataCarrier-object-versionning' of github.com:OP2/PyOP2…
nbouziani Jul 21, 2022
784b217
Merge pull request #579 from OP2/DataCarrier-object-versionning
dham Jul 21, 2022
a2103cf
Increase state counter inside vec_context
nbouziani Jul 24, 2022
e09cd25
Update MixedDat._vec counter via Vec.array
nbouziani Jul 26, 2022
cb3ae29
Clean-up
nbouziani Jul 26, 2022
7036b5d
Merge pull request #670 from OP2/fix-mixed-dat-object-versioning
dham Jul 27, 2022
3a1b62f
Made a mistake in the compiler refactor + New linting rules (#672)
JDBetteridge Aug 11, 2022
473a1d5
Replace OrderedDicts getting passed to loopy
connorjward Aug 19, 2022
0dcf7d6
Enable loopy caching of kernels
connorjward Aug 19, 2022
a0259a9
Merge pull request #673 from OP2/connorjward/enable-loopy-caching
dham Oct 5, 2022
fcf4250
add ComposedMap
ksagiyam Oct 1, 2022
1ba576e
Merge pull request #674 from OP2/ksagiyam/composed_map
ksagiyam Oct 18, 2022
40905e7
Remove distutils from compilation.py
Feb 23, 2022
5218d79
Remove distutils from setup.py
JDBetteridge Mar 3, 2022
e242150
Update versioneer
JDBetteridge Mar 3, 2022
1da42a5
test_requires is deprecated
JDBetteridge Mar 3, 2022
f072341
Updated to latest versioneer (no distutils)
JDBetteridge Nov 4, 2022
189dc4d
Add matrix to CI
JDBetteridge Nov 4, 2022
fd59755
Fail fast false
JDBetteridge Nov 9, 2022
b74ed10
Merge pull request #678 from OP2/JDBetteridge/purge_distutils
dham Nov 9, 2022
382a718
Merge pull request #679 from OP2/JDBetteridge/ci_python_matrix
dham Nov 9, 2022
a959e43
codegen: add Quotient, FloorDiv, Remainder
ksagiyam Oct 11, 2022
e8722fb
extrusion: enable periodic extrusion
ksagiyam Oct 13, 2022
9de5afc
Merge pull request #675 from OP2/ksagiyam/periodic_extrusion
ksagiyam Nov 15, 2022
804b711
Add timeout to CI tests
JDBetteridge Nov 21, 2022
de58f78
Add 60 min job timeout and 10 min pytesttimeout as pytest-timout does…
JDBetteridge Nov 21, 2022
f4a5a17
Test new timeout strategy
JDBetteridge Nov 22, 2022
8f826a2
Try to change the CI environment instead
JDBetteridge Nov 22, 2022
e8be853
Re-enable matrix strategy
JDBetteridge Nov 23, 2022
3a1d876
Merge pull request #682 from OP2/JDBetteridge/add_CI_timeout
JDBetteridge Nov 23, 2022
43c14a6
Add halo freezing
connorjward Nov 16, 2022
c1158ed
Merge pull request #680 from OP2/connorjward/freeze-halos
dham Nov 23, 2022
dac4b97
Add some dummy Dat methods to Global
connorjward Nov 28, 2022
1f0a740
Replaced tompi4py() with proper comm_dup() calls
JDBetteridge Sep 30, 2022
65fd506
WIP: Tests passing, but not all comms freed
JDBetteridge Oct 2, 2022
fb274d2
This test was just wrong
JDBetteridge Oct 11, 2022
35de348
Tests pass with no comms referenced at end
JDBetteridge Oct 13, 2022
51b21f4
Lint code
JDBetteridge Oct 18, 2022
e3454bf
Remove debugging statements
JDBetteridge Oct 18, 2022
b2520ee
Fix up a few more MPI bits
JDBetteridge Oct 20, 2022
07d1dc5
Fix deadlocks in Firedrake tests
JDBetteridge Oct 24, 2022
5c4b242
Comm in composed map was not internal
JDBetteridge Oct 26, 2022
390289f
Remove pyop2.mpi.FriendlyCommNull
JDBetteridge Oct 26, 2022
ff67407
Address reviewer comments
JDBetteridge Oct 27, 2022
5563c85
pyop2_comm_status() now returns a string
JDBetteridge Oct 27, 2022
f01762d
Duplicate COMM_WORLD and COMM_SELF for PyOP2 use (and avoid renaming …
JDBetteridge Oct 27, 2022
235d45b
Fixed some unreachable lines and redundant logic
JDBetteridge Nov 4, 2022
2c6056b
Change debug to print in _free_comms as stream already closed
JDBetteridge Nov 15, 2022
ba86a16
Fixed removing comm from list twice on free
JDBetteridge Nov 18, 2022
4c439ea
Tidy code, address review comments
JDBetteridge Nov 23, 2022
7a3c68f
Merge pull request #685 from OP2/connorjward/extra-global-methods
dham Nov 29, 2022
7aca5e5
Merge pull request #676 from OP2/JDBetteridge/clean_comms
ksagiyam Nov 29, 2022
2c2c419
GCC 9 doesn't emit full version with `dumpfullversion` (#686)
JDBetteridge Jan 25, 2023
3748115
Fix Halo docstrings so Firedrake docs link properly
JDBetteridge Feb 3, 2023
1c6068a
Add comm to Global constructor in dat op
JDBetteridge Feb 14, 2023
233f6dc
Merge pull request #690 from OP2/JDBetteridge/global_fix
JDBetteridge Feb 14, 2023
7c9fdf3
Prevent freeing comms when refcount=0. Deadlock caused by garbage col…
JDBetteridge Mar 15, 2023
366a8c7
Merge pull request #692 from OP2/JDBetteridge/delay_comm_free
dham Mar 29, 2023
a1437d0
data_with_halos increments dat_version
connorjward Apr 3, 2023
59e109e
Merge pull request #694 from OP2/connorjward/fix-dat-versioning
JDBetteridge Apr 3, 2023
ed2ff83
DO NOT MERGE Try with updated PETSc branch
connorjward May 2, 2023
539f9cf
Try installing wheel
connorjward May 2, 2023
5903f7a
Add simple halo methods to Global and DatView (#695)
connorjward May 2, 2023
c665bbc
Drop Python 3.7
connorjward May 4, 2023
53a265c
Remove old requirement
connorjward May 4, 2023
0d1c5b0
Merge pull request #700 from OP2/connorjward/test-updated-petsc
JDBetteridge May 4, 2023
b255f06
Change import location to avoid loopy deprecation warning
connorjward May 2, 2023
06697a3
Merge pull request #699 from OP2/connorjward/deprecation-warning
JDBetteridge May 4, 2023
edae288
Expunge COFFEE (#697)
connorjward May 10, 2023
d230953
Global with no comm is a Constant (#701)
JDBetteridge Jun 14, 2023
92e756b
Insert zero blocks on matrix diagonals (#704)
connorjward Aug 23, 2023
8e4ad93
don't die if the cache dir doesn't exist (#707)
dham Aug 29, 2023
da14715
fix dat version (#709)
ksagiyam Sep 27, 2023
d017d59
Fix halo exchanges for MixedDats in parloops (#710)
connorjward Oct 18, 2023
fbde61f
mat + sparsity: use dset.layout_vec.local_size for sizes (#714)
ksagiyam Jan 9, 2024
ad0c430
Comm reference fixes + Remove __del__ method and add weakref.finalize…
JDBetteridge Jan 17, 2024
e0a4d3a
Passthrough params (#708)
pbrubeck Jan 24, 2024
eba7baf
For testing firedrake
JDBetteridge Feb 5, 2024
bfa7810
sparsity: fix some tests
ksagiyam Dec 8, 2023
09968a4
sparsity: repack rmaps, cmaps, and iteration_regions in maps_and_regions
ksagiyam Dec 8, 2023
3e436ee
sparsity: change interface to directly accept maps_and_regions
ksagiyam Dec 11, 2023
dc513fb
sparsity: add diagonal_block to kwargs
ksagiyam Dec 20, 2023
48a54d3
sparsity: ignore negative map indices
ksagiyam Dec 20, 2023
d60101b
sparsity: add test
ksagiyam Dec 20, 2023
0afe7fa
Merge pull request #713 from OP2/ksagiyam/sparsity
ksagiyam Mar 1, 2024
f424fb5
Merge pull request #717 from OP2/JDBetteridge/angus-g-fix
JDBetteridge Mar 5, 2024
594e87b
Change for MixedMesh implementation (#718)
ksagiyam Apr 3, 2024
eea5523
removed serial case in lgmap.
emmarothwell1 Dec 12, 2023
1b386a4
Added constrained_size to Set and creation of matrix.
emmarothwell1 Jan 5, 2024
17c20a7
layout_vec includes constrained case.
emmarothwell1 Jan 10, 2024
3b28acb
Put serial case back in for DataSet
emmarothwell1 Jan 25, 2024
acbbec9
global kernel _cache_key contains form signature
emmarothwell1 Jan 28, 2024
cd6e8b0
adding constrained size for mixed sets.
emmarothwell1 Feb 20, 2024
f990aab
add constrained size in lgmap for mixeddataset
emmarothwell1 Feb 26, 2024
d3eec81
apply pr suggestions for naming things
emmarothwell1 Mar 6, 2024
7c64679
remove whitespace
emmarothwell1 Apr 21, 2024
4e1bb3c
remove signature from global kernel.
emmarothwell1 Apr 23, 2024
8fa2ff3
Update pyop2/types/set.py
emmarothwell1 Apr 25, 2024
ebbed56
Merge pull request #716 from OP2/emmarothwell1/restricted_function_sp…
ksagiyam Apr 26, 2024
7bef38f
Fix for massively parallel performance regression (#720)
JDBetteridge May 8, 2024
c97a043
Support numpy 2.0
connorjward Apr 11, 2024
a52b998
Merge pull request #721 from OP2/JDBetteridge/numpy2_rebase
JDBetteridge Jun 7, 2024
7f3e8ae
Reset numbering when generating
JDBetteridge Jun 11, 2024
af813e9
Merge pull request #722 from OP2/JDBetteridge/reset_numbering
JDBetteridge Jun 12, 2024
5f18075
composed map: add permute method (#723)
ksagiyam Jun 18, 2024
b84b770
DatView: Fix zero() (#727)
pbrubeck Sep 4, 2024
31471a6
Remove comm hash and add per-comm caches (#724)
JDBetteridge Oct 9, 2024
47f2151
Merge remote-tracking branch 'pyop2/master' into JDBetteridge/merge_p…
JDBetteridge Oct 22, 2024
9240156
Fix for boundary as a control (#3816)
Ig-dolci Oct 23, 2024
0c90fab
Use UFL element hashing instead of FInAT element hashing (#3807)
connorjward Oct 24, 2024
1e191fb
annotate `FunctionMixin` methods `_ad_mul` and `_ad_add` (#3841)
JHopeCollins Oct 29, 2024
e4f7b6a
Fix voting algorithm (#3293)
ReubenHill Oct 30, 2024
2082417
Fix action versions for workflow files (#3852)
connorjward Nov 5, 2024
65d664b
hex: enable interior facet integration (#3755)
ksagiyam Nov 6, 2024
7cab176
Adjoint variational solver (#3723)
Ig-dolci Nov 6, 2024
0f4400a
Fix preconditioner when using EquationBC (#3842)
ksagiyam Nov 6, 2024
a0145c5
Dolci/exchange fwi demo test (#3836)
Ig-dolci Nov 7, 2024
4a7e745
Fix progress bar error for parallel executions (#3859)
Ig-dolci Nov 11, 2024
c9d3922
Fixes for updated PETSc (#3853)
connorjward Nov 12, 2024
654bb27
function space: fix collapse (#3861)
ksagiyam Nov 13, 2024
6fe96de
Fix assembly of Real matrices (#3846)
connorjward Nov 13, 2024
bb8f6e1
ngsPETSc "stable" release is coming ! (#3857)
UZerbinati Nov 13, 2024
dff63f8
Parallel test improvements (#3865)
connorjward Nov 15, 2024
cf46e77
Get value_shape from FunctionSpace (#3862)
pbrubeck Nov 15, 2024
347e717
Test integral variant for Regge/HHJ (#3839)
pbrubeck Nov 19, 2024
f222dc5
Actually install ngsPETSc using pip (#3873)
UZerbinati Nov 20, 2024
8f45d26
Disk checkpointing (#3812)
Ig-dolci Nov 21, 2024
6bb9a9f
test: add test for 0**{min_value, max_value} (#3855)
ksagiyam Nov 22, 2024
1bceac4
Move PyOP2 into Firedrake repository
JDBetteridge Oct 23, 2024
ccec788
Merge remote-tracking branch 'origin/master' into JDBetteridge/merge_…
connorjward Nov 25, 2024
c72810a
Use correct link to get firedrake-install script
connorjward Nov 25, 2024
8bcb96f
Fix firedrake-zenodo and firedrake-clean
connorjward Nov 25, 2024
867337f
Revert firedrake-install location, to avoid breaking firedrake-update
connorjward Nov 25, 2024
74a3f85
Do not specify numpy>=2 and tweak install instructions
connorjward Nov 26, 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
Prev Previous commit
Next Next commit
hex: enable interior facet integration (#3755)
ksagiyam authored and connorjward committed Nov 25, 2024
commit 65d664bd5ff5e42cca5ff07416bdd5ea8e30dfa2
20 changes: 20 additions & 0 deletions firedrake/assemble.py
Original file line number Diff line number Diff line change
@@ -1759,6 +1759,16 @@ def _as_global_kernel_arg_interior_facet(_, self):
return op2.DatKernelArg((2,))


@_as_global_kernel_arg.register(kernel_args.ExteriorFacetOrientationKernelArg)
def _as_global_kernel_arg_exterior_facet_orientation(_, self):
return op2.DatKernelArg((1,))


@_as_global_kernel_arg.register(kernel_args.InteriorFacetOrientationKernelArg)
def _as_global_kernel_arg_interior_facet_orientation(_, self):
return op2.DatKernelArg((2,))


@_as_global_kernel_arg.register(CellFacetKernelArg)
def _as_global_kernel_arg_cell_facet(_, self):
if self._mesh.extruded:
@@ -2053,6 +2063,16 @@ def _as_parloop_arg_interior_facet(_, self):
return op2.DatParloopArg(self._mesh.interior_facets.local_facet_dat)


@_as_parloop_arg.register(kernel_args.ExteriorFacetOrientationKernelArg)
def _as_parloop_arg_exterior_facet_orientation(_, self):
return op2.DatParloopArg(self._mesh.exterior_facets.local_facet_orientation_dat)


@_as_parloop_arg.register(kernel_args.InteriorFacetOrientationKernelArg)
def _as_parloop_arg_interior_facet_orientation(_, self):
return op2.DatParloopArg(self._mesh.interior_facets.local_facet_orientation_dat)


@_as_parloop_arg.register(CellFacetKernelArg)
def _as_parloop_arg_cell_facet(_, self):
return op2.DatParloopArg(self._mesh.cell_to_facets)
40 changes: 40 additions & 0 deletions firedrake/mesh.py
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@
)
from firedrake.adjoint_utils import MeshGeometryMixin
from pyadjoint import stop_annotating
import gem

try:
import netgen
@@ -44,6 +45,7 @@
ngsPETSc = None
# Only for docstring
import mpi4py # noqa: F401
from tsfc.finatinterface import as_fiat_cell


__all__ = [
@@ -317,6 +319,44 @@ def facet_cell_map(self):
return op2.Map(self.set, self.mesh.cell_set, self._rank, self.facet_cell,
"facet_to_cell_map")

@utils.cached_property
def local_facet_orientation_dat(self):
"""Dat for the local facet orientations."""
dtype = gem.uint_type
# Make a map from cell to facet orientations.
fiat_cell = as_fiat_cell(self.mesh.ufl_cell())
topo = fiat_cell.topology
num_entities = [0]
for d in range(len(topo)):
num_entities.append(len(topo[d]))
offsets = np.cumsum(num_entities)
local_facet_start = offsets[-3]
local_facet_end = offsets[-2]
map_from_cell_to_facet_orientations = self.mesh.entity_orientations[:, local_facet_start:local_facet_end]
# Make output data;
# this is a map from an exterior/interior facet to the corresponding local facet orientation/orientations.
# Halo data are required by design, but not actually used.
# -- Reshape as (-1, self._rank) to uniformly handle exterior and interior facets.
data = np.empty_like(self.local_facet_dat.data_ro_with_halos).reshape((-1, self._rank))
data.fill(np.iinfo(dtype).max)
# Set local facet orientations on the block corresponding to the owned facets; i.e., data[:shape[0], :] below.
local_facets = self.local_facet_dat.data_ro # do not need halos.
# -- Reshape as (-1, self._rank) to uniformly handle exterior and interior facets.
local_facets = local_facets.reshape((-1, self._rank))
shape = local_facets.shape
map_from_owned_facet_to_cells = self.facet_cell[:shape[0], :]
data[:shape[0], :] = np.take_along_axis(
map_from_cell_to_facet_orientations[map_from_owned_facet_to_cells],
local_facets.reshape(shape + (1, )), # reshape as required by take_along_axis.
axis=2,
).reshape(shape)
return op2.Dat(
self.local_facet_dat.dataset,
data,
dtype,
f"{self.mesh.name}_{self.kind}_local_facet_orientation"
)


@PETSc.Log.EventDecorator()
def _from_gmsh(filename, comm=None):
3 changes: 3 additions & 0 deletions firedrake/mg/kernels.py
Original file line number Diff line number Diff line change
@@ -143,6 +143,7 @@ def compile_element(expression, dual_space=None, parameters=None,

config = dict(interface=builder,
ufl_cell=cell,
integral_type="cell",
point_indices=(),
point_expr=point,
argument_multiindices=argument_multiindices,
@@ -537,6 +538,7 @@ def dg_injection_kernel(Vf, Vc, ncell):
integration_dim, entity_ids = lower_integral_type(Vfe.cell, "cell")
macro_cfg = dict(interface=macro_builder,
ufl_cell=Vf.ufl_cell(),
integral_type="cell",
integration_dim=integration_dim,
entity_ids=entity_ids,
index_cache=index_cache,
@@ -573,6 +575,7 @@ def dg_injection_kernel(Vf, Vc, ncell):

coarse_cfg = dict(interface=coarse_builder,
ufl_cell=Vc.ufl_cell(),
integral_type="cell",
integration_dim=integration_dim,
entity_ids=entity_ids,
index_cache=index_cache,
1 change: 1 addition & 0 deletions firedrake/pointeval_utils.py
Original file line number Diff line number Diff line change
@@ -71,6 +71,7 @@ def compile_element(expression, coordinates, parameters=None):

config = dict(interface=builder,
ufl_cell=extract_unique_domain(coordinates).ufl_cell(),
integral_type="cell",
point_indices=(),
point_expr=point,
scalar_type=utils.ScalarType)
1 change: 1 addition & 0 deletions firedrake/pointquery_utils.py
Original file line number Diff line number Diff line change
@@ -160,6 +160,7 @@ def to_reference_coords_newton_step(ufl_coordinate_element, parameters, x0_dtype
context = tsfc.fem.GemPointContext(
interface=builder,
ufl_cell=cell,
integral_type="cell",
point_indices=(),
point_expr=point,
scalar_type=parameters["scalar_type"]
35 changes: 35 additions & 0 deletions tests/regression/test_integral_hex.py
Original file line number Diff line number Diff line change
@@ -18,3 +18,38 @@ def test_integral_hex_exterior_facet(mesh_from_file, family):
x, y, z = SpatialCoordinate(mesh)
f = Function(V).interpolate(2 * x + 3 * y * y + 4 * z * z * z)
assert abs(assemble(f * ds) - (2 + 4 + 2 + 5 + 2 + 6)) < 1.e-10


@pytest.mark.parallel(nprocs=2)
@pytest.mark.parametrize('mesh_from_file', [False, True])
@pytest.mark.parametrize('family', ["Q", "DQ"])
def test_integral_hex_interior_facet(mesh_from_file, family):
if mesh_from_file:
mesh = Mesh(join(cwd, "..", "meshes", "cube_hex.msh"))
else:
mesh = UnitCubeMesh(2, 3, 5, hexahedral=True)
V = FunctionSpace(mesh, family, 3)
x, y, z = SpatialCoordinate(mesh)
f = Function(V).interpolate(2 * x + 3 * y * y + 4 * z * z * z)
assert assemble((f('+') - f('-'))**2 * dS)**0.5 < 1.e-14


@pytest.mark.parallel(nprocs=2)
@pytest.mark.parametrize('mesh_from_file', [False, True])
def test_integral_hex_interior_facet_solve(mesh_from_file):
if mesh_from_file:
mesh = Mesh(join(cwd, "..", "meshes", "cube_hex.msh"))
else:
mesh = UnitCubeMesh(2, 3, 5, hexahedral=True)
V = FunctionSpace(mesh, "Q", 1)
x, y, z = SpatialCoordinate(mesh)
f = Function(V).interpolate(2 * x + 3 * y + 5 * z)
u = TrialFunction(V)
v = TestFunction(V)
a = inner(u('+'), v('+')) * dS(degree=3)
L = inner(f('+'), v('-')) * dS(degree=3)
bc = DirichletBC(V, f, "on_boundary")
sol = Function(V)
solve(a == L, sol, bcs=[bc])
err = assemble((sol - f)**2 * dx)**0.5
assert err < 1.e-14