Skip to content

Commit

Permalink
Merge branch 'master' into default_block_options
Browse files Browse the repository at this point in the history
  • Loading branch information
JHopeCollins committed May 7, 2024
2 parents a447de8 + 9425562 commit ab36e84
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion asQ/preconditioners/circulantpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ def initialize(self, pc):
appctx_h.update(block_appctx)

block_problem = fd.LinearVariationalProblem(A, L, self.block_sol,
bcs=self.block_bcs)
bcs=self.block_bcs,
constant_jacobian=True)

block_solver = fd.LinearVariationalSolver(
block_problem, appctx=appctx_h,
options_prefix=default_block_prefix+str(ii),
Expand Down Expand Up @@ -314,6 +316,9 @@ def update(self, pc):

cpx.set_real(self.u0, ustate)
cpx.set_imag(self.u0, ustate)

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

@profiler()
Expand Down
9 changes: 7 additions & 2 deletions asQ/preconditioners/jacobipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ 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=default_block_prefix+str(ii),
Expand Down Expand Up @@ -168,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 @@ -198,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 ab36e84

Please sign in to comment.