From: kanschat Date: Thu, 21 Mar 2013 15:19:37 +0000 (+0000) Subject: try to fix warnings without seeing them X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5040275f16f25d0fdb5fc8bd475ba1c7600db820;p=dealii-svn.git try to fix warnings without seeing them git-svn-id: https://svn.dealii.org/trunk@28971 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/grid/grid_out.h b/deal.II/include/deal.II/grid/grid_out.h index 967c991f6b..31229dedd5 100644 --- a/deal.II/include/deal.II/grid/grid_out.h +++ b/deal.II/include/deal.II/grid/grid_out.h @@ -68,10 +68,8 @@ namespace GridOutFlags bool write_measure; /** - * Write all faces, including - * interior faces. If - * false, only - * boundary faces are written. + * Write all faces, including interior faces. If false, + * only boundary faces are written. */ bool write_all_faces; @@ -85,62 +83,48 @@ namespace GridOutFlags const bool write_all_faces = true); /** - * Declare parameters in - * ParameterHandler. + * Declare parameters in ParameterHandler. */ static void declare_parameters (ParameterHandler ¶m); /** - * Parse parameters of - * ParameterHandler. + * Parse parameters of ParameterHandler. */ void parse_parameters (ParameterHandler ¶m); }; /** - * Flags describing the details of - * output in MSH format. + * Flags describing the details of output in MSH format. * * @ingroup output */ struct Msh { /** - * When writing a mesh, write boundary - * faces explicitly if their boundary - * indicator is not the default - * boundary indicator, which is zero. - * This is necessary if you later - * want to re-read the grid and want - * to get the same boundary indicators - * for the different parts of the - * boundary of the triangulation. + * When writing a mesh, write boundary faces explicitly if their + * boundary indicator is not the default boundary indicator, which + * is zero. This is necessary if you later want to re-read the + * grid and want to get the same boundary indicators for the + * different parts of the boundary of the triangulation. * - * It is not necessary if you only want - * to write the triangulation to - * view or print it. + * It is not necessary if you only want to write the triangulation + * to view or print it. * * Default: @p false. */ bool write_faces; /** - * When writing a mesh, write boundary - * lines explicitly if their boundary - * indicator is not the default - * boundary indicator, which is zero. - * This is necessary if you later - * want to re-read the grid and want - * to get the same boundary indicators - * for the different parts of the - * boundary of the triangulation. + * When writing a mesh, write boundary lines explicitly if their + * boundary indicator is not the default boundary indicator, + * which is zero. This is necessary if you later want to re-read + * the grid and want to get the same boundary indicators for the + * different parts of the boundary of the triangulation. * - * It is not necessary if you only want - * to write the triangulation to - * view or print it. + * It is not necessary if you only want to write the + * triangulation to view or print it. * - * This is used only if - * dim==3, and ignored - * in all other cases. + * This is used only if dim==3, and ignored in all other + * cases. * * Default: @p false. */ @@ -152,79 +136,58 @@ namespace GridOutFlags Msh (const bool write_faces = false, const bool write_lines = false); /** - * Declare parameters in - * ParameterHandler. + * Declare parameters in ParameterHandler. */ static void declare_parameters (ParameterHandler ¶m); /** - * Parse parameters of - * ParameterHandler. + * Parse parameters of ParameterHandler. */ void parse_parameters (ParameterHandler ¶m); }; /** - * Flags describing the details of - * output in UCD format. + * Flags describing the details of output in UCD format. * * @ingroup output */ struct Ucd { /** - * Write a comment at the - * beginning of the file - * stating the date of creation - * and some other data. While - * this is supported by the UCD - * format (and the AVS - * program), some other - * programs get confused by - * this, so the default is to - * not write a - * preamble. However, a - * preamble can be written - * using this flag. + * Write a comment at the beginning of the file stating the date + * of creation and some other data. While this is supported by + * the UCD format (and the AVS program), some other programs get + * confused by this, so the default is to not write a + * preamble. However, a preamble can be written using this flag. * * Default: false. */ bool write_preamble; /** - * When writing a mesh, write boundary - * faces explicitly if their boundary - * indicator is not the default - * boundary indicator, which is zero. - * This is necessary if you later - * want to re-read the grid and want - * to get the same boundary indicators - * for the different parts of the - * boundary of the triangulation. + * When writing a mesh, write boundary faces explicitly if their + * boundary indicator is not the default boundary indicator, which + * is zero. This is necessary if you later want to re-read the + * grid and want to get the same boundary indicators for the + * different parts of the boundary of the triangulation. * - * It is not necessary if you only want - * to write the triangulation to - * view or print it. + * It is not necessary if you only want to write the triangulation + * to view or print it. * * Default: @p false. */ bool write_faces; /** - * When writing a mesh, write boundary - * lines explicitly if their boundary - * indicator is not the default - * boundary indicator, which is zero. - * This is necessary if you later - * want to re-read the grid and want - * to get the same boundary indicators - * for the different parts of the - * boundary of the triangulation. + * When writing a mesh, write boundary lines explicitly if their + * boundary indicator is not the default boundary indicator, which + * is zero. This is necessary if you later want to re-read the + * grid and want to get the same boundary indicators for the + * different parts of the boundary of the triangulation. * - * It is not necessary if you only want - * to write the triangulation to - * view or print it. + * It is not necessary if you only want to write the triangulation + * to view or print it. * * This directive is ignored if * dim!=3. @@ -241,63 +204,48 @@ namespace GridOutFlags const bool write_lines = false); /** - * Declare parameters in - * ParameterHandler. + * Declare parameters in ParameterHandler. */ static void declare_parameters (ParameterHandler ¶m); /** - * Parse parameters of - * ParameterHandler. + * Parse parameters of ParameterHandler. */ void parse_parameters (ParameterHandler ¶m); }; /** - * Flags describing the details of - * output in GNUPLOT format. + * Flags describing the details of output in GNUPLOT format. * * @ingroup output */ struct Gnuplot { /** - * Write the number of each cell into - * the output file before starting - * with the lines it is composed of, - * as a comment. This might be useful - * if you want to find out details - * about the grid, for example the - * position of cells of which you - * know the number. It enlarges - * the size of the output - * significantly, however. + * Write the number of each cell into the output file before + * starting with the lines it is composed of, as a comment. This + * might be useful if you want to find out details about the grid, + * for example the position of cells of which you know the + * number. It enlarges the size of the output significantly, + * however. * * Default: @p false. */ bool write_cell_numbers; /** - * Based on the vertices of the - * face and - * n_boundary_face_points - * additional points a tensor - * product mesh (tranformed to - * the real space) of - * $(n_boundary_face_points+2)^{dim-1}$ - * points is plotted on each - * boundary face. + * Based on the vertices of the face and #n_boundary_face_points + * additional points a tensor product mesh (tranformed to the real + * space) of (#n_boundary_face_points+2)dim-1 points is + * plotted on each boundary face. */ unsigned int n_boundary_face_points; /** - * Flag. If true also inner - * cells are plotted with - * curved boundaries. This is - * useful when for e.g. - * MappingQEulerian with - * n_boundary_face_points>0. + * Flag. If true also inner cells are plotted with curved + * boundaries. This is useful when for e.g. MappingQEulerian with + * #n_boundary_face_points>. */ bool curved_inner_cells; @@ -308,41 +256,33 @@ namespace GridOutFlags const unsigned int n_boundary_face_points = 2, const bool curved_inner_cells = false); /** - * Declare parameters in - * ParameterHandler. + * Declare parameters in ParameterHandler. */ static void declare_parameters (ParameterHandler ¶m); /** - * Parse parameters of - * ParameterHandler. + * Parse parameters of ParameterHandler. */ void parse_parameters (ParameterHandler ¶m); }; /** - * Flags describing the details of - * output for encapsulated postscript. - * In this structure, the flags common - * to all dimensions are listed. Flags - * which are specific to one space - * dimension only are listed in derived - * classes. + * Flags describing the details of output for encapsulated + * postscript. In this structure, the flags common to all + * dimensions are listed. Flags which are specific to one space + * dimension only are listed in derived classes. * - * By default, the size of the picture - * is scaled such that the width equals - * 300 units. + * By default, the size of the picture is scaled such that the width + * equals 300 units. * * @ingroup output */ struct EpsFlagsBase { /** - * Enum denoting the possibilities - * whether the scaling should be done - * such that the given @p size equals - * the width or the height of - * the resulting picture. + * Enum denoting the possibilities whether the scaling should be + * done such that the given @p size equals the width or the height + * of the resulting picture. */ enum SizeType { @@ -355,56 +295,40 @@ namespace GridOutFlags SizeType size_type; /** - * Width or height of the output - * as given in postscript units - * This usually is given by the - * strange unit 1/72 inch. Whether - * this is height or width is - * specified by the flag - * @p size_type. + * Width or height of the output as given in postscript units This + * usually is given by the strange unit 1/72 inch. Whether this is + * height or width is specified by the flag @p size_type. * * Default is 300. */ unsigned int size; /** - * Width of a line in postscript - * units. Default is 0.5. + * Width of a line in postscript units. Default is 0.5. */ double line_width; /** - * Should lines with a set @p user_flag - * be drawn in a different color (red)? - * See @ref GlossUserFlags for - * information about user flags. + * Should lines with a set @p user_flag be drawn in a different + * color (red)? See @ref GlossUserFlags for information about + * user flags. */ bool color_lines_on_user_flag; /** - * This is the number of - * points on a boundary face, - * that are ploted - * additionally to the - * vertices of the face. + * This is the number of points on a boundary face, that are + * ploted additionally to the vertices of the face. * - * This is used if the - * mapping used is not the - * standard @p MappingQ1 - * mapping. + * This is used if the mapping used is not the standard @p + * MappingQ1 mapping. */ unsigned int n_boundary_face_points; /** - * Should lines be colored - * according to their - * refinement level? This - * overrides - * color_lines_on_user_flag for - * all levels except level 0. - * Colors are: level 0: black, - * other levels: rainbow scale - * from blue to red. + * Should lines be colored according to their refinement level? + * This overrides color_lines_on_user_flag for all levels except + * level 0. Colors are: level 0: black, other levels: rainbow + * scale from blue to red. */ bool color_lines_level; @@ -418,8 +342,7 @@ namespace GridOutFlags const unsigned int n_boundary_face_points = 2, const bool color_lines_level = false); /** - * Declare parameters in - * ParameterHandler. + * Declare parameters in ParameterHandler. */ static void declare_parameters (ParameterHandler ¶m); @@ -432,17 +355,13 @@ namespace GridOutFlags /** - * Flags describing the details of - * output for encapsulated postscript - * for all dimensions not explicitly - * specialized below. Some flags that - * are common to all dimensions are - * listed in the base class. + * Flags describing the details of output for encapsulated + * postscript for all dimensions not explicitly specialized + * below. Some flags that are common to all dimensions are listed in + * the base class. * - * This class does not actually - * exist, we only here declare the - * general template and declare - * explicit specializations below. + * This class does not actually exist, we only here declare the + * general template and declare explicit specializations below. * * @ingroup output */ @@ -451,8 +370,7 @@ namespace GridOutFlags {}; /** - * Flags specific to the output of - * grids in one space dimensions. + * Flags specific to the output of grids in one space dimensions. * * @ingroup output */ @@ -468,22 +386,19 @@ namespace GridOutFlags const bool color_lines_on_user_flag = false, const unsigned int n_boundary_face_points = 2); /** - * Declare parameters in - * ParameterHandler. + * Declare parameters in ParameterHandler. */ static void declare_parameters (ParameterHandler ¶m); /** - * Parse parameters of - * ParameterHandler. + * Parse parameters of ParameterHandler. */ void parse_parameters (ParameterHandler ¶m); }; /** - * Flags specific to the output of - * grids in two space dimensions. + * Flags specific to the output of grids in two space dimensions. * * @ingroup output */ @@ -491,43 +406,28 @@ namespace GridOutFlags struct Eps<2> : public EpsFlagsBase { /** - * If this flag is set, then we - * place the number of the cell - * into the middle of each - * cell. The default value is - * to not do this. + * If this flag is set, then we place the number of the cell into + * the middle of each cell. The default value is to not do this. * - * The format of the cell - * number written is - * level.index, or simply - * @p index, depending on the - * value of the following flag. + * The format of the cell number written is 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 - * level.index, or simply - * @p index. If @p true, the - * first format is - * taken. Default is @p true. + * If the cell numbers shall be written, using the above flag, + * then the value of this flag determines whether the format shall + * be level.index, or simply @p index. If @p true, the + * first format is taken. Default is @p true. * - * The flag has obviously no - * effect if - * @p write_cell_numbers is - * @p false. + * The flag has obviously no effect if @p write_cell_numbers is @p + * false. */ bool write_cell_number_level; /** - * Vertex numbers can be - * written onto the - * vertices. This is controlled - * by the following - * flag. Default is @p false. + * Vertex numbers can be written onto the vertices. This is + * controlled by the following flag. Default is @p false. */ bool write_vertex_numbers; @@ -544,21 +444,18 @@ namespace GridOutFlags const bool write_vertex_numbers = false, const bool color_lines_level = false); /** - * Declare parameters in - * ParameterHandler. + * Declare parameters in ParameterHandler. */ static void declare_parameters (ParameterHandler ¶m); /** - * Parse parameters of - * ParameterHandler. + * Parse parameters of ParameterHandler. */ void parse_parameters (ParameterHandler ¶m); }; /** - * Flags specific to the output of - * grids in three space dimensions. + * Flags specific to the output of grids in three space dimensions. * * @ingroup output */ @@ -566,26 +463,19 @@ namespace GridOutFlags struct Eps<3> : public EpsFlagsBase { /** - * Angle of the line origin-viewer - * against the z-axis in degrees. + * Angle of the line origin-viewer against the z-axis in degrees. * - * Default is the Gnuplot-default - * of 60. + * Default is the Gnuplot-default of 60. */ double azimut_angle; /** - * Angle by which the viewers - * position projected onto the - * x-y-plane is rotated around - * the z-axis, in positive sense - * when viewed from above. The - * unit are degrees, and zero - * equals a position above or below - * the negative y-axis. + * Angle by which the viewers position projected onto the + * x-y-plane is rotated around the z-axis, in positive sense when + * viewed from above. The unit are degrees, and zero equals a + * position above or below the negative y-axis. * - * Default is the Gnuplot-default - * of 30. + * Default is the Gnuplot-default of 30. */ double turn_angle; @@ -600,14 +490,12 @@ namespace GridOutFlags const double azimut_angle = 60, const double turn_angle = 30); /** - * Declare parameters in - * ParameterHandler. + * Declare parameters in ParameterHandler. */ static void declare_parameters (ParameterHandler ¶m); /** - * Parse parameters of - * ParameterHandler. + * Parse parameters of ParameterHandler. */ void parse_parameters (ParameterHandler ¶m); }; @@ -642,81 +530,62 @@ namespace GridOutFlags /** * @deprecated Use the color_by enum instead. * - * Change color depending on - * level. Default is false, therefore, - * color is coded by material or - * boundary id. + * Change color depending on level. Default is false, therefore, + * color is coded by material or boundary id. */ bool level_color DEAL_II_DEPRECATED; /** - * Code level to depth. Default is - * true. If false, color depends on - * material or boundary id. + * Code level to depth. Default is true. If false, color depends + * on material or boundary id. * - * Depth of the object is 900-level, if - * this value is true. + * Depth of the object is 900-level, if this value is true. */ bool level_depth; /** - * Additional points for curved - * boundaries. Default is none. + * Additional points for curved boundaries. Default is none. */ unsigned int n_boundary_face_points; /** - * Scaling of graph. The - * default is a unit length of - * one inch. + * Scaling of graph. The default is a unit length of one inch. */ Point<2> scaling; /** - * Offset of the graph. Before - * scaling, the coordinates are - * shifted by this - * value. Default is zero in - * each direction. + * Offset of the graph. Before scaling, the coordinates are + * shifted by this value. Default is zero in each direction. */ Point<2> offset; /** - * Style for filling cells. Default is - * solid fill (20). This value is - * forwarded unchanged into the - * corresponding field - * fill_style of the polyline - * object of XFig. + * Style for filling cells. Default is solid fill (20). This value + * is forwarded unchanged into the corresponding field + * fill_style of the polyline object of XFig. */ int fill_style; /** - * Style for drawing border lines of - * polygons. Defaults to solid (0) and - * is forwarded to XFig. + * Style for drawing border lines of polygons. Defaults to solid + * (0) and is forwarded to XFig. */ int line_style; /** - * Thickness of border lines of - * polygons. Default is 1. + * Thickness of border lines of polygons. Default is 1. * - * Set this to zero to avoid - * border lines for very fine - * meshes. + * Set this to zero to avoid border lines for very fine meshes. */ int line_thickness; /** - * Style for drawing lines at the - * boundary. Defaults to solid (0). + * Style for drawing lines at the boundary. Defaults to solid (0). */ int boundary_style; /** - * Thickness of boundary - * lines. Default is 3. + * Thickness of boundary lines. Default is 3. */ int boundary_thickness; @@ -725,14 +594,12 @@ namespace GridOutFlags */ XFig(); /** - * Declare parameters in - * ParameterHandler. + * Declare parameters in ParameterHandler. */ static void declare_parameters (ParameterHandler ¶m); /** - * Parse parameters of - * ParameterHandler. + * Parse parameters of ParameterHandler. */ void parse_parameters (ParameterHandler ¶m); }; @@ -740,6 +607,8 @@ namespace GridOutFlags /** * Flags controlling SVG output. + * + * @ingroup output */ struct Svg { @@ -899,7 +768,7 @@ namespace GridOutFlags * * @ingroup grid * @ingroup output - * @author Wolfgang Bangerth, Guido Kanschat, Luca Heltai, 1999, 2003, 2006; postscript format based on an implementation by Stefan Nauber, 1999 + * @author Wolfgang Bangerth, Guido Kanschat, Luca Heltai, 1999, 2003, 2006; SVG by Christian Wülker, 2013; postscript format based on an implementation by Stefan Nauber, 1999 */ class GridOut { @@ -1022,146 +891,82 @@ public: const Mapping *mapping=0) const; /** - * Write the triangulation in the - * msh format. + * Write the triangulation in the msh format. * - * Msh - * is the format used by Gmsh and it is - * described in the gmsh - * user's guide. Besides the - * usual output of the grid - * only, you can decide through - * additional flags (see below, - * and the documentation of the - * GridOutFlags::Msh() class) - * whether boundary faces with - * non-zero boundary indicator - * shall be written to the file - * explicitly. This is useful, - * if you want to re-read the - * grid later on, since - * deal.II sets the boundary - * indicator to zero by default; - * therefore, to obtain the - * same triangulation as before, - * you have to specify faces - * with differing boundary - * indicators explicitly, which - * is done by this flag. + * Msh is the format used by Gmsh and it is described in the gmsh + * user's guide. Besides the usual output of the grid only, you can + * decide through additional flags (see below, and the documentation + * of the GridOutFlags::Msh() class) whether boundary faces with + * non-zero boundary indicator shall be written to the file + * explicitly. This is useful, if you want to re-read the grid later + * on, since deal.II sets the boundary indicator to zero by + * default; therefore, to obtain the same triangulation as before, + * you have to specify faces with differing boundary indicators + * explicitly, which is done by this flag. * - * Names and values of further - * flags controlling the output - * can be found in the - * documentation of the - * GridOut::Msh() class. + * Names and values of further flags controlling the output can be + * found in the documentation of the GridOut::Msh() class. * - * Works also in the - * codimension one case. + * Works also in the codimension one case. */ template void write_msh (const Triangulation &tria, std::ostream &out) const; /** - * Write the triangulation in the - * ucd format. + * Write the triangulation in the ucd format. * - * UCD (unstructured cell data) - * is the format used by AVS and - * some other programs. It is - * described in the AVS - * developer's guide. Besides the - * usual output of the grid - * only, you can decide through - * additional flags (see below, - * and the documentation of the - * GridOutFlags::Ucd() class) - * whether boundary faces with - * non-zero boundary indicator - * shall be written to the file - * explicitly. This is useful, - * if you want to re-read the - * grid later on, since - * deal.II sets the boundary - * indicator to zero by default; - * therefore, to obtain the - * same triangulation as before, - * you have to specify faces - * with differing boundary - * indicators explicitly, which - * is done by this flag. + * UCD (unstructured cell data) is the format used by AVS and some + * other programs. It is described in the AVS developer's + * guide. Besides the usual output of the grid only, you can decide + * through additional flags (see below, and the documentation of the + * GridOutFlags::Ucd() class) whether boundary faces with non-zero + * boundary indicator shall be written to the file explicitly. This + * is useful, if you want to re-read the grid later on, since + * deal.II sets the boundary indicator to zero by default; + * therefore, to obtain the same triangulation as before, you have + * to specify faces with differing boundary indicators explicitly, + * which is done by this flag. * - * Names and values of further - * flags controlling the output - * can be found in the - * documentation of the - * GridOut::Ucd() class. + * Names and values of further flags controlling the output can be + * found in the documentation of the GridOut::Ucd() class. * - * Works also for the - * codimension one case. + * Works also for the codimension one case. */ template void write_ucd (const Triangulation &tria, std::ostream &out) const; /** - * Write the triangulation in the - * encapsulated postscript format. + * Write the triangulation in the encapsulated postscript format. * - * In this format, each line of - * the triangulation is written - * separately. We scale the - * picture such that either - * x-values or y-values range - * between zero and a fixed - * size. The other axis is scaled - * by the same factor. Which axis - * is taken to compute the scale - * and the size of the box it - * shall fit into is determined - * by the output flags (see - * below, and the documentation - * of the GridOutFlags::Eps() - * class). + * In this format, each line of the triangulation is written + * separately. We scale the picture such that either x-values or + * y-values range between zero and a fixed size. The other axis is + * scaled by the same factor. Which axis is taken to compute the + * scale and the size of the box it shall fit into is determined by + * the output flags (see below, and the documentation of the + * GridOutFlags::Eps() class). * - * The bounding box is close to - * the triangulation on all four - * sides, without an extra - * frame. The line width is - * chosen to be 0.5 by default, - * but can be changed. The line - * width is to be compared with - * the extension of the picture, - * of which the default is 300. + * The bounding box is close to the triangulation on all four sides, + * without an extra frame. The line width is chosen to be 0.5 by + * default, but can be changed. The line width is to be compared + * with the extension of the picture, of which the default is 300. * - * The flag - * @p color_lines_on_user_flag - * allows to draw lines with the - * @p user_flag set to be drawn in - * red. The colors black and red - * are defined as @p b and @p r in - * the preamble of the output - * file and can be changed there - * according to need. + * The flag @p color_lines_on_user_flag allows to draw lines with + * the @p user_flag set to be drawn in red. The colors black and red + * are defined as @p b and @p r in the preamble of the output file + * and can be changed there according to need. * - * @p mapping is a pointer to a - * mapping used for the - * transformation of cells at the - * boundary. If zero, then use - * standard Q1 mapping. + * @p mapping is a pointer to a mapping used for the transformation + * of cells at the boundary. If zero, then use standard Q1 mapping. * - * Names and values of additional - * flags controlling the output - * can be found in the - * documentation of the - * GridOutFlags::Eps() - * class. Especially the - * viewpoint for three - * dimensional grids is of + * Names and values of additional flags controlling the output can + * be found in the documentation of the GridOutFlags::Eps() + * class. Especially the viewpoint for three dimensional grids is of * importance here. * - * Not implemented for the - * codimension one case. + * Not implemented for the codimension one case. */ template void write_eps (const Triangulation &tria, @@ -1171,29 +976,20 @@ public: /** * Write two-dimensional XFig-file. * - * This function writes all grid cells as - * polygons and optionally boundary - * lines. Several parameters can be - * adjusted by the XFigFlags control - * object. + * This function writes all grid cells as polygons and optionally + * boundary lines. Several parameters can be adjusted by the + * XFigFlags control object. * - * If levels are coded to depth, the - * complete grid hierarchy is plotted - * with fine cells before their - * parents. This way, levels can be - * switched on and off in xfig by - * selecting levels. + * If levels are coded to depth, the complete grid hierarchy is + * plotted with fine cells before their parents. This way, levels + * can be switched on and off in xfig by selecting levels. * - * Polygons are either at depth 900-level - * or at 900+@p material_id, depending on - * the flag @p level_depth. Accordingly, - * boundary edges are at depth 800-level - * or at 800+@p boundary_id. Therefore, - * boundary edges are alway in front of - * cells. + * Polygons are either at depth 900-level or at 900+@p material_id, + * depending on the flag @p level_depth. Accordingly, boundary edges + * are at depth 800-level or at 800+@p boundary_id. Therefore, + * boundary edges are alway in front of cells. * - * Not implemented for the - * codimension one case. + * Not implemented for the codimension one case. */ template void write_xfig (const Triangulation &tria, @@ -1201,33 +997,22 @@ public: const Mapping *mapping=0) const; /** - * Write the triangulation in the - * SVG format. + * Write the triangulation in the SVG format. * - * SVG (Scalable Vector Graphics) is - * an XML-based vector image format - * recommended by the World Wide Web - * Consortium (W3C). This function - * conforms to the latest - * specification SVG 1.1, released + * SVG (Scalable Vector Graphics) is an XML-based vector image + * format recommended by the World Wide Web Consortium (W3C). This + * function conforms to the latest specification SVG 1.1, released * on August 16, 2011. * - * The cells of the triangulation - * are written as polygons with - * additional lines at the boundary - * of the triangulation. A coloring - * of the cells is further possible - * in order to visualize a - * certain property of the cells - * such as their level or material - * id. A colorbar can be drawn to - * encode the chosen coloring. - * Moreover, a cell label can be - * added, showing level index, etc. + * The cells of the triangulation are written as polygons with + * additional lines at the boundary of the triangulation. A coloring + * of the cells is further possible in order to visualize a certain + * property of the cells such as their level or material id. A + * colorbar can be drawn to encode the chosen coloring. Moreover, a + * cell label can be added, showing level index, etc. * - * @note Only implemented for the - * two-dimensional grids in two - * space dimensions. + * @note Only implemented for two-dimensional grids in two space + * dimensions. * */ template @@ -1238,11 +1023,8 @@ public: std::ostream &out) const; /** - * Write grid to @p out according - * to the given data format. This - * function simply calls the - * appropriate write_* - * function. + * Write grid to @p out according to the given data format. This + * function simply calls the appropriate write_* function. */ template void write (const Triangulation &tria, @@ -1251,8 +1033,7 @@ public: const Mapping *mapping=0) const; /** - * Write mesh in default format - * set by ParameterHandler. + * Write mesh in default format set by ParameterHandler. */ template void write (const Triangulation &tria, @@ -1292,14 +1073,12 @@ public: void set_flags (const GridOutFlags::Eps<2> &flags); /** - * Set flags for EPS output of a - * three-dimensional triangulation + * Set flags for EPS output of a three-dimensional triangulation */ void set_flags (const GridOutFlags::Eps<3> &flags); /** - * Set flags for EPS output of a - * three-dimensional triangulation + * Set flags for EPS output of a three-dimensional triangulation */ void set_flags (const GridOutFlags::XFig &flags); @@ -1320,67 +1099,55 @@ public: *
  • @p eps: .eps. * * - * Since this function does not need data - * from this object, it is static and can - * thus be called without creating an - * object of this class. + * Since this function does not need data from this object, it is + * static and can thus be called without creating an object of this + * class. */ static std::string default_suffix (const OutputFormat output_format); /** - * Default suffix for the default - * output format selected throuw + * Default suffix for the default output format selected throuw * ParameterHandler. */ std::string default_suffix () const; /** - * Return the @p OutputFormat value - * corresponding to the given string. If - * the string does not match any known - * format, an exception is thrown. + * Return the @p OutputFormat value corresponding to the given + * string. If the string does not match any known format, an + * exception is thrown. * - * Since this function does not need data - * from this object, it is static and can - * thus be called without creating an - * object of this class. Its main purpose - * is to allow a program to use any - * implemented output format without the - * need to extend the program's parser - * each time a new format is implemented. + * Since this function does not need data from this object, it is + * static and can thus be called without creating an object of this + * class. Its main purpose is to allow a program to use any + * implemented output format without the need to extend the + * program's parser each time a new format is implemented. * - * To get a list of presently available - * format names, e.g. to give it to the - * ParameterHandler class, use the - * function get_output_format_names (). + * To get a list of presently available format names, e.g. to give + * it to the ParameterHandler class, use the function + * get_output_format_names(). */ static OutputFormat parse_output_format (const std::string &format_name); /** - * Return a list of implemented output - * formats. The different names are - * separated by vertical bar signs (`|') - * as used by the ParameterHandler - * classes. + * Return a list of implemented output formats. The different names + * are separated by vertical bar signs (`|') as used by the + * ParameterHandler classes. */ static std::string get_output_format_names (); /** - * Declare parameters in - * ParameterHandler. + * Declare parameters in ParameterHandler. */ static void declare_parameters (ParameterHandler ¶m); /** - * Parse parameters of - * ParameterHandler. + * Parse parameters of ParameterHandler. */ void parse_parameters (ParameterHandler ¶m); /** - * Determine an estimate for the - * memory consumption (in bytes) - * of this object. + * Determine an estimate for the memory consumption (in bytes) of + * this object. */ std::size_t memory_consumption () const; @@ -1391,8 +1158,7 @@ public: private: /** - * The default output format, set - * by a ParameterHandler. + * The default output format, set by a ParameterHandler. */ OutputFormat default_format; @@ -1402,30 +1168,27 @@ private: GridOutFlags::DX dx_flags; /** - * Flags for GMSH output. Can be - * changed by using the - * @p set_flags function. + * Flags for GMSH output. Can be changed by using the set_flags(const GridOutFlags::Msh&) + * function. */ GridOutFlags::Msh msh_flags; /** - * Flags for UCD output. Can be - * changed by using the - * @p set_flags function. + * Flags for UCD output. Can be changed by using the set_flags(const GridOutFlags::Ucd&) + * function. */ GridOutFlags::Ucd ucd_flags; /** - * Flags to be used upon output of GNUPLOT - * data. Can be changed by using the - * @p set_flags function. + * Flags to be used upon output of GNUPLOT data. Can be changed by + * using the set_flags(const GridOutFlags::Gnuplot&) function. */ GridOutFlags::Gnuplot gnuplot_flags; /** * Flags to be used upon output of EPS * data in one space dimension. Can be - * changed by using the @p set_flags + * changed by using the set_flags(const GridOutFlags::Eps<1>&) * function. */ GridOutFlags::Eps<1> eps_flags_1; @@ -1457,28 +1220,21 @@ private: GridOutFlags::Svg svg_flags; /** - * Write the grid information about - * faces to @p out. Only those faces - * are printed which are on the boundary - * and which have a boundary indicator - * not equal to zero, since the latter - * is the default for boundary faces. + * Write the grid information about faces to @p out. Only those + * faces are printed which are on the boundary and which have a + * boundary indicator not equal to zero, since the latter is the + * default for boundary faces. * - * Since cells and faces are continuously - * numbered, the @p starting_index for - * the numbering of the faces is passed - * also. + * Since cells and faces are continuously numbered, the @p + * starting_index for the numbering of the faces is passed also. * - * This function unfortunately can not - * be included in the regular @p write_msh - * function, since it needs special - * treatment for the case dim==1, in - * which case the face iterators are - * void*'s and lack the member functions - * which are called. We would not actually - * call these functions, but the compiler - * would complain anyway when compiling - * the function for dim==1. Bad luck. + * This function unfortunately can not be included in the regular @p + * write_msh function, since it needs special treatment for the case + * dim==1, in which case the face iterators are + * void*'s and lack the member functions which are + * called. We would not actually call these functions, but the + * compiler would complain anyway when compiling the function for + * dim==1. Bad luck. */ template void write_msh_faces (const Triangulation &tria, @@ -1508,32 +1264,20 @@ private: /** - * Write the grid information about - * lines to @p out. Only those lines - * are printed which are on the boundary - * and which have a boundary indicator - * not equal to zero, since the latter - * is the default for boundary faces. + * Write the grid information about lines to @p out. Only those + * lines are printed which are on the boundary and which have a + * boundary indicator not equal to zero, since the latter is the + * default for boundary faces. * - * Since cells and faces are continuously - * numbered, the @p starting_index for - * the numbering of the lines is passed - * also. + * Since cells and faces are continuously numbered, the @p + * starting_index for the numbering of the lines is passed also. * - * This function unfortunately - * can not be included in the - * regular @p write_msh function, - * since it needs special - * treatment for the case - * dim==1 and - * dim==2, in which case - * the edge iterators are - * void*'s and lack the - * member functions which are - * called. We would not actually - * call these functions, but the - * compiler would complain anyway - * when compiling the function + * This function unfortunately can not be included in the regular @p + * write_msh function, since it needs special treatment for the case + * dim==1 and dim==2, in which case the edge + * iterators are void*'s and lack the member functions + * which are called. We would not actually call these functions, but + * the compiler would complain anyway when compiling the function * for dim==1/2. Bad luck. */ template @@ -1542,8 +1286,7 @@ private: std::ostream &out) const; /** - * Declaration of the specialization - * of above function for 1d. Does + * Declaration of the specialization of above function for 1d. Does * nothing. */ void write_msh_lines (const Triangulation<1,1> &tria, @@ -1551,9 +1294,8 @@ private: std::ostream &out) const; /** - * Declaration of the specialization - * of above function for 1d, 2sd. Does - * nothing. + * Declaration of the specialization of above function for 1d, + * 2sd. Does nothing. */ void write_msh_lines (const Triangulation<1,2> &tria, const unsigned int starting_index, @@ -1562,45 +1304,36 @@ private: const unsigned int starting_index, std::ostream &out) const; /** - * Declaration of the specialization - * of above function for 2d. Does + * Declaration of the specialization of above function for 2d. Does * nothing. */ void write_msh_lines (const Triangulation<2,2> &tria, const unsigned int starting_index, std::ostream &out) const; /** - * Declaration of the specialization - * of above function for 2d, 3sd. Does - * nothing. + * Declaration of the specialization of above function for 2d, + * 3sd. Does nothing. */ void write_msh_lines (const Triangulation<2,3> &tria, const unsigned int starting_index, std::ostream &out) const; /** - * Write the grid information about - * faces to @p out. Only those faces - * are printed which are on the boundary - * and which have a boundary indicator - * not equal to zero, since the latter - * is the default for boundary faces. + * Write the grid information about faces to @p out. Only those + * faces are printed which are on the boundary and which have a + * boundary indicator not equal to zero, since the latter is the + * default for boundary faces. * - * Since cells and faces are continuously - * numbered, the @p starting_index for - * the numbering of the faces is passed - * also. + * Since cells and faces are continuously numbered, the @p + * starting_index for the numbering of the faces is passed also. * - * This function unfortunately can not - * be included in the regular @p write_ucd - * function, since it needs special - * treatment for the case dim==1, in - * which case the face iterators are - * void*'s and lack the member functions - * which are called. We would not actually - * call these functions, but the compiler - * would complain anyway when compiling - * the function for dim==1. Bad luck. + * This function unfortunately can not be included in the regular @p + * write_ucd function, since it needs special treatment for the case + * dim==1, in which case the face iterators are + * void*'s and lack the member functions which are + * called. We would not actually call these functions, but the + * compiler would complain anyway when compiling the function for + * dim==1. Bad luck. */ @@ -1610,8 +1343,7 @@ private: std::ostream &out) const; /** - * Declaration of the specialization - * of above function for 1d. Does + * Declaration of the specialization of above function for 1d. Does * nothing. */ void write_ucd_faces (const Triangulation<1,1> &tria, @@ -1619,9 +1351,8 @@ private: std::ostream &out) const; /** - * Declaration of the specialization - * of above function for 1d, 2sd. Does - * nothing. + * Declaration of the specialization of above function for 1d, + * 2sd. Does nothing. */ void write_ucd_faces (const Triangulation<1,2> &tria, const unsigned int starting_index, @@ -1632,29 +1363,21 @@ private: /** - * Write the grid information about - * lines to @p out. Only those lines - * are printed which are on the boundary - * and which have a boundary indicator - * not equal to zero, since the latter - * is the default for boundary lines. + * Write the grid information about lines to @p out. Only those + * lines are printed which are on the boundary and which have a + * boundary indicator not equal to zero, since the latter is the + * default for boundary lines. * - * Since cells, faces and lines - * are continuously numbered, the - * @p starting_index for the - * numbering of the faces is - * passed also. + * Since cells, faces and lines are continuously numbered, the @p + * starting_index for the numbering of the faces is passed also. * - * This function unfortunately can not - * be included in the regular @p write_ucd - * function, since it needs special - * treatment for the case dim==1/2, in - * which case the edge iterators are - * void*'s and lack the member functions - * which are called. We would not actually - * call these functions, but the compiler - * would complain anyway when compiling - * the function for dim==1/2. Bad luck. + * This function unfortunately can not be included in the regular @p + * write_ucd function, since it needs special treatment for the case + * dim==1/2, in which case the edge iterators are + * void*'s and lack the member functions which are + * called. We would not actually call these functions, but the + * compiler would complain anyway when compiling the function for + * dim==1/2. Bad luck. */ @@ -1664,17 +1387,15 @@ private: std::ostream &out) const; /** - * Declaration of the specialization - * of above function for 1d. Does + * Declaration of the specialization of above function for 1d. Does * nothing. */ void write_ucd_lines (const Triangulation<1,1> &tria, const unsigned int starting_index, std::ostream &out) const; /** - * Declaration of the specialization - * of above function for 1d, 2sd. Does - * nothing. + * Declaration of the specialization of above function for 1d, + * 2sd. Does nothing. */ void write_ucd_lines (const Triangulation<1,2> &tria, const unsigned int starting_index, @@ -1685,104 +1406,85 @@ private: /** - * Declaration of the specialization - * of above function for 2d. Does + * Declaration of the specialization of above function for 2d. Does * nothing. */ void write_ucd_lines (const Triangulation<2,2> &tria, const unsigned int starting_index, std::ostream &out) const; /** - * Declaration of the specialization - * of above function for 2d, 3sd. Does - * nothing. + * Declaration of the specialization of above function for 2d, + * 3sd. Does nothing. */ void write_ucd_lines (const Triangulation<2,3> &tria, const unsigned int starting_index, std::ostream &out) const; /** - * Return the number of faces in the - * triangulation which have a boundary - * indicator not equal to zero. Only - * these faces are explicitly printed - * in the write_* functions; - * all faces with indicator - * numbers::internal_face_boundary_id are - * interior ones and an indicator with - * value zero for faces at the boundary + * Return the number of faces in the triangulation which have a + * boundary indicator not equal to zero. Only these faces are + * explicitly printed in the write_* functions; all faces + * with indicator numbers::internal_face_boundary_id are interior + * ones and an indicator with value zero for faces at the boundary * are considered default. * - * This function always returns an empty - * list in one dimension. + * This function always returns an empty list in one dimension. * - * The reason for this function is the - * same as for @p write_ucd_faces. See - * there for more information. + * The reason for this function is the same as for + * write_ucd_faces(). See there for more information. */ template unsigned int n_boundary_faces (const Triangulation &tria) const; /** - * Declaration of the specialization - * of above function for + * Declaration of the specialization of above function for * 1d. Simply returns zero. */ unsigned int n_boundary_faces (const Triangulation<1,1> &tria) const; /** - * Declaration of the specialization - * of above function for - * 1d, 2sd. Simply returns zero. + * Declaration of the specialization of above function for 1d, + * 2sd. Simply returns zero. */ unsigned int n_boundary_faces (const Triangulation<1,2> &tria) const; unsigned int n_boundary_faces (const Triangulation<1,3> &tria) const; /** - * Return the number of lines in the - * triangulation which have a boundary - * indicator not equal to zero. Only - * these lines are explicitly printed - * in the write_* functions; - * all lines with indicator - * numbers::internal_face_boundary_id are - * interior ones and an indicator with - * value zero for faces at the boundary + * Return the number of lines in the triangulation which have a + * boundary indicator not equal to zero. Only these lines are + * explicitly printed in the write_* functions; all lines + * with indicator numbers::internal_face_boundary_id are interior + * ones and an indicator with value zero for faces at the boundary * are considered default. * - * This function always returns an empty - * list in one and two dimensions. + * This function always returns an empty list in one and two + * dimensions. * - * The reason for this function is the - * same as for @p write_ucd_faces. See - * there for more information. + * The reason for this function is the same as for + * write_ucd_faces(). See there for more information. */ template unsigned int n_boundary_lines (const Triangulation &tria) const; /** - * Declaration of the specialization - * of above function for + * Declaration of the specialization of above function for * 1d. Simply returns zero. */ unsigned int n_boundary_lines (const Triangulation<1,1> &tria) const; /** - * Declaration of the specialization - * of above function for - * 1d, 2sd. Simply returns zero. + * Declaration of the specialization of above function for 1d, + * 2sd. Simply returns zero. */ unsigned int n_boundary_lines (const Triangulation<1,2> &tria) const; unsigned int n_boundary_lines (const Triangulation<1,3> &tria) const; /** - * Declaration of the specialization - * of above function for + * Declaration of the specialization of above function for * 2d. Simply returns zero. */ unsigned int n_boundary_lines (const Triangulation<2,2> &tria) const; /** - * Declaration of the specialization - * of above function for - * 2d, 3sd. Simply returns zero. + * Declaration of the specialization of above function for 2d, + * 3sd. Simply returns zero. */ unsigned int n_boundary_lines (const Triangulation<2,3> &tria) const; }; diff --git a/deal.II/source/grid/grid_out.cc b/deal.II/source/grid/grid_out.cc index d3009d06f5..630a4108fe 100644 --- a/deal.II/source/grid/grid_out.cc +++ b/deal.II/source/grid/grid_out.cc @@ -1331,9 +1331,10 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const // seem to possess this attribute ... const unsigned int height = 4000; // TODO [CW]: consider other options ... - - unsigned int cell_label_font_size = round((height/100.) * 2.25); // initial font size for cell labels - unsigned int font_size = round((height/100.) * 2.); // font size for date, time, legend, and colorbar +// the following + + unsigned int cell_label_font_size = static_cast(0.5+ (height/100.) * 2.25); // initial font size for cell labels + unsigned int font_size = static_cast(0.5+ (height/100.) * 2.); // font size for date, time, legend, and colorbar // get date and time time_t time_stamp; @@ -1379,13 +1380,13 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const if (cell->vertex(vertex_index)[1] < y_min) y_min = cell->vertex(vertex_index)[1]; if (cell->vertex(vertex_index)[1] > y_max) y_max = cell->vertex(vertex_index)[1]; } - + if ((unsigned int)cell->level() < min_level) min_level = cell->level(); if ((unsigned int)cell->level() > max_level) max_level = cell->level(); - + if ((unsigned int)cell->material_id()) materials[(unsigned int)cell->material_id()] = 1; else if ((unsigned int)cell->material_id() == 0) materials[0] = 1; - + if ((int)cell->level()) levels[(unsigned int)cell->level()] = 1; else if ((unsigned int)cell->level() == 0) levels[0] = 1; @@ -1398,25 +1399,25 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const const double x_dimension = x_max - x_min; const double y_dimension = y_max - y_min; - + // count the materials being used for (unsigned int material_index = 0; material_index < 256; material_index++) { if (materials[material_index]) n_materials++; } - + // count the levels being used for (unsigned int level_index = 0; level_index < 256; level_index++) { if (levels[level_index]) n_levels++; } - + // count the subdomains being used for (unsigned int subdomain_index = 0; subdomain_index < 256; subdomain_index++) { if (subdomains[subdomain_index]) n_subdomains++; } - + /* // count the level subdomains being used for(int level_subdomain_index = 0; level_subdomain_index < 256; level_subdomain_index++) @@ -1426,30 +1427,35 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const */ //------------------ create the svg file with internal style sheet - const unsigned int width = round(height * (x_dimension/y_dimension)); + const unsigned int width = static_cast(0.5+ height * (x_dimension/y_dimension)); unsigned int additional_width = 0; - if (svg_flags.draw_legend && (svg_flags.label_level_number || svg_flags.label_cell_index || svg_flags.label_material_id || svg_flags.label_subdomain_id)) // || svg_flags.label_level_subdomain_id )) + if (svg_flags.draw_legend && + (svg_flags.label_level_number || + svg_flags.label_cell_index || + svg_flags.label_material_id || + svg_flags.label_subdomain_id)) // || svg_flags.label_level_subdomain_id )) { - additional_width = round(height * .4); // additional width for legend + additional_width = static_cast(0.5+ height * .4); // additional width for legend } else if (svg_flags.draw_colorbar && svg_flags.coloring) { - additional_width = round(height * .175); // additional width for colorbar // TODO [CW]: not enough / automatic adjustment ... + additional_width = static_cast(0.5+ height * .175); // additional width for colorbar // TODO [CW]: not enough / automatic adjustment ... } out << "" << '\n' << '\n'; - + // basic svg header and inclusion of the corresponding style sheet - out << "" + out << "" << '\n' << '\n'; - + if (svg_flags.background == 2) { out << " " << '\n' @@ -1458,28 +1464,28 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const << " " << '\n'; } - + out << '\n'; - + out << "" << '\n' << '\n'; - out << " " + out << " " << '\n'; - + if (svg_flags.background == 2) { unsigned int x_offset = 0; - - if (svg_flags.margin_in_percent) x_offset = round((height/100.) * (svg_flags.margin_in_percent/2.)); - else x_offset = round(height * .025); - - out << " " + + if (svg_flags.margin_in_percent) + x_offset = static_cast(0.5+ (height/100.) * (svg_flags.margin_in_percent/2.)); + else + x_offset = static_cast(0.5+ height * .025); + + out << " (0.5+ height * .045) << '\"' + << " style=\"font-weight:100; fill:lightsteelblue; text-anchor:start; font-family:Courier; font-size:" + << static_cast(0.5+ height * .035) << "\">" << "deal.II" << "" << '\n'; - - out << " " + + out << " (0.5+ height * .045 * 3.75) << "\" y=\"" << static_cast(0.5+ height * .045) << '\"' + << " style=\"fill:lightsteelblue; text-anchor:start; font-size:" << static_cast(0.5+ font_size * .75) << "\">" << now->tm_mday << '/' << now->tm_mon + 1 << '/' << now->tm_year + 1900 << " - " << now->tm_hour << ':'; - + if (now->tm_min < 10) out << '0'; - + out << now->tm_min << "" << '\n' << '\n'; @@ -1638,25 +1661,28 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const } out << " d=\"" - << "M " << round(((cell->vertex(0)[0] - x_min) / x_dimension) * (width - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) - << ' ' << round(((cell->vertex(0)[1] - y_min) / y_dimension) * (height - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) - << " L " << round(((cell->vertex(1)[0] - x_min) / x_dimension) * (width - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) - << ' ' << round(((cell->vertex(1)[1] - y_min) / y_dimension) * (height - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) - << " L " << round(((cell->vertex(3)[0] - x_min) / x_dimension) * (width - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) - << ' ' << round(((cell->vertex(3)[1] - y_min) / y_dimension) * (height - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) - << " L " << round(((cell->vertex(2)[0] - x_min) / x_dimension) * (width - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) - << ' ' << round(((cell->vertex(2)[1] - y_min) / y_dimension) * (height - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) - << " L " << round(((cell->vertex(0)[0] - x_min) / x_dimension) * (width - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) - << ' ' << round(((cell->vertex(0)[1] - y_min) / y_dimension) * (height - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) + << "M " << static_cast(0.5+ ((cell->vertex(0)[0] - x_min) / x_dimension) * (width - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) + << ' ' << static_cast(0.5+ ((cell->vertex(0)[1] - y_min) / y_dimension) * (height - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) + << " L " << static_cast(0.5+ ((cell->vertex(1)[0] - x_min) / x_dimension) * (width - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) + << ' ' << static_cast(0.5+ ((cell->vertex(1)[1] - y_min) / y_dimension) * (height - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) + << " L " << static_cast(0.5+ ((cell->vertex(3)[0] - x_min) / x_dimension) * (width - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) + << ' ' << static_cast(0.5+ ((cell->vertex(3)[1] - y_min) / y_dimension) * (height - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) + << " L " << static_cast(0.5+ ((cell->vertex(2)[0] - x_min) / x_dimension) * (width - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) + << ' ' << static_cast(0.5+ ((cell->vertex(2)[1] - y_min) / y_dimension) * (height - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) + << " L " << static_cast(0.5+ ((cell->vertex(0)[0] - x_min) / x_dimension) * (width - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) + << ' ' << static_cast(0.5+ ((cell->vertex(0)[1] - y_min) / y_dimension) * (height - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) << "\"/>" << '\n'; // label the current cell - if (svg_flags.label_level_number || svg_flags.label_cell_index || svg_flags.label_material_id || svg_flags.label_subdomain_id) // || svg_flags.label_level_subdomain_id) + if (svg_flags.label_level_number || + svg_flags.label_cell_index || + svg_flags.label_material_id || + svg_flags.label_subdomain_id) // || svg_flags.label_level_subdomain_id) { out << " level() - << "\" x=\"" << round(((cell->center()[0] - x_min) / x_dimension) * (width - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) - << "\" y=\"" << round(((cell->center()[1] - y_min) / y_dimension) * (height - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) + << "\" x=\"" << static_cast(0.5+ ((cell->center()[0] - x_min) / x_dimension) * (width - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) + << "\" y=\"" << static_cast(0.5+ ((cell->center()[1] - y_min) / y_dimension) * (height - (height/100.) * 2. * svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) << "\">"; if (svg_flags.label_level_number) @@ -1672,13 +1698,16 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const if (svg_flags.label_material_id) { - if (svg_flags.label_level_number || svg_flags.label_cell_index) out << ','; + if (svg_flags.label_level_number + || svg_flags.label_cell_index) out << ','; out << (int)cell->material_id(); } if (svg_flags.label_subdomain_id) { - if (svg_flags.label_level_number || svg_flags.label_cell_index || svg_flags.label_material_id) out << ','; + if (svg_flags.label_level_number + || svg_flags.label_cell_index + || svg_flags.label_material_id) out << ','; out << cell->subdomain_id(); } /* @@ -1699,10 +1728,10 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const { if (cell->at_boundary(faceIndex)) { - out << " face(faceIndex)->vertex(0)[0] - x_min)/x_dimension) * (width - (height/100.) *2.* svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) - << "\" y1=\"" << round(((cell->face(faceIndex)->vertex(0)[1] - y_min)/y_dimension) * (height - (height/100.) *2.* svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) - << "\" x2=\"" << round(((cell->face(faceIndex)->vertex(1)[0] - x_min)/x_dimension) * (width - (height/100.) *2.* svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) - << "\" y2=\"" << round(((cell->face(faceIndex)->vertex(1)[1] - y_min)/y_dimension) * (height - (height/100.) *2.* svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) + out << " (0.5+ ((cell->face(faceIndex)->vertex(0)[0] - x_min)/x_dimension) * (width - (height/100.) *2.* svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) + << "\" y1=\"" << static_cast(0.5+ ((cell->face(faceIndex)->vertex(0)[1] - y_min)/y_dimension) * (height - (height/100.) *2.* svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) + << "\" x2=\"" << static_cast(0.5+ ((cell->face(faceIndex)->vertex(1)[0] - x_min)/x_dimension) * (width - (height/100.) *2.* svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) + << "\" y2=\"" << static_cast(0.5+ ((cell->face(faceIndex)->vertex(1)[1] - y_min)/y_dimension) * (height - (height/100.) *2.* svg_flags.margin_in_percent) + ((height/100.) * svg_flags.margin_in_percent)) << "\"/>" << '\n'; } @@ -1711,7 +1740,11 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const } //------------------ draw the legend - if (svg_flags.draw_legend && (svg_flags.label_level_number || svg_flags.label_cell_index || svg_flags.label_material_id || svg_flags.label_subdomain_id)) // || svg_flags.label_level_subdomain_id )) + if (svg_flags.draw_legend && + (svg_flags.label_level_number || + svg_flags.label_cell_index || + svg_flags.label_material_id || + svg_flags.label_subdomain_id)) // || svg_flags.label_level_subdomain_id )) { out << '\n'; @@ -1719,16 +1752,18 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const << '\n'; unsigned int additional_width = 0; - if (!svg_flags.margin_in_percent) additional_width = round((height/100.) * 2.5); + if (!svg_flags.margin_in_percent) additional_width = static_cast(0.5+ (height/100.) * 2.5); - out << " " + out << " (0.5+ (height/100.) * svg_flags.margin_in_percent) + << "\" width=\"" << static_cast(0.5+ (height/100.) * (40. - svg_flags.margin_in_percent)) + << "\" height=\"" << static_cast(0.5+ height*.2) << "\"/>" << '\n'; unsigned int line_offset = 0; - out << " (0.5+ (height/100.) * 1.25) + << "\" y=\"" << static_cast(0.5+ (height/100.) * svg_flags.margin_in_percent + (++line_offset) * 1.5 * font_size) << "\" style=\"text-anchor:start; font-weight:bold; font-size:" << font_size << "\">" << "cell label" @@ -1737,8 +1772,8 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const if (svg_flags.label_level_number) { - out << " (0.5+ (height/100.) * 2.) + << "\" y=\"" << static_cast(0.5+ (height/100.) * svg_flags.margin_in_percent + (++line_offset) * 1.5 * font_size) << "\" style=\"text-anchor:start; font-style:oblique; font-size:" << font_size << "\">" << "level_number"; @@ -1752,8 +1787,8 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const if (svg_flags.label_cell_index) { - out << " (0.5+ (height/100.) * 2.) + << "\" y=\"" << static_cast(0.5+ (height/100.) * svg_flags.margin_in_percent + (++line_offset) * 1.5 * font_size ) << "\" style=\"text-anchor:start; font-style:oblique; font-size:" << font_size << "\">" << "cell_index"; @@ -1767,8 +1802,8 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const if (svg_flags.label_material_id) { - out << " (0.5+ (height/100.) * 2.) + << "\" y=\"" << static_cast(0.5+ (height/100.) * svg_flags.margin_in_percent + (++line_offset) * 1.5 * font_size ) << "\" style=\"text-anchor:start; font-style:oblique; font-size:" << font_size << "\">" << "material_id"; @@ -1782,8 +1817,8 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const if (svg_flags.label_subdomain_id) { - out << " (0.5+ (height/100.) * 2.) + << "\" y=\"" << static_cast(0.5+ (height/100.) * svg_flags.margin_in_percent + (++line_offset) * 1.5 * font_size ) << "\" style=\"text-anchor:start; font-style:oblique; font-size:" << font_size << "\">" << "subdomain_id"; @@ -1797,8 +1832,8 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const /* if(svg_flags.label_level_subdomain_id) { - out << " (0.5+ (height/100.) * 2.) + << "\" y=\"" << static_cast(0.5+ (height/100.) * svg_flags.margin_in_percent + (++line_offset) * 1.5 * font_size ) << "\" style=\"text-anchor:start; font-style:oblique; font-size:" << font_size << "\">" << "level_subdomain_id" @@ -1816,12 +1851,12 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const << '\n'; unsigned int additional_width = 0; - if (!svg_flags.margin_in_percent) additional_width = round((height/100.) * 2.5); + if (!svg_flags.margin_in_percent) additional_width = static_cast(0.5+ (height/100.) * 2.5); unsigned int n = 0; out << " (0.5+ (height/100.) * (svg_flags.margin_in_percent+27.5) - (font_size/1.25)) << "\" style=\"text-anchor:start; font-weight:bold; font-size:" << font_size << "\">"; switch (svg_flags.coloring) @@ -1844,7 +1879,7 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const << '\n'; unsigned int element_height = floor(((height/100.) * (72.5 - 2.*svg_flags.margin_in_percent)) / n); - unsigned int element_width = round((height/100.) * 2.5); + unsigned int element_width = static_cast(0.5+ (height/100.) * 2.5); int labeling_index = 0; @@ -1868,18 +1903,18 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const out << " (0.5+ (height/100.) * (svg_flags.margin_in_percent + 27.5)) + (n-index-1) * element_height << "\" width=\"" << element_width << "\" height=\"" << element_height << "\"/>" << '\n'; unsigned int additional_width = 0; - if (!svg_flags.margin_in_percent) additional_width = round((height/100.) * 2.5); + if (!svg_flags.margin_in_percent) additional_width = static_cast(0.5+ (height/100.) * 2.5); out << " (0.5+ (height/100.) * (svg_flags.margin_in_percent + 27.5)) + (n-index-1 + .5) * element_height + static_cast(0.5+ font_size * .35) << "\"" + << " style=\"text-anchor:start; font-size:" << static_cast(0.5+ font_size); if (index == 0 || index == n-1) out << "; font-weight:bold";