From ad1921e2e565ac90346d8ee6871ed38b2e23a22f Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 13 Aug 2009 14:46:07 +0000 Subject: [PATCH] Also output partition information. git-svn-id: https://svn.dealii.org/trunk@19256 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-32/step-32.cc | 39 ++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/deal.II/examples/step-32/step-32.cc b/deal.II/examples/step-32/step-32.cc index fcbb8ab131..b96c4e1e91 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -48,6 +48,7 @@ #include #include +#include #include #include #include @@ -2629,11 +2630,21 @@ void BoussinesqFlowProblem::solve () // @sect4{BoussinesqFlowProblem::output_results} - // This function has remained completely - // unchanged compared to step-31 (with the - // exception that we make sure that only a - // single processor actually does some work - // here), so everything should be clear here: + // 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 + // denotes the subdomain id a cell + // corresponds to. This allows us to + // visualize the partitioning of the domain. template void BoussinesqFlowProblem::output_results () { @@ -2646,7 +2657,8 @@ void BoussinesqFlowProblem::output_results () { const FESystem joint_fe (stokes_fe, 1, - temperature_fe, 1); + temperature_fe, 1, + FE_DGQ(0), 1); DoFHandler joint_dof_handler (triangulation); joint_dof_handler.distribute_dofs (joint_fe); Assert (joint_dof_handler.n_dofs() == @@ -2681,10 +2693,8 @@ void BoussinesqFlowProblem::output_results () joint_solution(local_joint_dof_indices[i]) = stokes_solution(local_stokes_dof_indices[joint_fe.system_to_base_index(i).second]); } - else + else if (joint_fe.system_to_base_index(i).first.first == 1) { - Assert (joint_fe.system_to_base_index(i).first.first == 1, - ExcInternalError()); Assert (joint_fe.system_to_base_index(i).second < local_stokes_dof_indices.size(), @@ -2692,12 +2702,23 @@ void BoussinesqFlowProblem::output_results () joint_solution(local_joint_dof_indices[i]) = temperature_solution(local_temperature_dof_indices[joint_fe.system_to_base_index(i).second]); } + else + { + Assert (joint_fe.system_to_base_index(i).first.first == 2, + ExcInternalError()); + Assert (joint_fe.system_to_base_index(i).second + == 0, + ExcInternalError()); + joint_solution(local_joint_dof_indices[i]) + = joint_cell->subdomain_id(); + } } } std::vector joint_solution_names (dim, "velocity"); joint_solution_names.push_back ("p"); joint_solution_names.push_back ("T"); + joint_solution_names.push_back ("partition"); DataOut data_out; -- 2.39.5