Argonne-National-Laboratory / neml

Modular consitutive modeling library for structural materials
Other
10 stars 21 forks source link

Template NEML objects on number type #17

Open dschwen opened 5 years ago

dschwen commented 5 years ago

For integration with MOOSE it would be nice to be able to create NEML classes templated on either regular floating point numbers as well as dual numbers (to compute derivatives using forward mode automatic differentiation).

I guess this would make NEML a largely header only library which might no be ideal for other users though :-/

Just throwing this out.

reverendbedford commented 2 years ago

So to resurrect this very dead issue:

Would being able to compile alternate versions of the library by doing something like:

#define Scalar double

be enough? Or do you really want the ability to template on the scalar type?

I intend to have everything done by the end of the summer where you can swap the scalar real type in a couple of places (the history/internal state system and the tensor math classes) and have that change propagate to the entirety of the library. We can think on what to do once that's done.

dschwen commented 2 years ago

Hm. I suspect we might only need dual numbers in very few places, with the mechanics Jacobians all being implemented fully. Let me think about this some more.