diff --git a/dune/grid/io/file/printgrid.hh b/dune/grid/io/file/printgrid.hh index 6af758f5a4a42434dc3344eec360e6b97210a7e4..556271ddb2abf121b89c956dc74bf632a7e32b12 100644 --- a/dune/grid/io/file/printgrid.hh +++ b/dune/grid/io/file/printgrid.hh @@ -59,7 +59,6 @@ namespace Dune { /** \brief Print a grid as a gnuplot for testing and development * \tparam GridType the type of grid to work with * \param grid the grid to print - * \param helper an MPIHelper to create unique output file names in parallel case * \param output_file the base of the output filename * \param size size of the plot in pixels; increase if plot is too cramped * \param execute_plot whether to execute gnuplot automatically @@ -67,16 +66,14 @@ namespace Dune { * \param local_corner_indices whether to show local corner indices * \param local_intersection_indices whether to show local intersection indices * \param outer_normals whether to show outer normals of intersections - * Creates a gnuplot (one per process if parallel) showing the grid structure with indices, intersection types etc. + * Creates a gnuplot showing the grid structure with indices, intersection types etc. */ template <typename GridType> - void printGrid (const GridType& grid, const Dune::MPIHelper& helper, std::string output_file = "printgrid", + void printGrid (const GridType& grid, std::string output_file, int size = 2000, bool execute_plot = true, bool png = true, bool local_corner_indices = true, bool local_intersection_indices = true, bool outer_normals = true) { - // Create output file - output_file = output_file + "_" + std::to_string(helper.rank()); std::string plot_file_name = output_file + ".gnuplot"; std::ofstream plotfile (plot_file_name, std::ios::out | std::ios::trunc); if (!plotfile.is_open()) { @@ -201,6 +198,27 @@ namespace Dune { } } + + /** \brief Print a grid as a gnuplot for testing and development + * \tparam GridType the type of grid to work with + * \param grid the grid to print + * \param helper an MPIHelper to create unique output file names in parallel case + * \param output_file the base of the output filename + * \param size size of the plot in pixels; increase if plot is too cramped + * \param execute_plot whether to execute gnuplot automatically + * \param png whether to use PNG or SVG as the output format + * \param local_corner_indices whether to show local corner indices + * \param local_intersection_indices whether to show local intersection indices + * \param outer_normals whether to show outer normals of intersections + * Creates a gnuplot (one per process if parallel) showing the grid structure with indices, intersection types etc. + */ + template <typename GridType> + void printGrid (const GridType& grid, const Dune::MPIHelper& helper, std::string output_file = "printgrid", + int size = 2000, bool execute_plot = true, bool png = true, bool local_corner_indices = true, + bool local_intersection_indices = true, bool outer_normals = true) + { + printGrid(grid, output_file + "_" + std::to_string(helper.rank()), size, execute_plot, png, local_corner_indices, local_intersection_indices, outer_normals); + } } #endif // #ifndef DUNE_PRINTGRID_HH