]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove specialization of CellwiseInverseMassMatrixImplBasic::run() 14955/head
authorPeter Munch <peterrmuench@gmail.com>
Thu, 23 Mar 2023 14:06:46 +0000 (15:06 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Thu, 15 Jun 2023 20:24:04 +0000 (22:24 +0200)
include/deal.II/matrix_free/evaluation_kernels.h

index e193d75e289e583bb541e1224f5fd3dc6ff252da..0f083d655c485a47d3c83b73b43fcce3d3bd8d3d 100644 (file)
@@ -5555,11 +5555,14 @@ namespace internal
     run(const unsigned int                          n_components,
         const FEEvaluationData<dim, Number, false> &fe_eval,
         const Number *                              in_array,
-        Number *                                    out_array,
-        std::enable_if_t<fe_degree != -1> * = nullptr)
+        Number *                                    out_array)
     {
-      constexpr unsigned int dofs_per_component =
-        Utilities::pow(fe_degree + 1, dim);
+      const unsigned int given_degree =
+        (fe_degree > -1) ? fe_degree :
+                           fe_eval.get_shape_info().data.front().fe_degree;
+
+      const unsigned int dofs_per_component =
+        Utilities::pow(given_degree + 1, dim);
 
       Assert(dim >= 1 || dim <= 3, ExcNotImplemented());
       Assert(fe_eval.get_shape_info().element_type <=
@@ -5572,10 +5575,11 @@ namespace internal
                              fe_degree + 1,
                              Number,
                              Number2>
-        evaluator(
-          {},
-          {},
-          fe_eval.get_shape_info().data.front().inverse_shape_values_eo);
+        evaluator({},
+                  {},
+                  fe_eval.get_shape_info().data.front().inverse_shape_values_eo,
+                  given_degree + 1,
+                  given_degree + 1);
 
       for (unsigned int d = 0; d < n_components; ++d)
         {
@@ -5606,57 +5610,6 @@ namespace internal
         }
       return false;
     }
-
-    template <int fe_degree, int = 0>
-    static bool
-    run(const unsigned int                          n_components,
-        const FEEvaluationData<dim, Number, false> &fe_eval,
-        const Number *                              in_array,
-        Number *                                    out_array,
-        std::enable_if_t<fe_degree == -1> * = nullptr)
-    {
-      static_assert(fe_degree == -1, "Only usable for degree -1");
-      const unsigned int dofs_per_component =
-        fe_eval.get_shape_info().dofs_per_component_on_cell;
-
-      Assert(dim >= 1 || dim <= 3, ExcNotImplemented());
-
-      EvaluatorTensorProduct<evaluate_general, dim, 0, 0, Number, Number2>
-        evaluator(fe_eval.get_shape_info().data.front().inverse_shape_values,
-                  {},
-                  {},
-                  fe_eval.get_shape_info().data.front().fe_degree + 1,
-                  fe_eval.get_shape_info().data.front().fe_degree + 1);
-
-      for (unsigned int d = 0; d < n_components; ++d)
-        {
-          const Number *in  = in_array + d * dofs_per_component;
-          Number *      out = out_array + d * dofs_per_component;
-          // Need to select 'apply' method with hessian slot because values
-          // assume symmetries that do not exist in the inverse shapes
-          evaluator.template values<0, true, false>(in, out);
-          if (dim > 1)
-            evaluator.template values<1, true, false>(out, out);
-          if (dim > 2)
-            evaluator.template values<2, true, false>(out, out);
-        }
-      for (unsigned int q = 0; q < dofs_per_component; ++q)
-        {
-          const Number inverse_JxW_q = Number(1.) / fe_eval.JxW(q);
-          for (unsigned int d = 0; d < n_components; ++d)
-            out_array[q + d * dofs_per_component] *= inverse_JxW_q;
-        }
-      for (unsigned int d = 0; d < n_components; ++d)
-        {
-          Number *out = out_array + d * dofs_per_component;
-          if (dim > 2)
-            evaluator.template values<2, false, false>(out, out);
-          if (dim > 1)
-            evaluator.template values<1, false, false>(out, out);
-          evaluator.template values<0, false, false>(out, out);
-        }
-      return false;
-    }
   };
 
 

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.