From: Lei Qiao Date: Thu, 26 Feb 2015 18:35:10 +0000 (-0600) Subject: Responses to review comments X-Git-Tag: v8.3.0-rc1~412^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b7e1a847af9afbb6c0d21c1a56dceacc477f272;p=dealii.git Responses to review comments --- diff --git a/examples/step-33/doc/intro.dox b/examples/step-33/doc/intro.dox index b534e51c8a..c0bf755195 100644 --- a/examples/step-33/doc/intro.dox +++ b/examples/step-33/doc/intro.dox @@ -128,7 +128,7 @@ Hartmann's PhD thesis ("Adaptive Finite Element Methods for the Compressible Euler Equations", PhD thesis, University of Heidelberg, 2002). We use a time stepping scheme to substitute the time derivative in the -above equations. For simplicity, we define $ \mathbf{B}({\mathbf{w}_{n})(\mathbf z) $ as the spacial residual at time step $n$ : +above equations. For simplicity, we define $ \mathbf{B}({\mathbf{w}_{n})(\mathbf z) $ as the spatial residual at time step $n$ : @f{eqnarray*} \mathbf{B}({\mathbf{w}_{n})(\mathbf z) &=& diff --git a/examples/step-33/doc/results.dox b/examples/step-33/doc/results.dox index 8348e431a0..03b5889565 100644 --- a/examples/step-33/doc/results.dox +++ b/examples/step-33/doc/results.dox @@ -261,15 +261,15 @@ faster.

Cache the explicit part of residual

The residual calulated in ConservationLaw::assemble_cell_term function -read +reads $R_i = \left(\frac{\mathbf{w}^{k}_{n+1} - \mathbf{w}_n}{\delta t} , \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 +This 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. +and once more respect to the last time step solution $\mathbf{w}_{n}$ which +remains the same during all Newton iterations 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 afd3e12820..8f9a6d29fd 100644 --- a/examples/step-33/step-33.cc +++ b/examples/step-33/step-33.cc @@ -185,12 +185,12 @@ namespace Step33 // to the ith element, and then dereference it. This works // for both kinds of vectors -- not the prettiest solution, but one that // works. - template + template static - number + Number compute_kinetic_energy (const InputVector &W) { - number kinetic_energy = 0; + Number kinetic_energy = 0; for (unsigned int d=0; d + template static - number + Number compute_pressure (const InputVector &W) { return ((gas_gamma-1.0) * (*(W.begin() + energy_component) - - compute_kinetic_energy(W))); + compute_kinetic_energy(W))); } @@ -227,15 +227,15 @@ namespace Step33 // use the automatic differentiation type here. Similarly, we will call // the function with different input vector data types, so we templatize // on it as well: - template + template static void compute_flux_matrix (const InputVector &W, - number (&flux)[n_components][dim]) + Number (&flux)[n_components][dim]) { // First compute the pressure that appears in the flux matrix, and then // compute the first dim columns of the matrix that // correspond to the momentum terms: - const number pressure = compute_pressure (W); + const Number pressure = compute_pressure (W); for (unsigned int d=0; d + template static void numerical_normal_flux (const Point &normal, const InputVector &Wplus, const InputVector &Wminus, const double alpha, - number (&normal_flux)[n_components]) + Number (&normal_flux)[n_components]) { - number iflux[n_components][dim]; - number oflux[n_components][dim]; + Number iflux[n_components][dim]; + Number oflux[n_components][dim]; compute_flux_matrix (Wplus, iflux); compute_flux_matrix (Wminus, oflux); @@ -300,10 +300,10 @@ namespace Step33 // \right)^T$, shown here for the 3d case. More specifically, we will // consider only $\mathbf g=(0,0,-1)^T$ in 3d, or $\mathbf g=(0,-1)^T$ in // 2d. This naturally leads to the following function: - template + template static void compute_forcing_vector (const InputVector &W, - number (&forcing)[n_components]) + Number (&forcing)[n_components]) { const double gravity = -1.0;