Skip to content

Commit

Permalink
Merge pull request #1330 from firedrakeproject/assembledpcfix
Browse files Browse the repository at this point in the history
* assembledpcfix:
  fixes a bug in assembled pc when not using mat_type=matfree
  • Loading branch information
wence- committed Nov 14, 2018
2 parents d07ca9c + 2910692 commit 556fec2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions firedrake/preconditioners/assembled.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,13 @@ def update(self, pc):

def form(self, pc, test, trial):
_, P = pc.getOperators()
assert P.type == "python"
context = P.getPythonContext()
return (context.a, context.row_bcs)
if P.getType() == "python":
context = P.getPythonContext()
return (context.a, context.row_bcs)
else:
from firedrake.dmhooks import get_appctx
context = get_appctx(pc.getDM())
return (context.Jp or context.J, context._problem.bcs)

def apply(self, pc, x, y):
self.pc.apply(x, y)
Expand Down

0 comments on commit 556fec2

Please sign in to comment.