]> https://gitweb.dealii.org/ - dealii.git/commitdiff
update intro and penalty 10932/head
authorJiaqi Zhang <zjiaqi@vt.edu>
Mon, 30 Nov 2020 16:55:40 +0000 (11:55 -0500)
committerJiaqi Zhang <zjiaqi@vt.edu>
Mon, 30 Nov 2020 17:06:41 +0000 (12:06 -0500)
examples/step-74/doc/intro.dox
examples/step-74/step-74.cc

index 90965c30cffeda6725bcbfd72dbed4849b1a8101..585a87421b43563c1927dc8e1b6c1619145dfeb6 100644 (file)
@@ -54,22 +54,19 @@ respectively. Note that when $f\subset \partial \Omega$, we define $\jump{v} = v
 $\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)
-@f{multline*}
-  \sum_{K\in {\mathbb T}_h} (\nabla v_h, \nu \nabla u_h)_K
-  \\
-  - \sum_{F \in F_h^i} \left\{
+@f{align*}
+&\sum_{K\in {\mathbb T}_h} (\nabla v_h, \nu \nabla u_h)_K\\
+&-\sum_{F \in F_h^i} \left\{
     \left< \jump{v_h}, \nu\average{ \nabla u_h} \cdot  \mathbf n \right>_F
    +\left<\average{ \nabla v_h }\cdot \mathbf n,\nu\jump{u_h}\right>_F
    -\left<\jump{v_h},\nu \sigma \jump{u_h} \right>_F
-  \right\}
-  \\
-  - \sum_{F \in F_h^b} \left\{
+  \right\}\\
+&-\sum_{F \in F_h^b} \left\{
     \left<v_h, \nu  \nabla u_h\cdot \mathbf n \right>_F
   + \left< \nabla v_h \cdot \mathbf n , \nu u_h\right>_F
   - \left< v_h,\nu \sigma u_h\right>_F
-  \right\}
-  \\
-  = (v_h, f)_\Omega
+  \right\}\\
+&=(v_h, f)_\Omega
   - \sum_{F \in F_h^b} \left\{
     \left< \nabla v_h \cdot \mathbf n, \nu g_D\right>_F - \left<v_h,\nu \sigma g_D\right>_F
   \right\}.
index 9d42c971aedd30c2b722276198cd724cb3eab456..ccdd6e5f6f2a897193db78a91abca55c9fb9b93d 100644 (file)
@@ -393,8 +393,7 @@ namespace Step74
       std::vector<double> g(n_q_points);
       exact_solution->value_list(q_points, g);
 
-      const double extent1 = cell->extent_in_direction(
-        GeometryInfo<dim>::unit_normal_direction[face_no]);
+      const double extent1 = cell->measure() / cell->face(face_no)->measure();
       const double penalty = compute_penalty(degree, extent1, extent1);
 
       for (unsigned int point = 0; point < n_q_points; ++point)
@@ -462,10 +461,8 @@ namespace Step74
       const std::vector<double> &        JxW     = fe_iv.get_JxW_values();
       const std::vector<Tensor<1, dim>> &normals = fe_iv.get_normal_vectors();
 
-      const double extent1 =
-        cell->extent_in_direction(GeometryInfo<dim>::unit_normal_direction[f]);
-      const double extent2 = ncell->extent_in_direction(
-        GeometryInfo<dim>::unit_normal_direction[nf]);
+      const double extent1 = cell->measure() / cell->face(f)->measure();
+      const double extent2 = ncell->measure() / ncell->face(nf)->measure();
       const double penalty = compute_penalty(degree, extent1, extent2);
 
       for (unsigned int point = 0; point < n_q_points; ++point)
@@ -560,7 +557,7 @@ namespace Step74
     DataOut<dim> data_out;
     data_out.attach_dof_handler(dof_handler);
     data_out.add_data_vector(solution, "u", DataOut<dim>::type_dof_data);
-    data_out.build_patches();
+    data_out.build_patches(mapping);
     data_out.write_vtu(output);
   }
 

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.