From 2ff4570a51014ee367f07d6df64f7d78c033b257 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Fri, 4 Sep 2009 17:11:39 +0000 Subject: [PATCH] Comments cleanup. git-svn-id: https://svn.dealii.org/trunk@19394 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-37/step-37.cc | 87 +++++++++++++++-------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/deal.II/examples/step-37/step-37.cc b/deal.II/examples/step-37/step-37.cc index 306bdb67f6..b146710be2 100644 --- a/deal.II/examples/step-37/step-37.cc +++ b/deal.II/examples/step-37/step-37.cc @@ -602,7 +602,7 @@ MatrixFree::vmult (Vector &dst, // Transposed matrix-vector products: do // the same. Since we implement a symmetric - // operation, we can refer to the vmult + // operation, we can refer to the vmult_add // operation. template template @@ -616,6 +616,17 @@ MatrixFree::Tvmult (Vector &dst, +template +template +void +MatrixFree::Tvmult_add (Vector &dst, + const Vector &src) const +{ + vmult_add (dst,src); +} + + + // The vmult_add function that // multiplies the matrix with vector // src and adds the result to @@ -678,17 +689,6 @@ MatrixFree::vmult_add (Vector &dst, -template -template -void -MatrixFree::Tvmult_add (Vector &dst, - const Vector &src) const -{ - vmult_add (dst,src); -} - - - // This function returns the entries of the // matrix. Since this class is intended not // to store the matrix entries, it would @@ -699,7 +699,7 @@ MatrixFree::Tvmult_add (Vector &dst, // constrained degrees of freedom or for // the implementation of the Chebyshev // smoother that we intend to use in the - // multigrid implemenation. This matrix is + // multigrid preconditioner. This matrix is // equipped with a vector that stores the // diagonal, and we compute it when this // function is called for the first time. @@ -727,14 +727,14 @@ MatrixFree::el (const unsigned int row, // go through all the cells (now in serial, // since this function should not be called // very often anyway), then all the degrees - // of freedom. On that level, we first copy + // of freedom. At this place, we first copy // the first basis functions in all the - // quadrature points, then apply the - // derivatives from the Jacobian matrix, - // and finally multiply with the second - // basis function. This is the value that - // would be written into the diagonal of a - // sparse matrix. + // quadrature points to a temporary array, + // apply the derivatives from the Jacobian + // matrix, and finally multiply with the + // second basis function. This is exactly + // the value that would be written into the + // diagonal of a sparse matrix. template void MatrixFree::calculate_diagonal() const @@ -794,26 +794,27 @@ std::size_t MatrixFree::memory_consumption () const // class. There is one point worth noting: // The quadrature-point related action of // the Laplace operator is a tensor of rank - // two. It is even symmetric since it is - // the product of the inverse Jacobian + // two. It is symmetric since it is the + // product of the inverse Jacobian // transformation between unit and real // cell with its transpose (times // quadrature weights and a coefficient, // which are scalar), so we can just save - // the symmetric part. We could use the - // SymmetricTensor<2,dim> class for doing - // this, however, that is only based on - // double numbers. Since we + // the diagonal and upper diagonal part. We + // could use the SymmetricTensor<2,dim> + // class for doing this, however, that + // class is only based on + // double %numbers. Since we // also want to use float - // numbers for the multigrid preconditioner - // (in order to save memory and computing - // time), we manually implement this - // operator. Note that dim is - // a template argument and hence known at - // compile-time, so the compiler knows that - // this symmetric rank-2 tensor has 3 - // entries if used in 2D and 6 entries if - // used in 3D. + // %numbers for the multigrid + // preconditioner (in order to save memory + // and computing time), we manually + // implement this operator. Note that + // dim is a template argument + // and hence known at compile-time, so the + // compiler knows that this symmetric + // rank-2 tensor has 3 entries if used in + // 2D and 6 entries if used in 3D. template class LaplaceOperator { @@ -864,14 +865,14 @@ LaplaceOperator::LaplaceOperator(const Tensor<2,dim> &tensor) // // It might seem inefficient that we have // an if clause at this place - // (which is the innermost loop, so it - // could be expensive), but note once again - // that dim is known when this - // piece of code is compiled, so the - // compiler can optize away the - // if statement (and actually - // even inline these few lines of code into - // the MatrixFree class). + // (which is the innermost loop), but note + // once again that dim is + // known when this piece of code is + // compiled, so the compiler can optize + // away the if statement (and + // actually even inline these few lines of + // code into the MatrixFree + // class). template void LaplaceOperator::transform (number* result) const { -- 2.39.5