From: wolf Date: Wed, 23 Jun 1999 12:11:48 +0000 (+0000) Subject: Add a class GridOut that serves to simply output a triangulation without recourse... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=889b925b6eed9ceb78decd791acc0d1bf26aba32;p=dealii-svn.git Add a class GridOut that serves to simply output a triangulation without recourse to the DoFHandler and the DataOut that uses the latter. Also, many simplifications can be done if no data is lying around to be printed as well. Also remove the epsgrid output from the DataOut class that served the same purpose. git-svn-id: https://svn.dealii.org/trunk@1443 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/Attic/examples/dof/dof_test.cc b/deal.II/deal.II/Attic/examples/dof/dof_test.cc index e72b1a1b86..01ca12fe47 100644 --- a/deal.II/deal.II/Attic/examples/dof/dof_test.cc +++ b/deal.II/deal.II/Attic/examples/dof/dof_test.cc @@ -3,6 +3,7 @@ +#include #include #include #include @@ -345,7 +346,7 @@ void TestCases::run (ParameterHandler &prm) { cout << " Writing grid..." << endl; ofstream out((file_prefix + prm.get("Grid file")).c_str()); - tria->print_gnuplot (out); + GridOut::write_gnuplot (tria, out); diff --git a/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc b/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc index 4ae6049783..f4c91e08bc 100644 --- a/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc +++ b/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -629,7 +630,7 @@ void PoissonProblem::run (ParameterHandler &prm) { filename += "finest_mesh.gnuplot"; cout << " Writing finest grid to <" << filename << ">... " << endl; ofstream finest_mesh (filename.c_str()); - tria->print_gnuplot (finest_mesh); + GridOut::write_gnuplot (tria, finest_mesh); finest_mesh.close(); print_history (prm, refine_mode); diff --git a/deal.II/deal.II/Attic/examples/grid/grid_test.cc b/deal.II/deal.II/Attic/examples/grid/grid_test.cc index 9d4e2457d2..b4115cce06 100644 --- a/deal.II/deal.II/Attic/examples/grid/grid_test.cc +++ b/deal.II/deal.II/Attic/examples/grid/grid_test.cc @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -220,9 +221,13 @@ void test (const int test_case) { Ball ball; CurvedLine curved_line; if (test_case==2) - tria.set_boundary (&ball); - else - tria.set_boundary (&curved_line); + { + tria.set_boundary (0, ball); + tria.set_boundary (1, ball); + } else { + tria.set_boundary (0, curved_line); + tria.set_boundary (1, curved_line); + }; // refine once tria.begin_active()->set_refine_flag(); @@ -245,6 +250,8 @@ void test (const int test_case) { }; tria.set_boundary (0); + tria.set_boundary (1); + break; } @@ -287,7 +294,7 @@ void test (const int test_case) { filename += ('0'+test_case); ofstream out(filename.c_str()); - tria.print_gnuplot (out); + GridOut::write_gnuplot (tria, out); cout << " Total number of cells = " << tria.n_cells() << endl << " Total number of active cells = " << tria.n_active_cells() << endl; diff --git a/deal.II/deal.II/include/grid/grid_io.h b/deal.II/deal.II/include/grid/grid_io.h new file mode 100644 index 0000000000..eaa73fba91 --- /dev/null +++ b/deal.II/deal.II/include/grid/grid_io.h @@ -0,0 +1,149 @@ +/*---------------------------- grid_io.h ---------------------------*/ +/* $Id$ */ +#ifndef __grid_io_H +#define __grid_io_H +/*---------------------------- grid_io.h ---------------------------*/ + +#include +#include +#include + + + +/** + * This class provides a means to output a triangulation to a file in different + * formats. Presently provided are functions to write it in GNUPLOT and + * encapsulated postscript format. There are also function to dispatch to + * the different output functions based on a parameter given, e.g., through + * a parameter file, thus making user programs invariant of the number and + * names of the file formats implemented in this class. + * + * + * \subsection{GNUPLOT format} + * In GNUPLOT format, each cell is written as a sequence of lines. There is not + * much more to be said here since the actual representation as well as the + * viewing angle (for 3d plots) is done by GNUPLOT itself. + * + * One additional feature, however, is worth being mentioned: after each point + * denoting one of the end points of a line, the level of the respective cell + * is written. Therefore, if you let GNUPLOT draw a 2d grid as a 3d plot, you + * will see more refined cells being raised against cells with less refinement. + * Also, if you draw a cut through a 3d grid, you can extrude the refinement + * level in the direction orthogonal to the cut plane. + * + * + * \subsection{Encapsulated postscript format} + * In this format, each line of the triangulation is written separately. We + * scale the picture such that x-values range between zero and 300 and the y-range + * is scaled with the same factor. 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, + * which is a thin line relative to the extension of the picture of 300. + * + * + * @author Wolfgang Bangerth, 1999; postscript format based on an implementation by Stefan Nauber, 1999 + */ +class GridOut +{ + public: + /** + * Declaration of a name for each of the + * different output formats. + */ + enum OutputFormat { gnuplot, eps }; + + /** + * Write the triangulation in the + * gnuplot format. See the general + * documentation for a description + * of what happens here. + */ + template + static void write_gnuplot (const Triangulation &tria, + ostream &out); + + /** + * Write the triangulation in the + * encapsulated postscript format. See the + * general documentation for a description + * of what happens here. + */ + template + static void write_eps (const Triangulation &tria, + ostream &out); + + /** + * Write data and grid to #out# according + * to the given data format. This function + * simply calls the appropriate + * #write_*# function. + */ + template + static void write (const Triangulation &tria, + ostream &out, + const OutputFormat output_format); + + /** + * Provide a function which tells us which + * suffix with a given output format + * usually has. At present the following + * formats are defined: + * \begin{itemize} + * \item #gnuplot#: #.gnuplot# + * \item #eps#: #.eps#. + * \end{itemize} + * + * 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 string default_suffix (const OutputFormat output_format); + + /** + * Return the #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. + * + * 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 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. + */ + static string get_output_format_names (); + + + /** + * Exception + */ + DeclException0 (ExcInvalidState); + /** + * Exception + */ + DeclException0 (ExcIO); +}; + + + +/*---------------------------- grid_io.h ---------------------------*/ +/* end of #ifndef __grid_io_H */ +#endif +/*---------------------------- grid_io.h ---------------------------*/ diff --git a/deal.II/deal.II/include/grid/tria.h b/deal.II/deal.II/include/grid/tria.h index 3eff79189f..443edb5903 100644 --- a/deal.II/deal.II/include/grid/tria.h +++ b/deal.II/deal.II/include/grid/tria.h @@ -456,7 +456,7 @@ class TriaDimensionInfo<3> { * }; * // output the grid * ofstream out("grid.1"); - * tria.print_gnuplot (out); + * GridOut::write_gnuplot (tria, out); * }; * \end{verbatim} * @@ -2536,31 +2536,6 @@ class Triangulation /*@}*/ /*---------------------------------------*/ - - /** - * @name Input/Output functions - */ - /*@{*/ - /** - * Print the triangulation in GNUPLOT - * format to #out#. - */ - void print_gnuplot (ostream &) const; - - /** - * Print level #level# in GNUPLOT - * format to #out#. - */ - void print_gnuplot (ostream &, const unsigned int level) const; - - /** - * Print cell #cell# in GNUPLOT format - * to #out#. - */ - void print_gnuplot (ostream &, const active_cell_iterator &cell) const; - /*@} - */ - /** * @name Information about the triangulation @@ -2587,8 +2562,7 @@ class Triangulation unsigned int n_lines (const unsigned int level) const; /** - * Return total number of active lines, - * active or not. + * Return total number of active lines. * * Regarding the computational effort of * this function, the same applies as @@ -2598,7 +2572,7 @@ class Triangulation /** * Return total number of active lines, - * active or not on level #level#. + * on level #level#. * * Regarding the computational effort of * this function, the same applies as diff --git a/deal.II/deal.II/include/numerics/data_io.h b/deal.II/deal.II/include/numerics/data_io.h index 2fcea190ab..5c4abe6aca 100644 --- a/deal.II/deal.II/include/numerics/data_io.h +++ b/deal.II/deal.II/include/numerics/data_io.h @@ -299,11 +299,9 @@ class DataIn { * * \subsection{Encapsulated Postscript format} * - * There are two functions for generating encapsulated Postscript - * (EPS) without the need for another graphics tool. - * #write_epsgrid# writes just the 2d grid - This is obsolete and - * should be removed. The functionality is provided through #write_eps# - * and #EpsOutputData# now. + * There is a function for generating encapsulated Postscript + * (EPS) without the need for another graphics tool. This functionality + * is provided through #write_eps# and #EpsOutputData#. * #write_eps# can use one data vector for height information and one * cell vector for shading information. Control is done through an * object of class #EpsOutputData# as follows or by default. @@ -384,7 +382,7 @@ class DataOut { * Provide a data type specifying the * presently supported output formats. */ - enum OutputFormat { ucd, gnuplot, gnuplot_draft, povray_mesh, eps, epsgrid, gmv }; + enum OutputFormat { ucd, gnuplot, gnuplot_draft, povray_mesh, eps, gmv }; /** * Constructor @@ -486,12 +484,6 @@ class DataOut { void write_eps (ostream &out, const EpsOutputData &eod = EpsOutputData()) const; - /** - * Write grid in Encapsulated - * postscript format. - */ - void write_epsgrid (ostream &out) const; - /** * Write data and grid in GMV format. */ @@ -505,7 +497,8 @@ class DataOut { * * In case of gnuplot output, the * standard accuracy of 1 is - * chosen. */ + * chosen. + */ void write (ostream &out, const OutputFormat output_format) const; /** @@ -518,7 +511,7 @@ class DataOut { * \item #gnuplot# and #gnuplot_draft#: * #.gnuplot# * \item #povray_mesh#: #.pov# - * \item #eps# and #epsgrid#: #.eps# + * \item #eps#: #.eps# * \item #gmv#: #.gmv#. * \end{itemize} * @@ -549,7 +542,7 @@ class DataOut { * #ParameterHandler# class, use the * function #get_output_format_names ()#. */ - static OutputFormat parse_output_format (const string format_name); + static OutputFormat parse_output_format (const string &format_name); /** * Return a list of implemented output diff --git a/deal.II/deal.II/source/grid/grid_io.cc b/deal.II/deal.II/source/grid/grid_io.cc new file mode 100644 index 0000000000..a398d12677 --- /dev/null +++ b/deal.II/deal.II/source/grid/grid_io.cc @@ -0,0 +1,269 @@ +/* $Id$ */ + + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + + +template +void GridOut::write_gnuplot (const Triangulation &tria, + ostream &out) +{ + AssertThrow (out, ExcIO()); + + typename Triangulation::active_cell_iterator cell=tria.begin_active(); + const typename Triangulation::active_cell_iterator endc=tria.end(); + for (; cell!=endc; ++cell) + { + out << "# cell " << cell << endl; + + switch (dim) + { + case 1: + out << cell->vertex(0) << ' ' << cell->level() << endl + << cell->vertex(1) << ' ' << cell->level() << endl + << endl; + break; + + case 2: + out << cell->vertex(0) << ' ' << cell->level() << endl + << cell->vertex(1) << ' ' << cell->level() << endl + << cell->vertex(2) << ' ' << cell->level() << endl + << cell->vertex(3) << ' ' << cell->level() << endl + << cell->vertex(0) << ' ' << cell->level() << endl + << endl // double new line for gnuplot 3d plots + << endl; + break; + + case 3: + // front face + out << cell->vertex(0) << ' ' << cell->level() << endl + << cell->vertex(1) << ' ' << cell->level() << endl + << cell->vertex(2) << ' ' << cell->level() << endl + << cell->vertex(3) << ' ' << cell->level() << endl + << cell->vertex(0) << ' ' << cell->level() << endl + << endl; + // back face + out << cell->vertex(4) << ' ' << cell->level() << endl + << cell->vertex(5) << ' ' << cell->level() << endl + << cell->vertex(6) << ' ' << cell->level() << endl + << cell->vertex(7) << ' ' << cell->level() << endl + << cell->vertex(4) << ' ' << cell->level() << endl + << endl; + + // now for the four connecting lines + out << cell->vertex(0) << ' ' << cell->level() << endl + << cell->vertex(4) << ' ' << cell->level() << endl + << endl; + out << cell->vertex(1) << ' ' << cell->level() << endl + << cell->vertex(5) << ' ' << cell->level() << endl + << endl; + out << cell->vertex(2) << ' ' << cell->level() << endl + << cell->vertex(6) << ' ' << cell->level() << endl + << endl; + out << cell->vertex(3) << ' ' << cell->level() << endl + << cell->vertex(7) << ' ' << cell->level() << endl + << endl; + break; + }; + }; + + AssertThrow (out, ExcIO()); +}; + + + +template +void GridOut::write_eps (const Triangulation &tria, + ostream &out) +{ + Assert (false, ExcNotImplemented()); +}; + + + +#if deal_II_dimension == 2 + +template <> +void GridOut::write_eps (const Triangulation<2> &tria, + ostream &out) +{ + typedef list,Point<2> > > LineList; + + + AssertThrow (out, ExcIO()); + + // make up a list of lines by which + // we will construct the triangulation + LineList line_list; + Triangulation<2>::active_line_iterator line =tria.begin_active_line (); + Triangulation<2>::active_line_iterator endline=tria.end_line (); + + for (; line!=endline; ++line) + line_list.push_back (make_pair(line->vertex(0), + line->vertex(1))); + + // find out minimum and maximum x and + // y coordinates to compute offsets + // and scaling factors + double x_min = tria.begin_active_line()->vertex(0)(0); + double x_max = x_min; + double y_min = tria.begin_active_line()->vertex(0)(1); + double y_max = y_min; + + for (LineList::const_iterator line=line_list.begin(); + line!=line_list.end(); ++line) + { + x_min = min (x_min, line->first(0)); + x_min = min (x_min, line->second(0)); + + x_max = max (x_max, line->first(0)); + x_max = max (x_max, line->second(0)); + + y_min = min (y_min, line->first(1)); + y_min = min (y_min, line->second(1)); + + y_max = max (y_max, line->first(1)); + y_max = max (y_max, line->second(1)); + }; + + // scale in x-direction such that + // in the output 0 <= x <= 300. + // don't scale in y-direction to + // preserve the shape of the + // triangulation + const double scale = 300. / (x_max - x_min); + + + // now write preamble + if (true) + { + // block this to have local + // variables destroyed after + // use + time_t time1= time (0); + tm *time = localtime(&time1); + out << "%!PS-Adobe-2.0 EPSF-1.2" << endl + << "%%Title: deal.II Output" << endl + << "%%Creator: the deal.II library" << endl + << "%%Creation Date: " + << time->tm_year+1900 << "/" + << time->tm_mon+1 << "/" + << time->tm_mday << " - " + << time->tm_hour << ":" + << setw(2) << time->tm_min << ":" + << setw(2) << time->tm_sec << endl + << "%%BoundingBox: " + // lower left corner + << "0 0 " + // upper right corner + << "300 " << static_cast( (y_max-y_min) * scale ) + << endl; + + // define some abbreviations to keep + // the output small: + // m=move turtle to + // x=execute line stroke + out << "/m {moveto} bind def" << endl + << "/x {lineto stroke} bind def" << endl; + + out << "%%EndProlog" << endl + << endl; + + // set fine lines + out << "0.5 setlinewidth" << endl; + }; + + // now write the lines + const Point<2> offset(x_min, y_min); + + for (LineList::const_iterator line=line_list.begin(); + line!=line_list.end(); ++line) + out << (line->first - offset) * scale << " m " + << (line->second - offset) * scale << " x\n"; + + out << "showpage" << endl; + + AssertThrow (out, ExcIO()); +}; + +#endif + + + + +template +void GridOut::write (const Triangulation &tria, + ostream &out, + OutputFormat output_format) +{ + switch (output_format) + { + case gnuplot: + write_gnuplot (tria, out); + return; + + case eps: + write_eps (tria, out); + return; + }; + + Assert (false, ExcInternalError()); +}; + + + +string GridOut::default_suffix (const OutputFormat output_format) +{ + switch (output_format) + { + case gnuplot: + return ".gnuplot"; + + case eps: + return ".eps"; + + default: + Assert (false, ExcNotImplemented()); + return ""; + }; +}; + + + + +GridOut::OutputFormat +GridOut::parse_output_format (const string &format_name) { + if (format_name == "gnuplot") + return gnuplot; + + if (format_name == "eps") + return eps; + + AssertThrow (false, ExcInvalidState ()); + // return something weird + return OutputFormat(-1); +}; + + + +string GridOut::get_output_format_names () { + return "gnuplot|eps"; +}; + + + +// explicit instantiations +template void GridOut::write_gnuplot (const Triangulation &, ostream &); +//template void GridOut::write_eps (const Triangulation &, ostream &); +template void GridOut::write (const Triangulation &, ostream &, OutputFormat); diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index 5f26140bf3..eb26357849 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -3428,115 +3428,6 @@ unsigned int Triangulation::max_adjacent_cells () const { -template -void Triangulation::print_gnuplot (ostream &out) const { - for (unsigned int i=0; i -void Triangulation::print_gnuplot (ostream &out, const unsigned int level) const { - active_cell_iterator cell = begin_active (level), - endc = (level == levels.size()-1 ? - active_cell_iterator(end()) : - begin_active (level+1)); - - AssertThrow (out, ExcIO()); - - out << "#Active cells on level " << level - << ": " << n_active_cells (level) << endl; - for (; cell != endc; ++cell) - print_gnuplot (out, cell); - - AssertThrow (out, ExcIO()); -}; - - - -#if deal_II_dimension == 1 - -template <> -void Triangulation<1>::print_gnuplot (ostream &out, - const active_cell_iterator & cell) const { - AssertThrow (out, ExcIO()); - - out << cell->vertex(0) << ' ' << cell->level() << endl - << cell->vertex(1) << ' ' << cell->level() << endl - << endl; - - AssertThrow (out, ExcIO()); -}; - -#endif - - -#if deal_II_dimension == 2 - -template <> -void Triangulation<2>::print_gnuplot (ostream &out, - const active_cell_iterator & cell) const { - AssertThrow (out, ExcIO()); - - out << cell->vertex(0) << ' ' << cell->level() << endl - << cell->vertex(1) << ' ' << cell->level() << endl - << cell->vertex(2) << ' ' << cell->level() << endl - << cell->vertex(3) << ' ' << cell->level() << endl - << cell->vertex(0) << ' ' << cell->level() << endl - << endl // double new line for gnuplot 3d plots - << endl; - - AssertThrow (out, ExcIO()); -}; - -#endif - - -#if deal_II_dimension == 3 - -template <> -void Triangulation<3>::print_gnuplot (ostream &out, - const active_cell_iterator & cell) const { - AssertThrow (out, ExcIO()); - - // front face - out << cell->vertex(0) << ' ' << cell->level() << endl - << cell->vertex(1) << ' ' << cell->level() << endl - << cell->vertex(2) << ' ' << cell->level() << endl - << cell->vertex(3) << ' ' << cell->level() << endl - << cell->vertex(0) << ' ' << cell->level() << endl - << endl; - // back face - out << cell->vertex(4) << ' ' << cell->level() << endl - << cell->vertex(5) << ' ' << cell->level() << endl - << cell->vertex(6) << ' ' << cell->level() << endl - << cell->vertex(7) << ' ' << cell->level() << endl - << cell->vertex(4) << ' ' << cell->level() << endl - << endl; - - // now for the four connecting lines - out << cell->vertex(0) << ' ' << cell->level() << endl - << cell->vertex(4) << ' ' << cell->level() << endl - << endl; - out << cell->vertex(1) << ' ' << cell->level() << endl - << cell->vertex(5) << ' ' << cell->level() << endl - << endl; - out << cell->vertex(2) << ' ' << cell->level() << endl - << cell->vertex(6) << ' ' << cell->level() << endl - << endl; - out << cell->vertex(3) << ' ' << cell->level() << endl - << cell->vertex(7) << ' ' << cell->level() << endl - << endl; - - AssertThrow (out, ExcIO()); -}; - -#endif - - - - template template void Triangulation::refine (const Vector &criteria, diff --git a/deal.II/deal.II/source/numerics/data_io.cc b/deal.II/deal.II/source/numerics/data_io.cc index 87a36858a8..6ada277f82 100644 --- a/deal.II/deal.II/source/numerics/data_io.cc +++ b/deal.II/deal.II/source/numerics/data_io.cc @@ -1035,77 +1035,6 @@ void DataOut::write_povray_mesh (ostream &) const { #if deal_II_dimension == 2 -template <> -void DataOut<2>::write_epsgrid (ostream &out) const { - Assert (dofs != 0, ExcNoDoFHandlerSelected()); - - // write preamble - if (true) - { - // block this to have local - // variables destroyed after - // use - time_t time1= time (0); - tm *time = localtime(&time1); - out << "%!PS-Adobe-2.0 EPSF-1.2" << endl - << "%%Title: deal.II Output" << endl - << "%%Creator: the deal.II library" << endl - << "%%Creation Date: " - << time->tm_year+1900 << "/" - << time->tm_mon+1 << "/" - << time->tm_mday << " - " - << time->tm_hour << ":" - << setw(2) << time->tm_min << ":" - << setw(2) << time->tm_sec << endl - << "%%BoundingBox: 0 0 310 310" << endl; - }; - - // Get scaling factors for Bounding Box 310 x 310 - - DoFHandler<2>::active_cell_iterator cell; - DoFHandler<2>::active_cell_iterator endc = dofs->end(); - double x, y, xmin=0, xmax=0, ymin=0, ymax=0, scale, xofs, yofs; - int i; - - for (cell=dofs->begin_active(); cell!=endc; ++cell) - { - for (i=0; i<4; i++) - { - x=cell->vertex(i)(0); - y=cell->vertex(i)(1); - xmin = ( x < xmin ? x : xmin ); - xmax = ( x > xmax ? x : xmax ); - ymin = ( y < ymin ? y : ymin ); - ymax = ( y > ymax ? y : ymax ); - } - } - x = xmax - xmin; - y = ymax - ymin; - scale = 300 / (x > y ? x : y); - xofs = -(xmin*scale)+5; - yofs = -(ymin*scale)+5; - - for (cell=dofs->begin_active(); cell!=endc; ++cell) - { - out << (cell->vertex(0)(0))*scale+xofs << " " - << (cell->vertex(0)(1))*scale+yofs << " moveto " - << (cell->vertex(1)(0))*scale+xofs << " " - << (cell->vertex(1)(1))*scale+yofs << " lineto " - << (cell->vertex(2)(0))*scale+xofs << " " - << (cell->vertex(2)(1))*scale+yofs << " lineto " - << (cell->vertex(3)(0))*scale+xofs << " " - << (cell->vertex(3)(1))*scale+yofs << " lineto " - << (cell->vertex(0)(0))*scale+xofs << " " - << (cell->vertex(0)(1))*scale+yofs << " lineto " - << " closepath stroke" << endl; - }; - out << "showpage" << endl; - - AssertThrow (out, ExcIO()); -}; - - - template <> void DataOut<2>::write_eps (ostream &out, const EpsOutputData &eod) const { Assert (dofs != 0, ExcNoDoFHandlerSelected()); @@ -1361,14 +1290,6 @@ void DataOut<2>::write_eps (ostream &out, const EpsOutputData &eod) const { -template -void DataOut::write_epsgrid (ostream &/*out*/) const { - // this is for all other dimensions that - // are not explicitely specialized - Assert (false, ExcNotImplemented()); -}; - - template void DataOut::write_eps (ostream &, const EpsOutputData &) const{ @@ -1629,10 +1550,6 @@ void DataOut::write (ostream &out, write_eps(out); break; - case epsgrid: - write_epsgrid(out); - break; - case gmv: write_gmv (out); break; @@ -1660,7 +1577,6 @@ string DataOut::default_suffix (const OutputFormat output_format) return ".pov"; case eps: - case epsgrid: return ".eps"; case gmv: @@ -1676,7 +1592,7 @@ string DataOut::default_suffix (const OutputFormat output_format) template DataOut::OutputFormat -DataOut::parse_output_format (const string format_name) { +DataOut::parse_output_format (const string &format_name) { if (format_name == "ucd") return ucd; @@ -1692,19 +1608,19 @@ DataOut::parse_output_format (const string format_name) { if (format_name == "eps") return eps; - if (format_name == "epsgrid") - return epsgrid; - if (format_name == "gmv") return gmv; AssertThrow (false, ExcInvalidState ()); + + // return something invalid + return OutputFormat(-1); }; template string DataOut::get_output_format_names () { - return "ucd|gnuplot|gnuplot draft|povray mesh|eps|epsgrid|gmv"; + return "ucd|gnuplot|gnuplot draft|povray mesh|eps|gmv"; }; diff --git a/tests/big-tests/dof/dof_test.cc b/tests/big-tests/dof/dof_test.cc index e72b1a1b86..01ca12fe47 100644 --- a/tests/big-tests/dof/dof_test.cc +++ b/tests/big-tests/dof/dof_test.cc @@ -3,6 +3,7 @@ +#include #include #include #include @@ -345,7 +346,7 @@ void TestCases::run (ParameterHandler &prm) { cout << " Writing grid..." << endl; ofstream out((file_prefix + prm.get("Grid file")).c_str()); - tria->print_gnuplot (out); + GridOut::write_gnuplot (tria, out); diff --git a/tests/big-tests/error-estimation/error-estimation.cc b/tests/big-tests/error-estimation/error-estimation.cc index 4ae6049783..f4c91e08bc 100644 --- a/tests/big-tests/error-estimation/error-estimation.cc +++ b/tests/big-tests/error-estimation/error-estimation.cc @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -629,7 +630,7 @@ void PoissonProblem::run (ParameterHandler &prm) { filename += "finest_mesh.gnuplot"; cout << " Writing finest grid to <" << filename << ">... " << endl; ofstream finest_mesh (filename.c_str()); - tria->print_gnuplot (finest_mesh); + GridOut::write_gnuplot (tria, finest_mesh); finest_mesh.close(); print_history (prm, refine_mode); diff --git a/tests/big-tests/grid/grid_test.cc b/tests/big-tests/grid/grid_test.cc index 9d4e2457d2..b4115cce06 100644 --- a/tests/big-tests/grid/grid_test.cc +++ b/tests/big-tests/grid/grid_test.cc @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -220,9 +221,13 @@ void test (const int test_case) { Ball ball; CurvedLine curved_line; if (test_case==2) - tria.set_boundary (&ball); - else - tria.set_boundary (&curved_line); + { + tria.set_boundary (0, ball); + tria.set_boundary (1, ball); + } else { + tria.set_boundary (0, curved_line); + tria.set_boundary (1, curved_line); + }; // refine once tria.begin_active()->set_refine_flag(); @@ -245,6 +250,8 @@ void test (const int test_case) { }; tria.set_boundary (0); + tria.set_boundary (1); + break; } @@ -287,7 +294,7 @@ void test (const int test_case) { filename += ('0'+test_case); ofstream out(filename.c_str()); - tria.print_gnuplot (out); + GridOut::write_gnuplot (tria, out); cout << " Total number of cells = " << tria.n_cells() << endl << " Total number of active cells = " << tria.n_active_cells() << endl;