From 498817e0719ba0a67afd2f0c0d70d30cb8cccdbb Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 23 Feb 2006 21:57:11 +0000 Subject: [PATCH] Limit growth of active_fe_index by the number of finite elements in the list. Also output the active_fe_index fields. git-svn-id: https://svn.dealii.org/trunk@12487 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-21/step-21.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/deal.II/examples/step-21/step-21.cc b/deal.II/examples/step-21/step-21.cc index a7a9ed989f..e2ab470d2f 100644 --- a/deal.II/examples/step-21/step-21.cc +++ b/deal.II/examples/step-21/step-21.cc @@ -1648,6 +1648,16 @@ void DGMethod::output_results (const unsigned int cycle) const GridOut grid_out; grid_out.write_eps (triangulation, eps_output); + + Vector active_fe_indices (triangulation.n_active_cells()); + { + unsigned int index = 0; + for (typename hp::DoFHandler::active_cell_iterator + cell = dof_handler.begin_active(); + cell != dof_handler.end(); ++cell, ++index) + active_fe_indices(index) = cell->active_fe_index (); + } + // Output of the solution in // gnuplot format. @@ -1664,6 +1674,7 @@ void DGMethod::output_results (const unsigned int cycle) const DataOut data_out; data_out.attach_dof_handler (dof_handler); data_out.add_data_vector (solution2, "u"); + data_out.add_data_vector (active_fe_indices, "fe_index"); data_out.build_patches (4); -- 2.39.5