From: bangerth Date: Tue, 16 Dec 2008 15:03:08 +0000 (+0000) Subject: Comment on two recent changes. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e9b74a59e4de31c087fd5084d7bc8992d6eba94;p=dealii-svn.git Comment on two recent changes. git-svn-id: https://svn.dealii.org/trunk@17956 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-31/step-31.cc b/deal.II/examples/step-31/step-31.cc index 7ef6eb8f98..3944da2da0 100644 --- a/deal.II/examples/step-31/step-31.cc +++ b/deal.II/examples/step-31/step-31.cc @@ -705,7 +705,20 @@ BoussinesqFlowProblem::BoussinesqFlowProblem () // domain (at the quadrature points, in // fact). How it works should be relatively // obvious to all who have gotten to this - // point of the tutorial. + // point of the tutorial. Note that since we + // are only interested in the velocity, + // rather than using + // stokes_fe_values.get_function_values + // to get the values of the entire Stokes + // solution (velocities and pressures) we use + // stokes_fe_values[velocities].get_function_values + // to extract only the velocities part. This + // has the additional benefit that we get it + // as a Tensor<1,dim>, rather than some + // components in a Vector, allowing + // us to process it right away using the + // norm() function to get the + // magnitude of the velocity. // // The only point worth thinking about a bit // is how to choose the quadrature points we @@ -776,7 +789,8 @@ double BoussinesqFlowProblem::get_maximal_velocity () const for (; cell!=endc; ++cell) { fe_values.reinit (cell); - fe_values[velocities].get_function_values (stokes_solution, velocity_values); + fe_values[velocities].get_function_values (stokes_solution, + velocity_values); for (unsigned int q=0; q::assemble_temperature_system () const FEValuesExtractors::Vector velocities (0); - // Now, let's start the loop over all - // cells in the triangulation. Again, we - // need two cell iterators that walk in - // parallel through the cells of the two - // involved DoFHandler objects for the - // Stokes and temperature part. Within - // the loop, we first set the local rhs - // to zero, and then get the values and - // derivatives of the old solution - // functions at the quadrature points, - // since they are going to be needed for - // the definition of the stabilization - // parameters and as coefficients in the - // equation, respectively. + // Now, let's start the loop over all cells + // in the triangulation. Again, we need two + // cell iterators that walk in parallel + // through the cells of the two involved + // DoFHandler objects for the Stokes and + // temperature part. Within the loop, we + // first set the local rhs to zero, and + // then get the values and derivatives of + // the old solution functions at the + // quadrature points, since they are going + // to be needed for the definition of the + // stabilization parameters and as + // coefficients in the equation, + // respectively. Note that since the + // temperature has its own DoFHandler and + // FEValues object we get the entire + // solution at the quadrature point (which + // is the scalar temperature field only + // anyway) whereas for the Stokes part we + // restrict ourselves to extracting the + // velocity part (and ignoring the pressure + // part) by using + // stokes_fe_values[velocities].get_function_values. typename DoFHandler::active_cell_iterator cell = temperature_dof_handler.begin_active(), endc = temperature_dof_handler.end();