Hello everyone,
I am exploring the use of automatic differentiation (AD) with the FinEtoolsFlexStructures.jl package and would like to know if anyone has experience with this. Specifically, I aim to compute the derivative of the stiffness matrix K with respect to element thickness t.
Here is a naive approach I’ve tried so far:
- Defined a
femm
function:
femm(thickness) = formul.make(IntegDomain(fes, TriRule(1), thickness), mater)
- Created a function to calculate K(t):
function KT(thickness)
femm = femm(thickness)
associategeometry!(femm, geom0)
K = stiffness(femm, massem, geom0, u0, Rfield0, dchi)
end
- Used the
DifferentiationInterface
to compute the derivative:
derivative(KT, backend, 0.1)
I experimented with a few different backends, but without much success so far.
Eventually, my goal is to compute the gradients of elements with respect to thickness and node location for shape and thickness optimization. However, I currently have limited knowledge of both FinEtoolsFlexStructures.jl and DifferentiationInterface.
Has anyone attempted something similar, or could you provide insights into how to approach this problem? Any guidance or suggestions would be greatly appreciated!
Thank you!