]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve error message for odd rank SymmetricTensor
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 20 Aug 2017 15:28:30 +0000 (17:28 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 20 Aug 2017 15:35:28 +0000 (17:35 +0200)
include/deal.II/base/symmetric_tensor.h

index b2e680b45f800b205fe2e7cfe8e37f867e7c5290..0531adadae6b6fbd660b2bad451462dc1870e57e 100644 (file)
@@ -517,6 +517,8 @@ template <int rank, int dim, typename Number>
 class SymmetricTensor
 {
 public:
+  static_assert(rank%2==0, "A SymmetricTensor must have even rank!");
+
   /**
    * Provide a way to get the dimension of an object without explicit
    * knowledge of it's data type. Implementation is this way instead of

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.