Open hugary1995 opened 2 years ago
Gary, in practice users could implement a templated computeResidualInternal
function that would take care of both the regular AD and the ADAD compute.
You are right. You make me feel so stupid.
@recuero If you are interested in multi-variate return mapping, what you want to do is to instantiate a type like:
typedef DualNumber<Real, array<Real>> ChainedReal;
typedef DualNumber<ADReal, array<ADReal>> ChainedADReal;
for an array of internal variables, and you need to somehow track the "dof" of the internal variable, i.e. the i-th value in the array corresponds to the derivative of the j-th internal variable. I can't tell which ADT is best for this array without further testing though.
I am also interested in this multi-variate return mapping capability. So if you need any help just let me know.
Thanks, @hugary1995. This feature will come in handy for sure.
Reason
Hand coding the derivative of the yield function can be tedious, and defeat the purpose of using AD to a large extent.
Design
Use forward mode AD to retrieve the derivative of the yield function w.r.t. the effective plastic strain.
Impact
New API, correct jacobian, cleaner code, better maintainability.