Print or save matrices from functional or weak form
7 months ago by
I apologize for being new to fenics. I would like to print or, better, save the matrix of my system to read it in Matlab. In particular I would like to do this:
1) Starting from a functional J, obtain its Jacobian. If I write
W = FunctionSpace(mesh, feW)
w = Function(W)
G = derivative(J,w)
bcs= boundary conditions
then I can solve the problem, but by doing:
Gmat = assemble(G)
G seems only to be a vector (maybe of the residuals?). How can I obtain the matrix of the system/jacobian of the functional?
2) I would like to do the same with variational formulation, expressed with test functions.
3) How can I do 1) and 2) with/without strongly imposed BCS?
Thank you very much in advance. Any help would be really appreciated.
Community: FEniCS Project
Please login to add an answer/comment or follow this question.