]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Slightly relax condition for even-odd tensor product value path. 6234/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 12 Apr 2018 19:03:39 +0000 (21:03 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 12 Apr 2018 19:03:39 +0000 (21:03 +0200)
include/deal.II/matrix_free/shape_info.templates.h
include/deal.II/matrix_free/tensor_product_kernels.h
tests/matrix_free/evaluate_1d_shape_02.cc
tests/matrix_free/evaluate_1d_shape_05.cc
tests/matrix_free/evaluate_1d_shape_08.cc

index 8260f8f869d4cb236880d86ab01124306e2fa6ad..a47d16ab69b21796a3bbd264501b50091f48de2d 100644 (file)
@@ -390,16 +390,13 @@ namespace internal
             return false;
 
       // shape values should be zero at x=0.5 for all basis functions except
-      // for one which is one
+      // for the middle one
       if (n_q_points_1d%2 == 1 && n_dofs_1d%2 == 1)
         {
           for (unsigned int i=0; i<n_dofs_1d/2; ++i)
             if (std::abs(get_first_array_element(shape_values[i*n_q_points_1d+
                                                               n_q_points_1d/2])) > zero_tol)
               return false;
-          if (std::abs(get_first_array_element(shape_values[(n_dofs_1d/2)*n_q_points_1d+
-                                                            n_q_points_1d/2])-1.)> zero_tol)
-            return false;
         }
 
       // skew-symmetry for gradient, zero of middle basis function in middle
index 62dc19dc51b36f400391096ecf4b1efdda432035..1056bbf0dc57a313d47af524757bada6ee3a2bec 100644 (file)
@@ -1621,9 +1621,9 @@ namespace internal
             if ( type == 0 && contract_over_rows == true && nn%2==1 && mm%2==1 )
               {
                 if (add==false)
-                  out[stride*n_cols]  = xmid;
+                  out[stride*n_cols]  = shapes[mid*offset+n_cols] * xmid;
                 else
-                  out[stride*n_cols] += xmid;
+                  out[stride*n_cols] += shapes[mid*offset+n_cols] * xmid;
               }
             else if (contract_over_rows == true && nn%2==1)
               {
@@ -1665,9 +1665,7 @@ namespace internal
                 else
                   r0 = Number();
 
-                if (type == 0 && mm % 2 == 1)
-                  r0 += xmid;
-                else if (type == 2 && mm % 2 == 1)
+                if ((type == 0 || type == 2) && mm % 2 == 1)
                   r0 += shapes[n_cols*offset+mid] * xmid;
 
                 if (add == false)
index d0c5e11eeef1375ab10219a89939f1f23560e9b9..4f74c0c4ed41f01954c483c9721431cf11b4b6bf 100644 (file)
@@ -42,7 +42,7 @@ void test()
     {
       for (unsigned int i=0; i<M; ++i)
         shape[i][N/2] = 0.;
-      shape[M/2][N/2] = 1;
+      shape[M/2][N/2] = 0.9;
     }
   if (type == 1 && M%2 == 1 && N%2 == 1)
     shape[M/2][N/2] = 0.;
index 43c715b8aa3f5e384284deaef3dcc5b8fa46e568..50aded965891be7a17576c71aaa522a96db834f0 100644 (file)
@@ -42,7 +42,7 @@ void test()
     {
       for (unsigned int i=0; i<M; ++i)
         shape[i][N/2] = 0.;
-      shape[M/2][N/2] = 1;
+      shape[M/2][N/2] = 0.9;
     }
   if (type == 1 && M%2 == 1 && N%2 == 1)
     shape[M/2][N/2] = 0.;
index 4871a6768d87732963f7c340942f3c6bfd440179..dffc04ed68212930f2a91e4e2aa0aeee6e72a759 100644 (file)
@@ -16,7 +16,7 @@
 
 
 // check the correctness of the 1d evaluation functions used in FEEvaluation,
-// path evaluate_general, when using a double array for coefficients but
+// path evaluate_evenodd, when using a double array for coefficients but
 // VectorizedArray for the input and output vector
 
 #include "../tests.h"
@@ -44,7 +44,7 @@ void test()
     {
       for (unsigned int i=0; i<M; ++i)
         shape[i][N/2] = 0.;
-      shape[M/2][N/2] = 1;
+      shape[M/2][N/2] = 0.9;
     }
   if (type == 1 && M%2 == 1 && N%2 == 1)
     shape[M/2][N/2] = 0.;

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.