From: wolf Date: Fri, 14 Jun 2002 12:36:48 +0000 (+0000) Subject: Allow suppression of level indicator in eps gridout when writing cell numbers. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91c9c9f51be00dafc5d414fe4c39982d8eaa6431;p=dealii-svn.git Allow suppression of level indicator in eps gridout when writing cell numbers. git-svn-id: https://svn.dealii.org/trunk@6123 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/grid/grid_out.h b/deal.II/deal.II/include/grid/grid_out.h index 83101b3530..ec75baaab5 100644 --- a/deal.II/deal.II/include/grid/grid_out.h +++ b/deal.II/deal.II/include/grid/grid_out.h @@ -289,9 +289,24 @@ namespace GridOutFlags * * The format of the cell * number written is - * @p{level.index}. + * @p{level.index}, or simply + * @p{index}, depending on the + * value of the following flag. */ bool write_cell_numbers; + /** + * If the cell numbers shall be + * written, using the above + * flag, then the value of this + * flag determines whether the + * format shall be + * @p{level.index}, or simply + * @p{index}. If @p{true}, the + * first format is + * taken. Default is @p{true}. + */ + bool write_cell_number_level; + /** * Constructor. @@ -301,7 +316,8 @@ namespace GridOutFlags const double line_width = 0.5, const bool color_lines_on_user_flag = false, const unsigned int n_boundary_face_points = 2, - const bool write_cell_numbers = false); + const bool write_cell_numbers = false, + const bool write_cell_number_level = true); }; /** diff --git a/deal.II/deal.II/source/grid/grid_out.all_dimensions.cc b/deal.II/deal.II/source/grid/grid_out.all_dimensions.cc index d85d845d8d..706f2aba04 100644 --- a/deal.II/deal.II/source/grid/grid_out.all_dimensions.cc +++ b/deal.II/deal.II/source/grid/grid_out.all_dimensions.cc @@ -79,12 +79,14 @@ namespace GridOutFlags const double line_width, const bool color_lines_on_user_flag, const unsigned int n_boundary_face_points, - const bool write_cell_numbers) + const bool write_cell_numbers, + const bool write_cell_number_level) : EpsFlagsBase(size_type, size, line_width, color_lines_on_user_flag, n_boundary_face_points), - write_cell_numbers (write_cell_numbers) + write_cell_numbers (write_cell_numbers), + write_cell_number_level (write_cell_number_level) {}; diff --git a/deal.II/deal.II/source/grid/grid_out.cc b/deal.II/deal.II/source/grid/grid_out.cc index cbdb96dea0..9cc811031a 100644 --- a/deal.II/deal.II/source/grid/grid_out.cc +++ b/deal.II/deal.II/source/grid/grid_out.cc @@ -1056,12 +1056,20 @@ void GridOut::write_eps (const Triangulation &tria, cell = tria.begin_active (), endc = tria.end (); for (; cell!=endc; ++cell) - out << (cell->center()(0)-offset(0))*scale << ' ' - << (cell->center()(1)-offset(1))*scale - << " m" << std::endl - << "[ [(Helvetica) 12.0 0.0 true true (" << cell << " )] " - << "] -6 MCshow" - << std::endl; + { + out << (cell->center()(0)-offset(0))*scale << ' ' + << (cell->center()(1)-offset(1))*scale + << " m" << std::endl + << "[ [(Helvetica) 12.0 0.0 true true ("; + if (eps_flags_2.write_cell_number_level) + out << cell; + else + out << cell->index(); + + out << " )] " + << "] -6 MCshow" + << std::endl; + }; }; out << "showpage" << std::endl;