]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix tester: remove constant expression. 9580/head
authorMenno Fraters <menno.fraters@outlook.com>
Tue, 3 Mar 2020 04:32:33 +0000 (20:32 -0800)
committerMenno Fraters <menno.fraters@outlook.com>
Thu, 5 Mar 2020 01:36:31 +0000 (17:36 -0800)
include/deal.II/base/tensor.h
tests/ad_common_tests/tensor_functions_01.h
tests/tensors/constexpr_tensor.cc

index dd4727d2f2fa0b0c3a97061e2a728d4d1d2d3616..05bae7e4ca8f29ee89ee99ed70ad92f62b7e36d1 100644 (file)
@@ -2631,7 +2631,7 @@ cofactor(const Tensor<2, dim, Number> &t)
  * @relatesalso Tensor
  */
 template <int dim, typename Number>
-constexpr Tensor<2, dim, Number>
+Tensor<2, dim, Number>
 project_onto_orthogonal_tensors(const Tensor<2, dim, Number> &tensor,
                                 const double                  tolerance)
 {
index d0813fa81ad947fd69fb578db37c91e06c198c9f..e00e044980ff97b3546df7d92d845b6c11394204 100644 (file)
@@ -55,16 +55,14 @@ test_tensor()
   const Tensor<2, dim, ADNumberType> C5 = A * a;
   const Tensor<2, dim, ADNumberType> C6 = A / a;
 
-  const ADNumberType                 det_A = determinant(A);
-  const ADNumberType                 tr_A  = trace(A);
-  const Tensor<2, dim, ADNumberType> A_inv = invert(A);
-  const Tensor<2, dim, ADNumberType> A_T   = transpose(A);
-  const Tensor<2, dim, ADNumberType> A_adj = adjugate(A);
-  const Tensor<2, dim, ADNumberType> A_cof = cofactor(A);
-  const Tensor<2, dim, ADNumberType> A_orth =
-    project_onto_orthogonal_tensors(A);
-  const ADNumberType A_l1_norm   = l1_norm(A, 1e-8);
-  const ADNumberType A_linf_norm = linfty_norm(A);
+  const ADNumberType                 det_A       = determinant(A);
+  const ADNumberType                 tr_A        = trace(A);
+  const Tensor<2, dim, ADNumberType> A_inv       = invert(A);
+  const Tensor<2, dim, ADNumberType> A_T         = transpose(A);
+  const Tensor<2, dim, ADNumberType> A_adj       = adjugate(A);
+  const Tensor<2, dim, ADNumberType> A_cof       = cofactor(A);
+  const ADNumberType                 A_l1_norm   = l1_norm(A);
+  const ADNumberType                 A_linf_norm = linfty_norm(A);
 
   const ADNumberType A_ddot_B = double_contract<0, 0, 1, 1>(A, B);
   const Tensor<2, dim, ADNumberType> A_dot_B = contract<1, 0>(A, B);
index 53c08dfb5b5433c9b53e2c39045b27e2d96fc0a2..de75112e035a8c70a4a4a2931721baaa7235557f 100644 (file)
@@ -181,7 +181,7 @@ main()
     DEAL_II_CONSTEXPR const auto dummy_8 = cofactor(a);
     deallog << "Deteriminant before orthogonalization: " << determinant(a)
             << std::endl;
-    const auto dummy_9 = project_onto_orthogonal_tensors(a, 1e-8);
+    const auto dummy_9 = project_onto_orthogonal_tensors(a, 0);
     deallog << "Deteriminant after  orthogonalization: " << determinant(dummy_9)
             << std::endl;
     Assert(determinant(dummy_9) - 1. < 1e-8, ExcInternalError());

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.