code-gallery
code-gallery copied to clipboard
Update to AD component of quasi-static Finite-strain compressible elasticity
This modernises the AD data structures used in this code-gallery example.
Currently WIP because I would like to generalise this to all ad_type_code
s that we support (i.e. enable ADOL-C support and choose the AD library in the parameter file).
Currently WIP because I would like to generalise this to all ad_type_codes that we support (i.e. enable ADOL-C support and choose the AD library in the parameter file).
I played around and got the support for any AD numbers working (seems so at least) in my derived code using AD::NumberTraits::n_supported_derivative_levels
. However this constraints the choice between residual and energy AD purely based upon n_supported_derivative_levels
meaning one can't use adolc_taped
for residual linearization. That's probably not how we should recommend using ADHelper, but that's how I got this setup for now. Just my 2c.
However this constraints the choice between residual and energy AD purely based upon n_supported_derivative_levels meaning one can't use adolc_taped for residual linearization.
You could get around this with a more specific check, for example:
enable_if<ADNumberTraits::is_taped || (ADNumberTraits::is_tapeless && ADNumberTraits::n_supported_derivative_levels >= 2)>
I think that this should work in your case.