]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Consistently use interior normal vector 17307/head
authorMaximilian Bergbauer <maximilian.bergbauer@tum.de>
Fri, 19 Jul 2024 14:32:06 +0000 (16:32 +0200)
committerMaximilian Bergbauer <maximilian.bergbauer@tum.de>
Fri, 19 Jul 2024 14:32:06 +0000 (16:32 +0200)
include/deal.II/matrix_free/fe_point_evaluation.h
tests/non_matching/mapping_info_04.cc

index 72d6c7799568f3b500d5b3496c8e5b71e0848aac..5d4d3567077a4c8dd969fa95234fceba863f3b36 100644 (file)
@@ -3169,10 +3169,7 @@ FEPointEvaluation<n_components_, dim, spacedim, Number>::normal_vector(
          internal::FEPointEvaluation::
            ExcFEPointEvaluationAccessToUninitializedMappingField(
              "update_normal_vectors"));
-  if (this->is_interior)
-    return this->normal_ptr[point_index];
-  else
-    return -this->normal_ptr[point_index];
+  return this->normal_ptr[point_index];
 }
 
 
@@ -3924,17 +3921,12 @@ FEFacePointEvaluation<n_components_, dim, spacedim, Number>::normal_vector(
         normal[d] =
           internal::VectorizedArrayTrait<Number>::get(this->normal_ptr[0][d],
                                                       0);
-      if (this->is_interior)
-        return normal;
-      else
-        return -normal;
+
+      return normal;
     }
   else
     {
-      if (this->is_interior)
-        return this->normal_ptr[point_index];
-      else
-        return -(this->normal_ptr[point_index]);
+      return this->normal_ptr[point_index];
     }
 }
 
index e83d2f2daeec4c3e7d86816d4abbe33cdeab1dc2..9fea7f440f245461b29f738e4ee3b3ba6ca454db 100644 (file)
@@ -50,27 +50,26 @@ do_flux_term(Integrator        &evaluator_m,
              const Number2     &tau,
              const unsigned int q)
 {
-  const auto gradient_m = evaluator_m.get_gradient(q);
-  const auto gradient_p = evaluator_p.get_gradient(q);
+  const auto normal_gradient_m = evaluator_m.get_normal_derivative(q);
+  const auto normal_gradient_p = evaluator_p.get_normal_derivative(q);
 
   const auto value_m = evaluator_m.get_value(q);
   const auto value_p = evaluator_p.get_value(q);
 
-  const auto normal = evaluator_m.normal_vector(q);
+  const auto jump_value = value_m - value_p;
 
-  const auto jump_value = (value_m - value_p) * normal;
+  const auto central_flux_gradient =
+    0.5 * (normal_gradient_m + normal_gradient_p);
 
-  const auto central_flux_gradient = 0.5 * (gradient_m + gradient_p);
-
-  const auto value_terms = normal * (central_flux_gradient - tau * jump_value);
+  const auto value_terms = central_flux_gradient - tau * jump_value;
 
   evaluator_m.submit_value(-value_terms, q);
   evaluator_p.submit_value(value_terms, q);
 
   const auto gradient_terms = -0.5 * jump_value;
 
-  evaluator_m.submit_gradient(gradient_terms, q);
-  evaluator_p.submit_gradient(gradient_terms, q);
+  evaluator_m.submit_normal_derivative(gradient_terms, q);
+  evaluator_p.submit_normal_derivative(gradient_terms, q);
 }
 
 template <int 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.