From: schrage DataOut
are:
The graphics formats available in GridOut
are:
ostream
(and, normally, attach it to a file).
- ostream out;
+ ofstream out("filename");
ucd, gnuplot,
gnuplot_draft,
povray_mesh, eps, epsgrid, gmv
.
@@ -310,19 +313,70 @@ What exactly it is you need to do in order to make use of the
GridOut
class is described in the table below. Note that data is written to an
ostream
. That means you have to attach your ostream
-to a file if you want to use the data later on. Note also that all the
-methods are static. There is no need to create a
-GridOut
object.
+to a file if you want to use the data later on.
+
+
+
+There are essentially two ways to use GridOut
: If you don't need
+to change any of the default parameters (which will be explained along with
+the graphics formats) you can use the class almost as if its methods
+were static. There is no need to create a GridOut
object
+in advance.
+
+The second method requires the creation of a GridOut
object
+to which parameters can be passed.
Step | -Function + | What to do | -Call + | Function call + | +
1. | +Use the correct include-file. + | +#include <basic/grid_out.h>
+ |
+||
2. + | +Generate an ostream (and, normally, attach it to a file).
+ |
+
+ ofstream out("filename");
+
+ |
+||
3. + | +Write your data to the ofstream by calling the appropriate
+ write method giving your triangulation object and
+ the output file type as parameters. output_format
+ is one of {ucd,gnuplot, eps}.
+ |
+ void GridOut().write(const Triangulation<dim> & tria,ostream &out, const OutputFormat output_format) + |
+
Step + | +What to do + | +Function call | |
3. | -Write your data to this ostream by calling the appropriate + | Generate a GridOut<dim> object.
+ |
+ GridOut<dim> my_grid_out; + |
+
4. + | +Set your parameters (in this example for ucd). + | +GridOut::UcdFlags ucd_flags;
+ |
+|
5. + | +Write your data to the ostream by calling the appropriate
write method giving your triangulation object and
the output file type as parameters. output_format
- is one of {gnuplot, eps}.
+ is one of {ucd,gnuplot, eps}.
|
- void GridOut<dim>::write(const Triangulation<dim> & tria,ostream &out, cont OutputFormat output_format) + | void my_grid_out.write(const Triangulation<dim> & tria,ostream &out, const OutputFormat output_format) |
GridOut
data formats+The ucd data format is described in the AVS developer's guide. There +are a binary and a ASCII version of this format. deal.II +uses the ASCII ucd format. +
+ +
+The ucd data format is special because it can not only be written but
+also read by deal.II. I.e. you can use a triangulation
+written to a ucd-file as a starting triangulation for
+deal.II. In order to be able to reuse your triangulation
+you will need to explicitly write all of your boundary indicators that
+are not zero to the output file. Otherwise, upon reloading the triangulation,
+all your boundaries will be labelled with the default value, zero.
+There is a flag controlling GridOut
with respect to whether
+boundary indicators are explicitly written:
+bool GridOut::UcdFlags::write_preamble
. It defaults to true, i.e.
+boundary indicators are written by default and you can use the first,
+simpler method for writing ucd-files.
+
+
++
+ + +