From: Jean-Paul Pelteret Date: Sat, 21 Jul 2018 14:41:04 +0000 (+0200) Subject: Add AD number static asserts for FullMatrix and Vector classes. X-Git-Tag: v9.1.0-rc1~899^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6943%2Fhead;p=dealii.git Add AD number static asserts for FullMatrix and Vector classes. --- diff --git a/include/deal.II/lac/full_matrix.h b/include/deal.II/lac/full_matrix.h index fc2cb0f76a..77600face8 100644 --- a/include/deal.II/lac/full_matrix.h +++ b/include/deal.II/lac/full_matrix.h @@ -23,6 +23,8 @@ #include #include +#include + #include #include @@ -68,6 +70,12 @@ template class FullMatrix : public Table<2, number> { public: + // The assertion in full_matrix.templates.h for whether or not a number is + // finite is not compatible for AD number types. + static_assert( + !Differentiation::AD::is_ad_number::value, + "The FullMatrix class does not support auto-differentiable numbers."); + /** * A type of used to index into this container. */ diff --git a/include/deal.II/lac/vector.h b/include/deal.II/lac/vector.h index 13c67eeaaa..a6dfa1cdc9 100644 --- a/include/deal.II/lac/vector.h +++ b/include/deal.II/lac/vector.h @@ -24,6 +24,8 @@ #include #include +#include + #include #include @@ -108,6 +110,12 @@ template class Vector : public Subscriptor { public: + // The assertion in vector.templates.h for whether or not a number is + // finite is not compatible for AD number types. + static_assert( + !Differentiation::AD::is_ad_number::value, + "The Vector class does not support auto-differentiable numbers."); + /** * Declare standard types used in all containers. These types parallel those * in the C++ standard libraries vector<...> class.