From: Lei Qiao Date: Wed, 25 Feb 2015 20:46:49 +0000 (-0600) Subject: Trim all trailing white blanks X-Git-Tag: v8.3.0-rc1~412^2~5 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c73d920ec86cacde6511f75e6d3d4557a030c435;p=dealii.git Trim all trailing white blanks --- diff --git a/examples/step-33/doc/intro.dox b/examples/step-33/doc/intro.dox index f124cb4000..b534e51c8a 100644 --- a/examples/step-33/doc/intro.dox +++ b/examples/step-33/doc/intro.dox @@ -135,8 +135,8 @@ above equations. For simplicity, we define $ \mathbf{B}({\mathbf{w}_{n})(\mathbf - \int_{\Omega} \left(\mathbf{F}(\mathbf{w_n}), \nabla\mathbf{z}\right) + h^{\eta}(\nabla \mathbf{w_n} , \nabla \mathbf{z}) \\ -&& -+ +&& ++ \int_{\partial \Omega} \left(\mathbf{H}(\mathbf{w_n}^+, \mathbf{w}^-(\mathbf{w_n}^+), \mathbf{n}), \mathbf{z}\right) - diff --git a/examples/step-33/doc/results.dox b/examples/step-33/doc/results.dox index 68cf6d3e5a..8348e431a0 100644 --- a/examples/step-33/doc/results.dox +++ b/examples/step-33/doc/results.dox @@ -162,25 +162,25 @@ T=1.9 8.494e-02 0016 6.05e-12 1.199e+01 0026 5.72e-10 1.198e+03 0002 1.20e+03 - 7.030e+03 0001 nan - 7.030e+03 0001 nan - 7.030e+03 0001 nan - 7.030e+03 0001 nan - 7.030e+03 0001 nan + 7.030e+03 0001 nan + 7.030e+03 0001 nan + 7.030e+03 0001 nan + 7.030e+03 0001 nan + 7.030e+03 0001 nan 7.030e+03 0001 nan ---------------------------------------------------- -Exception on processing: +Exception on processing: -------------------------------------------------------- An error occurred in line <2476> of file <\step-33.cc> in function void Step33::ConservationLaw::run() [with int dim = 2] -The violated condition was: +The violated condition was: nonlin_iter <= 10 The name and call sequence of the exception was: ExcMessage ("No convergence in nonlinear solver") -Additional Information: +Additional Information: No convergence in nonlinear solver -------------------------------------------------------- @@ -196,7 +196,7 @@ movie, the results of last several time steps looks like this: -As we see, when the heavy mass of fluid hits the left bottom corner, +As we see, when the heavy mass of fluid hits the left bottom corner, some oscillation occurs and lead to the divergence of the iteration. A lazy solution to this issue is add more viscosity. If we set the diffusion power $\eta = 1.5$ instead of $2.0$, the simulation would be able to survive this crisis. Then, the result looks like this: @@ -206,7 +206,7 @@ the simulation would be able to survive this crisis. Then, the result looks like The heavy mass of fluid is drawn down the slope by gravity, where it collides with the ski lodge and is flung into the air! Hopefully everyone -escapes! And also, we can see the boundary between heavy mass and light mass blur quickly +escapes! And also, we can see the boundary between heavy mass and light mass blur quickly due to the artificial viscosity. We can also visualize the evolution of the adaptively refined grid: @@ -261,15 +261,15 @@ faster.

Cache the explicit part of residual

The residual calulated in ConservationLaw::assemble_cell_term function -read +read $R_i = \left(\frac{\mathbf{w}^{k}_{n+1} - \mathbf{w}_n}{\delta t} - , \mathbf{z}_i \right)_K + + , \mathbf{z}_i \right)_K + \theta \mathbf{B}({\mathbf{w}^{k}_{n+1})(\mathbf{z}_i)_K + - (1-\theta) \mathbf{B}({\mathbf{w}_{n}) (\mathbf{z}_i)_K $ -means that we calculate the spacial residual twice at one Newton -iteration step: once respect to the current solution ${\mathbf{w}^{k}_{n+1}$ -and another respect to the last time step solution $\mathbf{w}_{n}$ which -remains the same during all Newton interations through one timestep. + (1-\theta) \mathbf{B}({\mathbf{w}_{n}) (\mathbf{z}_i)_K $ +means that we calculate the spacial residual twice at one Newton +iteration step: once respect to the current solution ${\mathbf{w}^{k}_{n+1}$ +and another respect to the last time step solution $\mathbf{w}_{n}$ which +remains the same during all Newton interations through one timestep. Cache up the explicit part of residual $ \mathbf{B}({\mathbf{w}_{n}) (\mathbf{z}_i)_K}$ during Newton iteration will save lots of labor. diff --git a/examples/step-33/step-33.cc b/examples/step-33/step-33.cc index 4987288a96..a0cddbcc81 100644 --- a/examples/step-33/step-33.cc +++ b/examples/step-33/step-33.cc @@ -1618,17 +1618,17 @@ namespace Step33 // residual, adding its negative to the right hand side vector, and adding // its derivative with respect to the local variables to the Jacobian // (i.e. the Newton matrix). Recall that the cell contributions to the - // residual read + // residual read // $R_i = \left(\frac{\mathbf{w}^{k}_{n+1} - \mathbf{w}_n}{\delta t} , - // \mathbf{z}_i \right)_K $ $ + + // \mathbf{z}_i \right)_K $ $ + // \theta \mathbf{B}({\mathbf{w}^{k}_{n+1})(\mathbf{z}_i)_K $ $ + // (1-\theta) \mathbf{B}({\mathbf{w}_{n}) (\mathbf{z}_i)_K $ where - // $\mathbf{B}({\mathbf{w})(\mathbf{z}_i)_K = + // $\mathbf{B}({\mathbf{w})(\mathbf{z}_i)_K = // - \left(\mathbf{F}(\mathbf{w}),\nabla\mathbf{z}_i\right)_K $ $ // + h^{\eta}(\nabla \mathbf{w} , \nabla \mathbf{z}_i)_K $ $ - // - (\mathbf{G}(\mathbf {w}), \mathbf{z}_i)_K $ for both + // - (\mathbf{G}(\mathbf {w}), \mathbf{z}_i)_K $ for both // ${\mathbf{w} = \mathbf{w}^k_{n+1}$ and ${\mathbf{w} = \mathbf{w}_{n}}$ , - // $\mathbf{z}_i$ is the $i$th vector valued test function. + // $\mathbf{z}_i$ is the $i$th vector valued test function. // Furthermore, the scalar product // $\left(\mathbf{F}(\mathbf{w}), \nabla\mathbf{z}_i\right)_K$ is // understood as $\int_K \sum_{c=1}^{\text{n\_components}} @@ -1763,7 +1763,7 @@ namespace Step33 // Next, in order to compute the cell contributions, we need to evaluate - // $F({\mathbf w}^k_{n+1})$, $G({\mathbf w}^k_{n+1})$ and + // $F({\mathbf w}^k_{n+1})$, $G({\mathbf w}^k_{n+1})$ and // $F({\mathbf w}_n)$, $G({\mathbf w}_n)$ at all quadrature // points. To store these, we also need to allocate a bit of memory. Note // that we compute the flux matrices and right hand sides in terms of @@ -1800,9 +1800,9 @@ namespace Step33 // single nonzero component (more on this topic can be found in the @ref // vector_valued module). It will be represented by the variable // component_i below. With this, the residual term can be - // re-written as + // re-written as // @f{eqnarray*} - // R_i &=& + // R_i &=& // \left(\frac{(\mathbf{w}_{n+1} - // \mathbf{w}_n)_{\text{component\_i}}}{\delta // t},(\mathbf{z}_i)_{\text{component\_i}}\right)_K \\ @@ -1813,7 +1813,7 @@ namespace Step33 // x_d}\right)_K \\ // &+& \sum_{d=1}^{\text{dim}} h^{\eta} \left( \theta \frac{\partial // \mathbf{w^k_{n+1}}_{\text{component\_i}}}{\partial x_d} + (1-\theta) - // \frac{\partial \mathbf{w_n}_{\text{component\_i}}}{\partial x_d} , + // \frac{\partial \mathbf{w_n}_{\text{component\_i}}}{\partial x_d} , // \frac{\partial (\mathbf{z}_i)_{\text{component\_i}}}{\partial x_d} \right)_K\\ // &-& \left( \theta\mathbf{G}({\mathbf{w}^k_n+1} )_{\text{component\_i}} + // (1-\theta)\mathbf{G}({\mathbf{w}_n} )_{\text{component\_i}} , @@ -1936,8 +1936,8 @@ namespace Step33 // Next, we need to define the values of the conservative variables // ${\mathbf W}$ on this side of the face ($ {\mathbf W}^+$) - // and on the opposite side (${\mathbf W}^-$), for both ${\mathbf W} = - // {\mathbf W}^k_{n+1}$ and ${\mathbf W} = {\mathbf W}_n$. + // and on the opposite side (${\mathbf W}^-$), for both ${\mathbf W} = + // {\mathbf W}^k_{n+1}$ and ${\mathbf W} = {\mathbf W}_n$. // The "this side" values can be // computed in exactly the same way as in the previous function, but note // that the fe_v variable now is of type FEFaceValues or @@ -2010,7 +2010,7 @@ namespace Step33 boundary_values[q], Wminus[q]); // Here we assume that boundary type, boundary normal vector and boundary data values - // maintain the same during time advancing. + // maintain the same during time advancing. EulerEquations::compute_Wminus (parameters.boundary_conditions[boundary_id].kind, fe_v.normal_vector(q), Wplus_old[q],