I was trying to provide a preconditioning form for my Newton solver. I wrote my own NewtonSolver and NonlinearProblem. Here’s what I observed:
- MyNewtonSolver.solver_setup (is exactly the same as NewtonSolver.solver_setup, just for test purpose) does be called and Preconditioning matrix does be created
- MyNonlinearProblem.J_pc(P, x) is never called.
MyNonlinearProblem.J_pc(P, x) is:
def J_pc(self, P, x): print('jpc is called') if self.j_pc is not None: dolfin.assemble(self.j_pc, tensor=P) for bc in self.bcs: bc.apply(P)
Can anyone tell me what to do pls?
Thanks in advance,