Re: [deal.II] Compute the divergence of a tensor

2025-04-04 Thread Sclah
Yes, thank you for the warning, that could be an issue indeed. In my case I am using P2 elements, I'll check the best way to approach this, thank you! Il giorno venerdì 4 aprile 2025 alle 18:29:26 UTC+2 Wolfgang Bangerth ha scritto: > On 4/4/25 10:25, Sclah wrote: > > ** > > > > Yes! Thank yo

Re: [deal.II] Compute the divergence of a tensor

2025-04-04 Thread Wolfgang Bangerth
On 4/4/25 10:25, Sclah wrote: ** Yes! Thank you very much, I was indeed missing the mathematical derivation. I better checked my computations and I actually need: /div([I + grad(u)]^{-T})/ instead of /div([I + grad(u)]^{-1})/  but following your steps that leads to a similar result: /div([I +

Re: [deal.II] Compute the divergence of a tensor

2025-04-04 Thread Sclah
Yes! Thank you very much, I was indeed missing the mathematical derivation. I better checked my computations and I actually need: *div([I + grad(u)]^{-T})* instead of *div([I + grad(u)]^{-1})* but following your steps that leads to a similar result: *div([I + grad(u)]^{-T}) = - Finv [grad(grad(

[deal.II] Compute the divergence of a tensor

2025-04-04 Thread Sclah
Hello everyone, I am trying to implement a continuous mechanics simulation and I am encountering troubles trying to compute the divergence of the deformation gradient inverse. I need it to assemble the variational form terms. My code reads something like the following: - take the gradient of the

Re: [deal.II] Compute the divergence of a tensor

2025-04-04 Thread Wolfgang Bangerth
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);/ /Ten