]> https://gitweb.dealii.org/ - dealii.git/commitdiff
SymmetricTensor: use ndarray.
authorDavid Wells <drwells@email.unc.edu>
Sun, 12 Nov 2023 12:41:52 +0000 (07:41 -0500)
committerDavid Wells <drwells@email.unc.edu>
Sun, 12 Nov 2023 13:28:08 +0000 (08:28 -0500)
include/deal.II/base/symmetric_tensor.h

index 5bf97c94b55159899b2fa227e097e4d9c135f287..9ce3e5389566f0d04caef28a498bbdf83609ffd5 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <deal.II/base/config.h>
 
+#include <deal.II/base/ndarray.h>
 #include <deal.II/base/numbers.h>
 #include <deal.II/base/table_indices.h>
 #include <deal.II/base/template_constraints.h>
@@ -2025,30 +2026,27 @@ namespace internal
             {
               return 0;
             }
-
           case 2:
             {
-              constexpr unsigned int table[2][2] = {{0, 2}, {2, 1}};
+              constexpr dealii::ndarray<unsigned int, 2, 2> table = {
+                {{{0, 2}}, {{2, 1}}}};
               return table[indices[0]][indices[1]];
             }
-
           case 3:
             {
-              constexpr unsigned int table[3][3] = {{0, 3, 4},
-                                                    {3, 1, 5},
-                                                    {4, 5, 2}};
+              constexpr dealii::ndarray<unsigned int, 3, 3> table = {
+                {{{0, 3, 4}}, {{3, 1, 5}}, {{4, 5, 2}}}};
               return table[indices[0]][indices[1]];
             }
-
           case 4:
             {
-              constexpr unsigned int table[4][4] = {{0, 4, 5, 6},
-                                                    {4, 1, 7, 8},
-                                                    {5, 7, 2, 9},
-                                                    {6, 8, 9, 3}};
+              constexpr dealii::ndarray<unsigned int, 4, 4> table = {
+                {{{0, 4, 5, 6}},
+                 {{4, 1, 7, 8}},
+                 {{5, 7, 2, 9}},
+                 {{6, 8, 9, 3}}}};
               return table[indices[0]][indices[1]];
             }
-
           default:
             // for the remainder, manually figure out the numbering
             {

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.