]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remve n_dofs_1d from local operation class of matrix-free operation 18041/head
authorPeter Munch <peterrmuench@gmail.com>
Tue, 28 Jan 2025 11:56:42 +0000 (12:56 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Tue, 28 Jan 2025 14:33:02 +0000 (15:33 +0100)
doc/news/changes/minor/20250128Munch [new file with mode: 0644]
examples/step-64/step-64.cc
include/deal.II/matrix_free/portable_matrix_free.h
tests/matrix_free_kokkos/coefficient_eval_device.cc
tests/matrix_free_kokkos/matrix_free_device_no_index_initialize.cc
tests/matrix_free_kokkos/matrix_vector_device_mf.h
tests/matrix_free_kokkos/matrix_vector_host_device_multi_component.cc

diff --git a/doc/news/changes/minor/20250128Munch b/doc/news/changes/minor/20250128Munch
new file mode 100644 (file)
index 0000000..7eb5ca9
--- /dev/null
@@ -0,0 +1,4 @@
+Improved: Local operation classes of the portable matrix-free
+infrastructure do not need n_dofs_1d anymore.
+<br>
+(Peter Munch, 2024/01/28)
index 8c01989c05e6ebe4358d063f7d0a80739b07f3c2..aee6c2025860e1003cdcebf6e9947bb78c5e4174 100644 (file)
@@ -76,9 +76,8 @@ namespace Step64
     // arrays, we need to store the number of quadrature points and the
     // number of degrees of freedom in this class to do necessary index
     // conversions.
-    static const unsigned int n_dofs_1d    = fe_degree + 1;
-    static const unsigned int n_local_dofs = Utilities::pow(n_dofs_1d, dim);
-    static const unsigned int n_q_points   = Utilities::pow(n_dofs_1d, dim);
+    static const unsigned int n_local_dofs = Utilities::pow(fe_degree + 1, dim);
+    static const unsigned int n_q_points   = Utilities::pow(fe_degree + 1, dim);
 
   private:
     double *coef;
@@ -191,7 +190,6 @@ namespace Step64
     // Again, the Portable::MatrixFree object doesn't know about the number
     // of degrees of freedom and the number of quadrature points so we need
     // to store these for index calculations in the call operator.
-    static constexpr unsigned int n_dofs_1d = fe_degree + 1;
     static constexpr unsigned int n_local_dofs =
       Utilities::pow(fe_degree + 1, dim);
     static constexpr unsigned int n_q_points =
index 8dcfa4e0eefc3630b51eff677de648c097f95498..dc1b9c22cf75d939696b2877967fa69ea545671b 100644 (file)
@@ -327,7 +327,6 @@ namespace Portable
      *   Portable::SharedData<dim, Number> *                     shared_data,
      *   const Number *                                              src,
      *   Number *                                                    dst) const;
-     *   static const unsigned int n_dofs_1d;
      *   static const unsigned int n_local_dofs;
      *   static const unsigned int n_q_points;
      * \endcode
@@ -349,7 +348,6 @@ namespace Portable
      *  DEAL_II_HOST_DEVICE void operator()(
      *    const unsigned int                                          cell,
      *    const typename Portable::MatrixFree<dim, Number>::Data *gpu_data);
-     * static const unsigned int n_dofs_1d;
      * static const unsigned int n_local_dofs;
      * static const unsigned int n_q_points;
      * \endcode
index db5fdaca950b3590cc5a4e162191cc9a916873f7..a7fc778f0934c63060888e57a95c67f3d0636ff7 100644 (file)
@@ -42,7 +42,6 @@ public:
              const double                      *src,
              double                            *dst) const;
 
-  static const unsigned int n_dofs_1d = fe_degree + 1;
   static const unsigned int n_local_dofs =
     dealii::Utilities::pow(fe_degree + 1, dim);
   static const unsigned int n_q_points =
index ae841c73d8567c356c570ff976b2d3427dc3df96..5bd9c5943fec11e34fef2de811ec81c2ea5db3de 100644 (file)
@@ -32,8 +32,7 @@ template <int dim,
 class MatrixFreeTest
 {
 public:
-  static const unsigned int n_dofs_1d    = fe_degree + 1;
-  static const unsigned int n_local_dofs = Utilities::pow(n_dofs_1d, dim);
+  static const unsigned int n_local_dofs = Utilities::pow(fe_degree + 1, dim);
   static const unsigned int n_q_points   = Utilities::pow(n_q_points_1d, dim);
 
   MatrixFreeTest(const Portable::MatrixFree<dim, Number> &data_in)
@@ -94,10 +93,6 @@ protected:
   const Portable::MatrixFree<dim, Number> &data;
 };
 
-template <int dim, int fe_degree, int n_q_points_1d, typename Number>
-const unsigned int
-  MatrixFreeTest<dim, fe_degree, n_q_points_1d, Number>::n_dofs_1d;
-
 template <int dim, int fe_degree, int n_q_points_1d, typename Number>
 const unsigned int
   MatrixFreeTest<dim, fe_degree, n_q_points_1d, Number>::n_local_dofs;
index 49fb2aaaff773f9890b6c1cd8afa227164e2913c..4e5c8524ead71061ecfc8950c64487eaf83faf68 100644 (file)
@@ -71,7 +71,6 @@ template <int dim, int fe_degree, typename Number, int n_q_points_1d>
 class HelmholtzOperator
 {
 public:
-  static const unsigned int n_dofs_1d = fe_degree + 1;
   static const unsigned int n_local_dofs =
     dealii::Utilities::pow(fe_degree + 1, dim);
   static const unsigned int n_q_points =
index c5b892696696ec86ee178775ebabfd983dce8019..3dc2b7226d6d67cb9acf5a2d58a5ac9eec32cef5 100644 (file)
@@ -198,7 +198,6 @@ public:
 
     phi.distribute_local_to_global(dst);
   }
-  static const unsigned int n_dofs_1d = fe_degree + 1;
   static const unsigned int n_local_dofs =
     Utilities::pow(fe_degree + 1, dim) * n_components;
   static const unsigned int n_q_points = Utilities::pow(fe_degree + 1, dim);

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.