Skip to content

Commit

Permalink
only rebuild the JacobiPC blocks when the reference state has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
JHopeCollins committed Apr 26, 2024
1 parent fa93f28 commit b08fdfd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions asQ/preconditioners/jacobipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ def initialize(self, pc):
# The block rhs/solution are the timestep i of the
# input/output AllAtOnceCofunction/Function
block_problem = fd.LinearVariationalProblem(A, self._x[i], self._y[i],
bcs=self.block_bcs)
bcs=self.block_bcs,
constant_jacobian=True)
block_solver = fd.LinearVariationalSolver(block_problem,
appctx=appctx_h,
options_prefix=block_prefix)
Expand Down Expand Up @@ -169,7 +170,7 @@ def update(self, pc):
st.assign(ft)

if jacobian_state == 'linear':
pass
return

elif jacobian_state == 'current':
state_func.assign(aaofunc)
Expand Down Expand Up @@ -199,6 +200,9 @@ def update(self, pc):
elif jacobian_state == 'user':
pass

for block in self.block_solvers:
block.invalidate_jacobian()

return

@profiler()
Expand Down

0 comments on commit b08fdfd

Please sign in to comment.