Dear Doug, > Looking at the current implementation in fe_values, mapping_q_generic, and > local integrators, I see that it looks relatively easy to template the value > type since it is already partially templated. > > Is there a reason why those functions were not templates?
No, its likely that a more generic use-case was just never considered — this was previously found to be the case from the “pre-AD supported” implementation of FEValues <https://github.com/dealii/dealii/pull/5474/files> and FEValuesViews <https://github.com/dealii/dealii/pull/4742/files> classes. We’d be happy to accept any patches that adds AD support to the classes that you find to be lacking it. > Is there anything we should be careful about before we start templating those > functions? Yes, off the top of my head I can think of at least one interesting issue that you may face. There are occasional checks / shortcuts that are used to speed up computations (using floating-point types), but would invalidate AD-based evaluation. See one such example here <https://github.com/dealii/dealii/blob/master/source/fe/fe_values.cc#L467-L471>. You’d need to check carefully for similar cases and make sure that the entire computational graph is traversed in order for the result of differentiation to be correct. Best, Jean-Paul -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.