From: bangerth Date: Thu, 13 Aug 2009 16:32:31 +0000 (+0000) Subject: Fix a couple of places where output_results needed to be adjusted. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5d42defd9edd706feb3ca6e7e716027020d7fba;p=dealii-svn.git Fix a couple of places where output_results needed to be adjusted. git-svn-id: https://svn.dealii.org/trunk@19259 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-32/step-32.cc b/deal.II/examples/step-32/step-32.cc index fba7e58200..a86c910141 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -959,7 +959,7 @@ class BoussinesqFlowProblem // to pcout, which means that // the output of that processor will not be // printed anywhere. - // + // // Finally, we enter the preferred options // for the TimerOutput object to its // constructor. We restrict the output to @@ -1714,7 +1714,7 @@ void BoussinesqFlowProblem::setup_dofs () // @sect4{The BoussinesqFlowProblem assembly functions} - // + // // Following the discussion in the // introduction and in the @ref threads // module, we split the assembly functions @@ -2522,7 +2522,7 @@ void BoussinesqFlowProblem::assemble_temperature_system (const double maxim // distributed solution back into the solution // vector for which every element is locally // owned. - // + // // Apart from these two changes, everything // is the same as in step-31, so we don't // need to further comment on it. @@ -2552,7 +2552,7 @@ void BoussinesqFlowProblem::solve () SolverControl solver_control (stokes_matrix.m(), 1e-6*stokes_rhs.l2_norm()); - SolverBicgstab + SolverBicgstab bicgstab (solver_control, false); bicgstab.solve(stokes_matrix, distributed_stokes_solution, stokes_rhs, @@ -2632,19 +2632,37 @@ void BoussinesqFlowProblem::solve () // This function has remained mostly // unchanged compared to step-31, in - // particular merging data from the two - // DoFHandler objects (for the Stokes and the - // temperature parts of the problem) into one - // is the same. There are only two minor - // changes: we make sure that only a single - // processor actually does some work here; - // and in addition to the Stokes and - // temperature parts in the - // joint_fe finite element, we - // also add a piecewise constant field that + // particular merging data from the + // two DoFHandler objects (for the + // Stokes and the temperature parts + // of the problem) into one is the + // same. There are only two minor + // changes: we make sure that only a + // single processor actually does + // some work here; and in addition to + // the Stokes and temperature parts + // in the joint_fe + // finite element, we also add a + // piecewise constant field that // denotes the subdomain id a cell // corresponds to. This allows us to - // visualize the partitioning of the domain. + // visualize the partitioning of the + // domain. As a consequence, we also + // have to change the assertion about + // the number of degrees of freedom + // in the joint DoFHandler object + // (which is now equal to the number + // of Stokes degrees of freedom plus + // the temperature degrees of freedom + // plus the number of active cells as + // that is the number of partition + // variables we want to add), and + // adjust the number of elements in + // the arrays we use to name the + // components of the joint solution + // vector and to identify which of + // these components are scalars or + // parts of dim-dimensional vectors. template void BoussinesqFlowProblem::output_results () { @@ -2652,7 +2670,7 @@ void BoussinesqFlowProblem::output_results () return; computing_timer.enter_section ("Postprocessing"); - + if (Utilities::Trilinos::get_this_mpi_process(trilinos_communicator) == 0) { @@ -2662,11 +2680,13 @@ void BoussinesqFlowProblem::output_results () DoFHandler joint_dof_handler (triangulation); joint_dof_handler.distribute_dofs (joint_fe); Assert (joint_dof_handler.n_dofs() == - stokes_dof_handler.n_dofs() + temperature_dof_handler.n_dofs(), + stokes_dof_handler.n_dofs() + + temperature_dof_handler.n_dofs() + + triangulation.n_active_cells(), ExcInternalError()); Vector joint_solution (joint_dof_handler.n_dofs()); - + { std::vector local_joint_dof_indices (joint_fe.dofs_per_cell); std::vector local_stokes_dof_indices (stokes_fe.dofs_per_cell); @@ -2726,7 +2746,7 @@ void BoussinesqFlowProblem::output_results () std::vector data_component_interpretation - (dim+2, DataComponentInterpretation::component_is_scalar); + (dim+3, DataComponentInterpretation::component_is_scalar); for (unsigned int i=0; i