-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to AD component of quasi-static Finite-strain compressible elasticity #50
base: master
Are you sure you want to change the base?
Conversation
Currently WIP because I would like to generalise this to all |
|
||
template <int dim> | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, Differentiation::AD::ADNumberTraits<ADNumberType>::type_code
defines this backwards link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.