]> https://gitweb.dealii.org/ - dealii.git/commitdiff
FEEvaluation: Allow submit_value with Tensor<1,1> more often
authorMartin Kronbichler <martin.kronbichler@rub.de>
Tue, 23 Jul 2024 17:03:59 +0000 (19:03 +0200)
committerMartin Kronbichler <martin.kronbichler@rub.de>
Tue, 23 Jul 2024 17:03:59 +0000 (19:03 +0200)
include/deal.II/matrix_free/fe_evaluation.h

index 78ddb7e2988a7ee3df386fb38e283d88d5868659..4dff2cd9ee166eed2552a683cc436b6784949276 100644 (file)
@@ -355,14 +355,14 @@ public:
   submit_value(const value_type val_in, const unsigned int q_point);
 
   /**
-   * In 1D, the value_type and gradient_type can be unintentionally mixed
-   * up because FEEvaluationBase does not distinguish between scalar accessors
-   * and vector-valued accessors and the respective types, but solely in terms
-   * of the number of components and dimension. Thus, enable the use of
-   * submit_value() also for tensors with a single component.
+   * For scalar elements, the value_type and gradient_type can be
+   * unintentionally mixed up because FEEvaluationBase does not distinguish
+   * between scalar accessors and vector-valued accessors and the respective
+   * types, but solely in terms of the number of components and dimension. Thus,
+   * enable the use of submit_value() also for tensors with a single component.
    */
-  template <int dim_ = dim,
-            typename = std::enable_if_t<dim_ == 1 && n_components == dim_>>
+  template <int n_components_local = n_components,
+            typename = std::enable_if_t<n_components == n_components_local>>
   void
   submit_value(const Tensor<1, 1, VectorizedArrayType> val_in,
                const unsigned int                      q_point);
@@ -4911,7 +4911,7 @@ FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::
   submit_value(const Tensor<1, 1, VectorizedArrayType> val_in,
                const unsigned int                      q_point)
 {
-  static_assert(n_components == 1 && dim == 1,
+  static_assert(n_components == 1,
                 "Do not try to modify the default template parameters used for"
                 " selectively enabling this function via std::enable_if!");
   submit_value(val_in[0], q_point);

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.