Skip to content

Commit

Permalink
fixing petsc output vector error in the MPhys wrapper (#300)
Browse files Browse the repository at this point in the history
* fixing petsc output vector issue

* removing the comments

* minor fix for LBGS

* minor fix for LBGS

* minor fix for LBGS

* removing unnecessary copy

---------

Co-authored-by: Alasdair Gray <[email protected]>
  • Loading branch information
ArshSaja and A-CGray authored Aug 2, 2023
1 parent 4dda7b3 commit d161960
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions adflow/mphys/mphys_adflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,9 @@ def solve_linear(self, d_outputs, d_residuals, mode):
if mode == "fwd":
d_outputs["adflow_states"] = solver.solveDirectForRHS(d_residuals["adflow_states"])
elif mode == "rev":
# d_residuals['adflow_states'] = solver.solveAdjointForRHS(d_outputs['adflow_states'])
solver.adflow.adjointapi.solveadjoint(d_outputs["adflow_states"], d_residuals["adflow_states"], True)
phi = d_residuals["adflow_states"].copy()
solver.adflow.adjointapi.solveadjoint(d_outputs["adflow_states"], phi, True)
d_residuals["adflow_states"] = phi

return True, 0, 0

Expand Down

0 comments on commit d161960

Please sign in to comment.