From: Jiaqi Zhang Date: Mon, 11 Apr 2022 15:27:26 +0000 (-0400) Subject: update step-74 X-Git-Tag: v9.4.0-rc1~307^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfd3f3f83211927b09d57836095cbc8b1cfe898f;p=dealii.git update step-74 --- diff --git a/examples/step-74/step-74.cc b/examples/step-74/step-74.cc index 01623b5128..bf8970e118 100644 --- a/examples/step-74/step-74.cc +++ b/examples/step-74/step-74.cc @@ -175,47 +175,6 @@ namespace Step74 // @sect3{Auxiliary functions} - // The following two auxiliary functions are used to compute - // jump terms for $u_h$ and $\nabla u_h$ on a face, - // respectively. - template - void get_function_jump(const FEInterfaceValues &fe_iv, - const Vector & solution, - std::vector & jump) - { - const unsigned int n_q = fe_iv.n_quadrature_points; - std::array, 2> face_values; - jump.resize(n_q); - for (unsigned int i = 0; i < 2; ++i) - { - face_values[i].resize(n_q); - fe_iv.get_fe_face_values(i).get_function_values(solution, - face_values[i]); - } - for (unsigned int q = 0; q < n_q; ++q) - jump[q] = face_values[0][q] - face_values[1][q]; - } - - - - template - void get_function_gradient_jump(const FEInterfaceValues &fe_iv, - const Vector & solution, - std::vector> & gradient_jump) - { - const unsigned int n_q = fe_iv.n_quadrature_points; - std::vector> face_gradients[2]; - gradient_jump.resize(n_q); - for (unsigned int i = 0; i < 2; ++i) - { - face_gradients[i].resize(n_q); - fe_iv.get_fe_face_values(i).get_function_gradients(solution, - face_gradients[i]); - } - for (unsigned int q = 0; q < n_q; ++q) - gradient_jump[q] = face_gradients[0][q] - face_gradients[1][q]; - } - // This function computes the penalty $\sigma$. double get_penalty_factor(const unsigned int fe_degree, const double cell_extent_left, @@ -705,10 +664,10 @@ namespace Step74 const unsigned int n_q_points = q_points.size(); std::vector jump(n_q_points); - get_function_jump(fe_iv, solution, jump); + fe_iv.get_jump_in_function_values(solution, jump); std::vector> grad_jump(n_q_points); - get_function_gradient_jump(fe_iv, solution, grad_jump); + fe_iv.get_jump_in_function_gradients(solution, grad_jump); const double h = cell->face(f)->diameter(); @@ -871,7 +830,7 @@ namespace Step74 const unsigned int n_q_points = q_points.size(); std::vector jump(n_q_points); - get_function_jump(fe_iv, solution, jump); + fe_iv.get_jump_in_function_values(solution, jump); const double extent1 = cell->measure() / cell->face(f)->measure(); const double extent2 = ncell->measure() / ncell->face(nf)->measure(); diff --git a/tests/simplex/step-74.cc b/tests/simplex/step-74.cc index f693324d9e..58506db5cf 100644 --- a/tests/simplex/step-74.cc +++ b/tests/simplex/step-74.cc @@ -167,44 +167,6 @@ namespace Step74 values[i] = -ref.laplacian(points[i]); } - template - void - get_function_jump(const FEInterfaceValues &fe_iv, - const Vector & solution, - std::vector & jump) - { - const unsigned n_q = fe_iv.n_quadrature_points; - std::array, 2> face_values; - jump.resize(n_q); - for (unsigned i = 0; i < 2; ++i) - { - face_values[i].resize(n_q); - fe_iv.get_fe_face_values(i).get_function_values(solution, - face_values[i]); - } - for (unsigned int q = 0; q < n_q; ++q) - jump[q] = face_values[0][q] - face_values[1][q]; - } - - template - void - get_function_gradient_jump(const FEInterfaceValues &fe_iv, - const Vector & solution, - std::vector> & gradient_jump) - { - const unsigned n_q = fe_iv.n_quadrature_points; - std::vector> face_gradients[2]; - gradient_jump.resize(n_q); - for (unsigned i = 0; i < 2; ++i) - { - face_gradients[i].resize(n_q); - fe_iv.get_fe_face_values(i).get_function_gradients(solution, - face_gradients[i]); - } - for (unsigned int q = 0; q < n_q; ++q) - gradient_jump[q] = face_gradients[0][q] - face_gradients[1][q]; - } - double compute_penalty(const unsigned int fe_degree, const double cell_extend_left, @@ -655,10 +617,10 @@ namespace Step74 const unsigned int n_q_points = q_points.size(); std::vector jump(n_q_points); - get_function_jump(fe_iv, solution, jump); + fe_iv.get_jump_in_function_values(solution, jump); std::vector> grad_jump(n_q_points); - get_function_gradient_jump(fe_iv, solution, grad_jump); + fe_iv.get_jump_in_function_gradients(solution, grad_jump); const double h = cell->face(f)->diameter(); @@ -795,7 +757,7 @@ namespace Step74 const unsigned int n_q_points = q_points.size(); std::vector jump(n_q_points); - get_function_jump(fe_iv, solution, jump); + fe_iv.get_jump_in_function_values(solution, jump); const double extent1 = cell->measure() / cell->face(f)->measure(); const double extent2 = ncell->measure() / ncell->face(nf)->measure();