On 4/4/25 09:24, Sclah wrote:
>
> - take the gradient of the previous solution
> /fe_values[components].get_function_gradients(old_sol, local_old_grad);/
> - for every quadrature point "q" compute the deformation gradient (F =
> Identity + grad(u))
> /Tensor<2, dim> F = Identity + local_old_grad(q);/
> /Tensor<2, dim> F_inv = invert(F);/
> Now I'd like to compute the divergence of /F_inv/, is there a way to do that?
> I was thinking about automatic differentiation but maybe there is a more
> straightforward way
You need to apply the chain rule. If I understand correctly, you need
div ( [I + grad(u)]^{-1} )
= trace grad ( [I + grad(u)]^{-1} )
which is of the form
grad ( A^{-1} )
and which you can compute by observing that on the one hand
grad ( A A^{-1} ) = grad I = 0
and on the other hand by using the product rule
grad ( A A^{-1} ) = (grad A) A^{-1} + A (grad A^{-1})
and so
grad A^{-1} = - A^{-1} (grad A) A^{-1}
with an appropriate choice of contraction over indices. So that gives you
something (you'll have to check the details) of the form
grad ( [I + grad(u)]^{-1} )
= - Finv grad (I + grad(u)) Finv
= - Finv [grad^2(u))] Finv
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email:
bang...@colostate.edu
www:
http://www.math.colostate.edu/~bangerth/