]> https://gitweb.dealii.org/ - dealii.git/commitdiff
improve test and add symmetric variant as well
authorMatthias Maier <tamiko@43-1.org>
Sat, 16 May 2020 18:06:28 +0000 (13:06 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sat, 16 May 2020 21:31:20 +0000 (16:31 -0500)
tests/tensors/tensor_31.cc

index 044333517dff540626557f589a885a391307fddf..620c16598b6b68ca2226ffe52c53045f3ab9964c 100644 (file)
 // Test that we can form unusual mixed complex-complex / complex-real
 // tensor products:
 
+#include <deal.II/base/symmetric_tensor.h>
 #include <deal.II/base/tensor.h>
 
 #include "../tests.h"
 
+void
+test_symmetric()
+{
+  constexpr int dim = 3;
+
+  typedef std::complex<double>                   rank0_complex;
+  dealii::Tensor<1, dim, rank0_complex>          curl_complex;
+  dealii::SymmetricTensor<2, dim, rank0_complex> permeability_complex;
+
+  typedef std::complex<float>                 rank0_complex_float;
+  dealii::Tensor<1, dim, rank0_complex_float> curl_complex_float;
+  dealii::Tensor<2, dim, rank0_complex_float> permeability_complex_float;
+
+  typedef double                rank0;
+  dealii::Tensor<1, dim, rank0> curl;
+  dealii::Tensor<2, dim, rank0> permeability;
+
+  typedef double                      rank0_float;
+  dealii::Tensor<1, dim, rank0_float> curl_float;
+  dealii::Tensor<2, dim, rank0_float> permeability_float;
+
+  curl_complex *      curl;
+  curl_complex *      curl_complex;
+  curl_complex *      curl_complex_float;
+  curl_complex *      curl_float;
+  curl_complex_float *curl;
+  curl_complex_float *curl_complex;
+  curl_complex_float *curl_complex_float;
+  curl_complex_float *curl_float;
+  curl_complex_float *permeability_complex *curl;
+  curl_complex_float *permeability_complex *curl_complex;
+  curl_complex_float *permeability_complex *curl_complex_float;
+  curl_complex_float *permeability_complex *curl_float;
+  curl_complex_float *permeability_complex_float *curl;
+  curl_complex_float *permeability_complex_float *curl_complex;
+  curl_complex_float *permeability_complex_float *curl_complex_float;
+  curl_complex_float *permeability_complex_float *curl_float;
+  curl_complex_float *permeability *curl;
+  curl_complex_float *permeability *curl_complex;
+  curl_complex_float *permeability *curl_complex_float;
+  curl_complex_float *permeability *curl_float;
+  curl_complex_float *permeability_float *curl;
+  curl_complex_float *permeability_float *curl_complex;
+  curl_complex *permeability_complex *curl;
+  curl_complex *permeability_complex *curl_complex;
+  curl_complex *permeability_complex *curl_complex_float;
+  curl_complex *permeability_complex *curl_float;
+  curl_complex *permeability_complex_float *curl;
+  curl_complex *permeability_complex_float *curl_complex;
+  curl_complex *permeability_complex_float *curl_complex_float;
+  curl_complex *permeability_complex_float *curl_float;
+  curl_complex *permeability *curl;
+  curl_complex *permeability *curl_complex;
+  curl_complex *permeability *curl_complex_float;
+  curl_complex *permeability *curl_float;
+  curl_complex *permeability_float *curl;
+  curl_complex *permeability_float *curl_complex;
+  curl *                            curl;
+  curl *                            curl_complex;
+  curl *                            curl_complex_float;
+  curl *                            curl_float;
+  curl_float *                      curl;
+  curl_float *                      curl_complex;
+  curl_float *                      curl_complex_float;
+  curl_float *                      curl_float;
+  curl_float *permeability_complex *curl;
+  curl_float *permeability_complex *curl_complex;
+  curl_float *permeability_complex *curl_complex_float;
+  curl_float *permeability_complex *curl_float;
+  curl_float *permeability_complex_float *curl;
+  curl_float *permeability_complex_float *curl_complex;
+  curl_float *permeability_complex_float *curl_complex_float;
+  curl_float *permeability_complex_float *curl_float;
+  curl_float *permeability *curl;
+  curl_float *permeability *curl_complex;
+  curl_float *permeability *curl_complex_float;
+  curl_float *permeability *curl_float;
+  curl_float *permeability_float *curl;
+  curl_float *permeability_float *curl_complex;
+  curl *permeability_complex *curl;
+  curl *permeability_complex *curl_complex;
+  curl *permeability_complex *curl_complex_float;
+  curl *permeability_complex *curl_float;
+  curl *permeability_complex_float *curl;
+  curl *permeability_complex_float *curl_complex;
+  curl *permeability_complex_float *curl_complex_float;
+  curl *permeability_complex_float *curl_float;
+  curl *permeability *curl;
+  curl *permeability *curl_complex;
+  curl *permeability *curl_complex_float;
+  curl *permeability *curl_float;
+  curl *permeability_float *curl;
+  curl *permeability_float *  curl_complex;
+  permeability_complex *      curl;
+  permeability_complex *      curl_complex;
+  permeability_complex *      curl_complex_float;
+  permeability_complex *      curl_float;
+  permeability_complex_float *curl;
+  permeability_complex_float *curl_complex;
+  permeability_complex_float *curl_complex_float;
+  permeability_complex_float *curl_float;
+  permeability *              curl;
+  permeability *              curl_complex;
+  permeability *              curl_complex_float;
+  permeability *              curl_float;
+  permeability_float *        curl;
+  permeability_float *        curl_complex;
+}
+
 template <int dim>
 void
 test()
@@ -34,9 +144,9 @@ test()
   dealii::Tensor<dim == 2 ? 0 : 2, dim, rank0_complex_float>
     permeability_complex_float;
 
-  typedef double                                    rank0;
-  dealii::Tensor<1, dim == 2 ? 1 : dim, rank0_real> curl;
-  dealii::Tensor<dim == 2 ? 0 : 2, dim, rank0_real> permeability;
+  typedef double                               rank0;
+  dealii::Tensor<1, dim == 2 ? 1 : dim, rank0> curl;
+  dealii::Tensor<dim == 2 ? 0 : 2, dim, rank0> permeability;
 
   typedef double                                     rank0_float;
   dealii::Tensor<1, dim == 2 ? 1 : dim, rank0_float> curl_float;
@@ -137,6 +247,7 @@ main(int argc, char *argv[])
 
   test<2>();
   test<3>();
+  test_symmetric();
 
   deallog << "OK" << std::endl;
 

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.