This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

How to get the matrix of linear operator?

+1 vote

Hi!
I have a solution u and functional f:

V = FunctionSpace(mesh, 'Lagrange', 1)
u = Function(V)
...
n = FacetNormal(mesh)
h_edges = FacetArea(mesh)
f = (sqrt(h_edges("+"))*jump(grad(u),n))**2*dS

How can I get a matrix of operator
A:V->V,
Au = sqrt(h_edges)*jump(grad(u),n)

Thanks!

asked Apr 15, 2016 by ashoka FEniCS Novice (270 points)
edited Apr 16, 2016 by ashoka

Hi, is $A(u+v) = Au + Av$ ?

Sorry, of course, I have corrected.
I want for any given solution u:
v = Function(V)
v.vector() = Au.vector()
f(u) == assemble(v**2*dS)

1 Answer

0 votes

Not sure if I really understand the question. Anyway, in
nonlinear elasticity problems it is common to seek
the minimiser of an energy functional. The way this
is done is to define the nonlinear energy functional
which is the differentiated twice to get the matrix and
right hand side to be solved
in each iteration in a Newton algorithm. Look
for example in the hyperelasticity demo for an
example of how this is done.

answered Apr 18, 2016 by Kent-Andre Mardal FEniCS Expert (14,380 points)
...