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

Assemble: use tensor kwarg in FormSum maxpy #4056

Merged
merged 27 commits into from
Mar 19, 2025
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a5b09af
Assemble: use tensor kwarg in FormSum maxpy
pbrubeck Feb 19, 2025
082c625
BaseFormAssembler needs zeroing
pbrubeck Feb 19, 2025
eef29d6
BaseFormAssembler: check tensor
pbrubeck Feb 19, 2025
9a6f97c
Cleanup
pbrubeck Feb 19, 2025
821e583
Cofunction -> Function
pbrubeck Feb 19, 2025
11aa95d
ExternalOperator: update tensor
pbrubeck Feb 19, 2025
49950ee
MatrixBase: assign and zero
pbrubeck Feb 19, 2025
db0d9ce
fixup
pbrubeck Feb 19, 2025
31098be
No-op for ImplicitMatrix.zero()
pbrubeck Feb 20, 2025
c72988e
Only zero tensor when assembling FormSum
pbrubeck Feb 20, 2025
ecb6e6e
ImplicitMatrix: Do not implement zero()
pbrubeck Feb 20, 2025
5400181
Fix tests
pbrubeck Feb 20, 2025
db497a1
Update tests/firedrake/regression/test_vfs_component_bcs.py
pbrubeck Feb 20, 2025
c39f9e8
Update firedrake/assemble.py
pbrubeck Feb 20, 2025
2485e54
Apply suggestions from code review
pbrubeck Feb 20, 2025
9e7b915
lint
pbrubeck Feb 20, 2025
c6884bb
Apply suggestions from code review
pbrubeck Feb 20, 2025
5916217
more tests
pbrubeck Feb 21, 2025
7ea3dfc
Merge branch 'master' into pbrubeck/fix/base-form-tensor
pbrubeck Feb 25, 2025
179fe50
address review comments
pbrubeck Feb 26, 2025
b9201d0
Merge branch 'master' into pbrubeck/fix/base-form-tensor
pbrubeck Feb 26, 2025
bcd4e77
AssembledMatrix: set options_prefix
pbrubeck Feb 26, 2025
b81b9da
drop unrelated files
pbrubeck Feb 27, 2025
474ab65
Merge branch 'master' into pbrubeck/fix/base-form-tensor
pbrubeck Feb 27, 2025
c045bf4
Update firedrake/matrix.py
pbrubeck Mar 17, 2025
60002f4
MatrixBase: implement __sub__
pbrubeck Mar 17, 2025
c2c2243
Merge branch 'master' into pbrubeck/fix/base-form-tensor
pbrubeck Mar 17, 2025
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
AssembledMatrix: set options_prefix
pbrubeck committed Feb 26, 2025
commit bcd4e776fdff150405543095dad23b6d77343fd8
10 changes: 6 additions & 4 deletions firedrake/matrix.py
Original file line number Diff line number Diff line change
@@ -144,10 +144,11 @@ class Matrix(MatrixBase):
def __init__(self, a, bcs, mat_type, *args, **kwargs):
# sets self._a, self._bcs, and self._mat_type
MatrixBase.__init__(self, a, bcs, mat_type)
options_prefix = kwargs.pop("options_prefix")
options_prefix = kwargs.pop("options_prefix", None)
self.M = op2.Mat(*args, mat_type=mat_type, **kwargs)
self.petscmat = self.M.handle
self.petscmat.setOptionsPrefix(options_prefix)
if options_prefix is not None:
self.petscmat.setOptionsPrefix(options_prefix)
self.mat_type = mat_type

def assemble(self):
@@ -217,11 +218,12 @@ class AssembledMatrix(MatrixBase):
:arg petscmat: the already constructed petsc matrix this object represents.
"""
def __init__(self, a, bcs, petscmat, *args, **kwargs):
options_prefix = kwargs.pop("options_prefix", None)
super(AssembledMatrix, self).__init__(a, bcs, "assembled")

self.petscmat = petscmat
options_prefix = kwargs.pop("options_prefix")
self.petscmat.setOptionsPrefix(options_prefix)
if options_prefix is not None:
self.petscmat.setOptionsPrefix(options_prefix)

# this allows call to self.M.handle without a new class
self.M = SimpleNamespace(handle=self.mat())