From: Wolfgang Bangerth Date: Fri, 19 Jan 2024 00:08:57 +0000 (-0700) Subject: Fix types and names in step-30. X-Git-Tag: relicensing~135^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae12f3144f72e04b153a8e7cf98fe2ec86afae72;p=dealii.git Fix types and names in step-30. --- diff --git a/examples/step-30/step-30.cc b/examples/step-30/step-30.cc index 7cb4b79a94..ed0381ff4b 100644 --- a/examples/step-30/step-30.cc +++ b/examples/step-30/step-30.cc @@ -714,8 +714,8 @@ namespace Step30 // We only need to consider cells which are flagged for refinement. if (cell->refine_flag_set()) { - Point jump; - Point area; + std::array jump_in_coordinate_direction; + std::array face_area_in_coordinate_direction; for (const auto face_no : cell->face_indices()) { @@ -781,11 +781,12 @@ namespace Step30 // second coordinate direction and so on, so we // accumulate these values into vectors with // dim components. - jump[face_no / 2] += + jump_in_coordinate_direction[face_no / 2] += std::abs(u[x] - u_neighbor[x]) * JxW[x]; // We also sum up the scaled weights to obtain // the measure of the face. - area[face_no / 2] += JxW[x]; + face_area_in_coordinate_direction[face_no / 2] += + JxW[x]; } } } @@ -815,9 +816,10 @@ namespace Step30 x < fe_v_face.n_quadrature_points; ++x) { - jump[face_no / 2] += + jump_in_coordinate_direction[face_no / 2] += std::abs(u[x] - u_neighbor[x]) * JxW[x]; - area[face_no / 2] += JxW[x]; + face_area_in_coordinate_direction[face_no / 2] += + JxW[x]; } } else // i.e. neighbor is coarser than cell @@ -859,9 +861,10 @@ namespace Step30 x < fe_v_face.n_quadrature_points; ++x) { - jump[face_no / 2] += + jump_in_coordinate_direction[face_no / 2] += std::abs(u[x] - u_neighbor[x]) * JxW[x]; - area[face_no / 2] += JxW[x]; + face_area_in_coordinate_direction[face_no / 2] += + JxW[x]; } } } @@ -873,7 +876,8 @@ namespace Step30 double sum_of_average_jumps = 0.; for (unsigned int i = 0; i < dim; ++i) { - average_jumps[i] = jump[i] / area[i]; + average_jumps[i] = jump_in_coordinate_direction[i] / + face_area_in_coordinate_direction[i]; sum_of_average_jumps += average_jumps[i]; }