]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix performance quadrature generator
authorMaximilian Bergbauer <maximilian.bergbauer@tum.de>
Wed, 24 Jan 2024 21:40:50 +0000 (22:40 +0100)
committerMaximilian Bergbauer <maximilian.bergbauer@tum.de>
Wed, 24 Jan 2024 21:58:38 +0000 (22:58 +0100)
source/non_matching/quadrature_generator.cc

index e14dd7093d80ae5295fa40d4e8bc05ab01ad8bec..2af704b2e22f39187ec903c81adbdb2b62117e4e 100644 (file)
@@ -1505,8 +1505,6 @@ namespace NonMatching
         const auto dof_handler_cell =
           cell->as_dof_handler_iterator(*dof_handler);
 
-        const FE_Q<dim> fe_q1(1);
-
         // Save the element and the local dof values, since this is what we need
         // to evaluate the function.
 
@@ -1520,6 +1518,8 @@ namespace NonMatching
 
             const FiniteElement<dim> *fe = &dof_handler_cell->get_fe();
 
+            const FE_Q<dim> fe_q1(1);
+
             if (const FE_Q_iso_Q1<dim> *fe_q_iso_q1 =
                   dynamic_cast<const FE_Q_iso_Q1<dim> *>(
                     &dof_handler_cell->get_fe()))
@@ -1621,13 +1621,18 @@ namespace NonMatching
         if (!poly.empty() && component == 0)
           {
             // TODO: this could be extended to a component that is not zero
-            return dealii::internal::evaluate_tensor_product_value(
-              poly,
-              this->is_fe_q_iso_q1() ? local_dof_values_subcell :
-                                       local_dof_values,
-              this->is_fe_q_iso_q1() ? subcell_box.real_to_unit(point) : point,
-              polynomials_are_hat_functions,
-              this->is_fe_q_iso_q1() ? std::vector<unsigned int>() : renumber);
+            return this->is_fe_q_iso_q1() ?
+                     dealii::internal::evaluate_tensor_product_value(
+                       poly,
+                       local_dof_values_subcell,
+                       subcell_box.real_to_unit(point),
+                       polynomials_are_hat_functions) :
+                     dealii::internal::evaluate_tensor_product_value(
+                       poly,
+                       local_dof_values,
+                       point,
+                       polynomials_are_hat_functions,
+                       renumber);
           }
         else
           {
@@ -1654,15 +1659,20 @@ namespace NonMatching
         if (!poly.empty() && component == 0)
           {
             // TODO: this could be extended to a component that is not zero
-            return dealii::internal::evaluate_tensor_product_value_and_gradient(
-                     poly,
-                     this->is_fe_q_iso_q1() ? local_dof_values_subcell :
-                                              local_dof_values,
-                     this->is_fe_q_iso_q1() ? subcell_box.real_to_unit(point) :
-                                              point,
-                     polynomials_are_hat_functions,
-                     this->is_fe_q_iso_q1() ? std::vector<unsigned int>() :
-                                              renumber)
+            return (this->is_fe_q_iso_q1() ?
+                      dealii::internal::
+                        evaluate_tensor_product_value_and_gradient(
+                          poly,
+                          local_dof_values_subcell,
+                          subcell_box.real_to_unit(point),
+                          polynomials_are_hat_functions) :
+                      dealii::internal::
+                        evaluate_tensor_product_value_and_gradient(
+                          poly,
+                          local_dof_values,
+                          point,
+                          polynomials_are_hat_functions,
+                          renumber))
               .second;
           }
         else
@@ -1690,12 +1700,13 @@ namespace NonMatching
         if (!poly.empty() && component == 0)
           {
             // TODO: this could be extended to a component that is not zero
-            return dealii::internal::evaluate_tensor_product_hessian(
-              poly,
-              this->is_fe_q_iso_q1() ? local_dof_values_subcell :
-                                       local_dof_values,
-              this->is_fe_q_iso_q1() ? subcell_box.real_to_unit(point) : point,
-              this->is_fe_q_iso_q1() ? std::vector<unsigned int>() : renumber);
+            return this->is_fe_q_iso_q1() ?
+                     dealii::internal::evaluate_tensor_product_hessian(
+                       poly,
+                       local_dof_values_subcell,
+                       subcell_box.real_to_unit(point)) :
+                     dealii::internal::evaluate_tensor_product_hessian(
+                       poly, local_dof_values, point, renumber);
           }
         else
           {

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.