]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix tests after reoving deprecated code 17457/head
authorDaniel Arndt <arndtd@ornl.gov>
Thu, 8 Aug 2024 16:02:10 +0000 (12:02 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Thu, 8 Aug 2024 16:02:24 +0000 (12:02 -0400)
tests/cgal/cgal_surface_mesh_05.cc
tests/symengine/symengine_tensor_operations_04.cc

index bc2f57201a6354870f413b2de7abebe3b5d6ecc8..8508ef2a02128cd9f0eebebe132d89326c2ed099 100644 (file)
@@ -86,7 +86,7 @@ test()
   GridGenerator::hyper_cube(tria1, 0.5, 1.5);
   tria0.refine_global(3);
   tria1.refine_global(3);
-  GridTools::rotate(numbers::PI_4, 2, tria1);
+  GridTools::rotate(Tensor<1, 3>{{0., 0., 1.}}, numbers::PI_4, tria1);
 
   // Move to CGAL surfaces
   dealii_tria_to_cgal_surface_mesh(tria0, surface_mesh0);
index 6841aae744bc68a7470249dca6a4987c99a8ffbb..e36f518a4c131a047d7bf180104c57437ae929b8 100644 (file)
@@ -136,10 +136,29 @@ test_symmetric_tensor()
   using Tensor_t           = SymmetricTensor<rank, dim, double>;
 
   Tensor_t t_a, t_b;
-  for (auto it = t_a.begin_raw(); it != t_a.end_raw(); ++it)
-    *it = 1.0;
-  for (auto it = t_b.begin_raw(); it != t_b.end_raw(); ++it)
-    *it = 2.0;
+
+  static_assert(rank == 2 || rank == 4);
+
+  if constexpr (rank == 2)
+    {
+      for (unsigned int i = 0; i < dim; ++i)
+        for (unsigned int j = 0; j < dim; ++j)
+          {
+            t_a({i, j}) = 1.0;
+            t_b({i, j}) = 2.0;
+          }
+    }
+  else
+    {
+      for (unsigned int i = 0; i < dim; ++i)
+        for (unsigned int j = 0; j < dim; ++j)
+          for (unsigned int k = 0; k < dim; ++k)
+            for (unsigned int l = 0; l < dim; ++l)
+              {
+                t_a({i, j, k, l}) = 1.0;
+                t_b({i, j, k, l}) = 2.0;
+              }
+    }
 
   const Tensor_SD_number_t symb_t_a =
     SD::make_symmetric_tensor_of_symbols<rank, dim>("a");

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.