Update to AD component of quasi-static Finite-strain compressible elasticity#50
Update to AD component of quasi-static Finite-strain compressible elasticity#50jppelteret wants to merge 4 commits intodealii:masterfrom
Conversation
|
Currently WIP because I would like to generalise this to all |
| struct Assembler<dim,Sacado::Fad::DFad<double> > : Assembler_Base<dim,Sacado::Fad::DFad<double> > | ||
| { | ||
| typedef Sacado::Fad::DFad<double> ADNumberType; | ||
| using ADHelper = AD::ADHelperResidualLinearization<AD::NumberTypes::sacado_dfad,double>; |
There was a problem hiding this comment.
I started applying this to the code derived from the code gallery and indeed, we certainly need a way to go from an arbitrary (AD) NumberType to the enumerator, and thus as you said, we need something like none for non-AD types.
EDIT: I think if works for current AD number types, that would actually already be enough, at least in my case, as far as I can tell. Let me se if I can add this tomorrow...
There was a problem hiding this comment.
I actually like the idea of an AD::NumberTypes::None. It would have simplified some of my own code, so I think I'd still like to implement it. It shouldn't be too much work.
There was a problem hiding this comment.
sure, I agree, it will be useful regardless. What I meant is that even without None the link from AD numbers to enumerators can help.
There was a problem hiding this comment.
For the record, Differentiation::AD::ADNumberTraits<ADNumberType>::type_code defines this backwards link.
There was a problem hiding this comment.
nice 👍 Did not know about that. Thanks for the link.
I played around and got the support for any AD numbers working (seems so at least) in my derived code using |
You could get around this with a more specific check, for example: I think that this should work in your case. |
This modernises the AD data structures used in this code-gallery example.