Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Ig-dolci authored Jul 19, 2024
1 parent ecce49d commit a444a8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyadjoint/optimization/tao_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _get_vecs_indexes(self, X):
indices = []
vecs = []
for x in X:
vec = x._ad_vec_to_petsc()
vec = x._ad_to_petsc()
indices.append(vec.getLocalSize())
vecs.append(vec)
return vecs, indices
Expand Down Expand Up @@ -121,7 +121,7 @@ def from_petsc(self, y, X):
if len(X) != len(self._isis_concatenated_vecs):
raise ValueError("Invalid length")
for iset, x in zip(self._isis_concatenated_vecs, X):
x._ad_vec_from_petsc(y.getSubVector(iset))
x._ad_from_petsc(y.getSubVector(iset))

def to_petsc(self, x, Y):
"""Copy data from variables to a :class:`petsc4py.PETSc.Vec`.
Expand All @@ -135,7 +135,7 @@ def to_petsc(self, x, Y):
Y = Enlist(Y)
for iset, y in zip(self._isis_concatenated_vecs, Y):
v_i = x.getSubVector(iset)
y._ad_vec_to_petsc().copy(result=v_i)
y._ad_to_petsc().copy(result=v_i)
x.restoreSubVector(iset, v_i)


Expand Down

0 comments on commit a444a8a

Please sign in to comment.