-
Notifications
You must be signed in to change notification settings - Fork 37
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 OverloadType PETSc.vec #157
Conversation
pyadjoint/overloaded_type.py
Outdated
raise NotImplementedError | ||
|
||
def _ad_petsc_vec_write_only(self): | ||
"""This method must be overridden. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Co-authored-by: David A. Ham <[email protected]>
Should document that these are context managers, and also document what is expected on entry/exit (ghost updates? other data consistency updates?). |
Yes. That is an important point. I will study more about the management of Petsc vecs and try to improve the docs. |
@@ -320,6 +320,42 @@ def _ad_str(self): | |||
""" | |||
return str(self) | |||
|
|||
def _ad_petsc_vec_read_only(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I consider adding an optional argument like with_halos? Or does it not make sense?
This PR is not necessary anymore. OverloadedTypes to copy and update PETSc Vecs are available at the PR 143. |
This PR adds an
OverloadType
method to get thePETSc.petsc4py.Vec
object.