Hi,
I have a nonlinear problem defined in the following way
self.mesh = dolfin.Mesh(meshXML);
V = FunctionSpace(self.mesh, 'Lagrange', self.lagrangeSpaceDim)
bc = boundary_definition()
du = TrialFunction(V)
u_ = Function(V) # most recently computed solution
u_ = self.solveLinearOn(V, bc)#interpolate(Expression("x[0]"), V)
#could not call u_ = self.solveLinear(meshXML, lagrangeSpaceDim) this problem described here
#http://fenicsproject.org/qa/3537/mesh-xml-inconsistent-import
v = TestFunction(V)
F = inner(self.psi(sqrt(2)*sqrt(inner(nabla_grad(u_), nabla_grad(u_))))*nabla_grad(u_), nabla_grad(v))*dx
J = derivative(F, u_, du) # Gateaux derivative in dir. of du
#could not do problem = NonlinearVariationalProblem(F, u_, bc.fullBC(V), J) probably due to pointer misimplementation
bcs = bc.fullBC(V)
problem = NonlinearVariationalProblem(F, u_, bcs, J)
so that u_ is a initial guess solution. Then I basically call
solver = NonlinearVariationalSolver(problem)
solver.solve()
return(u_)
I would like for particular object u_ (which I import from elsewhere or solve by another program) to know residual norm of the F. So basically norm of the vector of F applied on each test function, which is called residual norm. Is there some way to do that?
I found that NonlinearVariationalProblem has member residual_form(). But I do not know how extract the information about its particullar value for the set of test functions.