code-gallery icon indicating copy to clipboard operation
code-gallery copied to clipboard

Update to AD component of quasi-static Finite-strain compressible elasticity

Open jppelteret opened this issue 6 years ago • 3 comments

This modernises the AD data structures used in this code-gallery example.

jppelteret avatar Jan 22 '19 17:01 jppelteret

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).

jppelteret avatar Jan 22 '19 17:01 jppelteret

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.

davydden avatar Jan 23 '19 15:01 davydden

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.

jppelteret avatar Jan 23 '19 16:01 jppelteret