From: Wolfgang Bangerth Date: Thu, 23 Feb 2006 21:57:11 +0000 (+0000) Subject: Limit growth of active_fe_index by the number of finite elements in X-Git-Tag: v8.0.0~12195 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=498817e0719ba0a67afd2f0c0d70d30cb8cccdbb;p=dealii.git 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 --- 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);