From 4da95180f03c105da080c056a835c15ece489762 Mon Sep 17 00:00:00 2001 From: Jiaqi Zhang Date: Thu, 17 Sep 2020 22:45:11 -0400 Subject: [PATCH] fix some notations --- examples/step-74/doc/intro.dox | 8 +-- examples/step-74/step-74.cc | 89 ++++++++++++++++------------------ 2 files changed, 46 insertions(+), 51 deletions(-) diff --git a/examples/step-74/doc/intro.dox b/examples/step-74/doc/intro.dox index 77ea4cb053..5a771acec1 100644 --- a/examples/step-74/doc/intro.dox +++ b/examples/step-74/doc/intro.dox @@ -50,7 +50,7 @@ and @f[ \average{v} = \frac{v^0 + v^1}{2} @f] -respectively. Note that when $f\in \partial Omega$, we define $\jump{v} = v$ and +respectively. Note that when $f\in \partial \Omega$, we define $\jump{v} = v$ and $\average{v}=v$. The discretization using the SIPG is given by the following weak formula (more details can be found in @cite di2011mathematical and the references therein) @@ -64,8 +64,8 @@ The discretization using the SIPG is given by the following weak formula \biggr\} \\ - \sum_{F \in F_h^b} \biggl\{ - \bigl_F - + \bigl< \nabla v_h \cdot \mathbb n , \nu u_h\bigr>_F + \bigl_F + + \bigl< \nabla v_h \cdot \mathbf n , \nu u_h\bigr>_F - \bigl< v_h,\nu \sigma u_h\bigr>_F \biggr\} \\ @@ -121,5 +121,5 @@ Then the error estimate square per cell is @f[ \eta_{local}^2 =\eta_{c}^2+0.5\eta_{f}^2+\eta_{b}^2. @f] -Note that we compute $\eta_{local}^2$ instead of $\eta_{local}^2$ to simplify the implementation. +Note that we compute $\eta_{local}^2$ instead of $\eta_{local}$ to simplify the implementation. The error estimate square per cell is store in a global vector, whose $L_1$ norm is equal to $\eta^2$. diff --git a/examples/step-74/step-74.cc b/examples/step-74/step-74.cc index cdc977d86b..64b4cc42fd 100644 --- a/examples/step-74/step-74.cc +++ b/examples/step-74/step-74.cc @@ -320,7 +320,7 @@ namespace Step74 system_rhs.reinit(dof_handler.n_dofs()); } - // sect3{The assemble_system function} + // @sect3{The assemble_system function} // The assemble function here is similar to that in step-12. // Different from assembling by hand, we just need to focus // on assembling on each cell, each boundary face, and each @@ -351,12 +351,12 @@ namespace Step74 { for (unsigned int j = 0; j < fe_v.dofs_per_cell; ++j) copy_data.cell_matrix(i, j) += - // \nu \nabla u \nabla v - diffusion_coefficient * fe_v.shape_grad(i, point) * - fe_v.shape_grad(j, point) * JxW[point]; + diffusion_coefficient * + fe_v.shape_grad(i, point) * // nu grad v_h + fe_v.shape_grad(j, point) * JxW[point]; // grad u_h dx - copy_data.cell_rhs(i) += - rhs[point] * fe_v.shape_value(i, point) * JxW[point]; + copy_data.cell_rhs(i) += rhs[point] * fe_v.shape_value(i, point) * + JxW[point]; // f * v_h * dx } }; @@ -378,7 +378,6 @@ namespace Step74 std::vector g(n_q_points); exact_solution->value_list(q_points, g); - const double extent1 = cell->extent_in_direction( GeometryInfo::unit_normal_direction[face_no]); const double penalty = compute_penalty(fe.get_degree(), extent1, extent1); @@ -388,33 +387,30 @@ namespace Step74 for (unsigned int i = 0; i < dofs_per_cell; ++i) for (unsigned int j = 0; j < dofs_per_cell; ++j) copy_data.cell_matrix(i, j) += - ( - // - \nu (\nabla u . n) v - -diffusion_coefficient * - (fe_fv.shape_grad(j, point) * normals[point]) * - fe_fv.shape_value(i, point) - - // - \nu u (\nabla v . n) - - diffusion_coefficient * fe_fv.shape_value(j, point) * - (fe_fv.shape_grad(i, point) * normals[point]) - - // + \nu * penalty u v - + - diffusion_coefficient * penalty * - fe_fv.shape_value(j, point) * fe_fv.shape_value(i, point)) * - JxW[point]; + (-diffusion_coefficient * // - nu + (fe_fv.shape_grad(j, point) * + normals[point]) * // (grad u_h . n) + fe_fv.shape_value(i, point) // v_h + + - diffusion_coefficient * + fe_fv.shape_value(j, point) * // - nu u_h + (fe_fv.shape_grad(i, point) * + normals[point]) // (grad v_h . n) + + + // + + diffusion_coefficient * penalty * // nu sigma + fe_fv.shape_value(j, point) * + fe_fv.shape_value(i, point)) * // u_h v_h + JxW[point]; // dx for (unsigned int i = 0; i < dofs_per_cell; ++i) copy_data.cell_rhs(i) += - ( - // -\nu g (\nabla v . n) - -diffusion_coefficient * g[point] * - (fe_fv.shape_grad(i, point) * normals[point]) - - // +\nu penalty g v - + diffusion_coefficient * penalty * g[point] * - fe_fv.shape_value(i, point)) * - JxW[point]; + (-diffusion_coefficient * g[point] * // -nu g + (fe_fv.shape_grad(i, point) * normals[point]) // (grad v_h . n) + + + diffusion_coefficient * penalty * g[point] * // + nu sigma g + fe_fv.shape_value(i, point)) * // v_h + JxW[point]; // dx } }; @@ -456,22 +452,21 @@ namespace Step74 for (unsigned int i = 0; i < n_dofs_face; ++i) for (unsigned int j = 0; j < n_dofs_face; ++j) copy_data_face.cell_matrix(i, j) += - ( - // - \nu {\nabla u}.n [v] (consistency) - -diffusion_coefficient * - (fe_iv.average_gradient(j, point) * normals[point]) * - fe_iv.jump(i, point) - - // - \nu [u] {\nabla v}.n (symmetry) // NIPG: use + - - diffusion_coefficient * fe_iv.jump(j, point) * - (fe_iv.average_gradient(i, point) * normals[point]) - - // \nu sigma [u] [v] (penalty) - + diffusion_coefficient * penalty * fe_iv.jump(j, point) * - fe_iv.jump(i, point) - - ) * - JxW[point]; + (-diffusion_coefficient * // - nu + (fe_iv.average_gradient(j, point) * + normals[point]) * // ({grad u_h} . n) + fe_iv.jump(i, point) // [v_h] + + - diffusion_coefficient * fe_iv.jump(j, point) * // -nu [u_h] + (fe_iv.average_gradient(i, point) * + normals[point]) // (grad v_h . n) + + + diffusion_coefficient * penalty * + fe_iv.jump(j, point) * // + nu sigma [u_h] + fe_iv.jump(i, point) // [v_h] + + ) * + JxW[point]; // dx } }; -- 2.39.5