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

Get petsc vec #3657

Merged
merged 11 commits into from
Aug 7, 2024
5 changes: 5 additions & 0 deletions firedrake/adjoint_utils/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,5 +398,10 @@ def _applyBinary(self, f, y):
npdata[i] = f(npdata[i], npdatay[i])
vec.set_local(npdata)

def _ad_petsc_vec(self):
# Return the PETSc Vec object.
with self.dat.vec_ro as v:
return v

def __deepcopy__(self, memodict={}):
return self.copy(deepcopy=True)
Loading