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 OverloadType PETSc.vec #157

Closed
wants to merge 6 commits into from
Closed

Get OverloadType PETSc.vec #157

wants to merge 6 commits into from

Conversation

Ig-dolci
Copy link
Contributor

This PR adds an OverloadType method to get the PETSc.petsc4py.Vec object.

pyadjoint/overloaded_type.py Outdated Show resolved Hide resolved
raise NotImplementedError

def _ad_petsc_vec_write_only(self):
"""This method must be overridden.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

pyadjoint/overloaded_type.py Outdated Show resolved Hide resolved
@Ig-dolci Ig-dolci requested a review from dham July 8, 2024 10:54
@jrmaddison
Copy link
Contributor

Should document that these are context managers, and also document what is expected on entry/exit (ghost updates? other data consistency updates?).

@Ig-dolci
Copy link
Contributor Author

Ig-dolci commented Jul 8, 2024

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):
Copy link
Contributor Author

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?

@Ig-dolci
Copy link
Contributor Author

This PR is not necessary anymore. OverloadedTypes to copy and update PETSc Vecs are available at the PR 143.

@Ig-dolci Ig-dolci closed this Jul 19, 2024
@Ig-dolci Ig-dolci deleted the dolci/_ad_petsc_vec branch October 14, 2024 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants