Hello everyone,
I’m running the tutorial on linear elasticity (Implementation — FEniCSx tutorial).
I added a function to compute the divergence of the stresses given a displacement field, i.e.
def div_sigma(u):
return ufl.nabla_div(sigma(u))
which I call and plot with
div_sigs = div_sigma(uh)
divS = Function(V)
divSigs_expr = fem.Expression(div_sigs, V.element.interpolation_points())
divS.interpolate(divSigs_expr)
with XDMFFile(MPI.COMM_WORLD, "divSig.xdmf", "w") as file:
file.write_mesh(domain)
file.write_function(divS)
where $$uh$$ is the solution to the linear problem.
This might be a naive question, but given
I’d expect the divergence of the stresses to equal the negative body forces $$-f$$. However, the result is always zero in every coordinate.
Am I missing something obvious?
//Lucas