From eaa21a064c60e22e340d0f7620753a00fe662475 Mon Sep 17 00:00:00 2001 From: schrage Date: Fri, 18 Jun 1999 14:03:25 +0000 Subject: [PATCH] First check-in. General description of DataOut, formats ucd, gnuplot. git-svn-id: https://svn.dealii.org/trunk@1422 0785d39b-7218-0410-832d-ea1e28bc413d --- .../tutorial/chapter-1.elements/output.html | 298 ++++++++++++++++++ 1 file changed, 298 insertions(+) diff --git a/deal.II/doc/tutorial/chapter-1.elements/output.html b/deal.II/doc/tutorial/chapter-1.elements/output.html index e69de29bb2..a4a4862bbf 100644 --- a/deal.II/doc/tutorial/chapter-1.elements/output.html +++ b/deal.II/doc/tutorial/chapter-1.elements/output.html @@ -0,0 +1,298 @@ + + + + + +Data Output + + + + + + + + +

Data Output

+ +

Graphics Formats

+

+deal.II provides a class called DataOut +dealing with the output of grid and simulation data. It is fairly versatile +and handles a +number of different data formats. There are, however, some limitations +with regard to grouping of components and the degrees of freedom. +

+ +

+The graphics formats available are: +

+ + + +

Limitations of the DataOut class

+ +

+Grouping of components to vectors is not implemented, i.e. each +component must be written independent of the others. It is +also not possible to write the results of calculations on grids +with more or less than one degree of freedom per vertex. +

+ +

General description of the usage of +DataOut

+ +

+What exactly it is you need to do in order to make use of the +DataOut +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. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Usage of the DataOut class
Step + Function + Call +
1.Create an object of this class with the right dimension. + It takes no initialization parameters. + DataOut<dim> my_data_out; +
2. + Attach a DoFHandler + object to your DataOut + object. This DoFHandler + is used to extract geometry + data and the mapping between nodes and node values. + + void DataOut<dim>::attach_dof_handler(const DoFHandler<dim> &) + +
3. + Add data vectors to be written to a file. The second and third argument + are the name of the vector and its physical units. + + void DataOut<dim>::add_data_vector(const Vector<double> &data, + const string &name, const string & + units="<dimensionless>") + +
4. + Generate an ostream (and, normally, attach it to a file). + + ostream out; + +
5. + Write your data to this ostream. The second parameter denotes the + output format to be used. It must be one of ucd, gnuplot, + gnuplot_draft, + povray_mesh, eps, epsgrid, gmv. + void DataOut<dim>::write(ostream &out, const OutputFormat output_format) +
+ + + +

Unstructured Cell Data (ucd)

+ +

+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. +

+ +

Limitations of the ucd format

+

+Only node based data can be written, higher order elements are written +with their node values, not with interior or line values. This is +due to limitations in the present format. In this implementation +it is not possible to give model data since this is not widely supported. +It is possible to give cell data. +

+ +

Usage of the ucd format

+ +

+In order to write your data in ucd format you need to follow the +steps described above. +The data is written using void write(ostream &out,"ucd"). +

+ + +

Gnuplot data format

+ +

Understanding gnuplot data

+ +

+The gnuplot data format is a pure ASCII format where each line is +of the form
+x v1 v2 ...
+for one-dimensional data and
+x y v1 v2 ...
+for two-dimensional data.
+x and y denote the grid coordinates, +vi denote the vertex values. +

+ +

+A somewhat more elaborate description can be found in the +Gnuplot User's Guide (Postscript) +

+ +

Viewing gnuplot data

+ +

+In order to view a one-dimensional plot you use
+ +plot "filename" using 1:x
+where x denotes the number of the vertex you wish to plot. +

+ +

+In order to view your grid in two dimensions you should use
+ +set data style lines
+plot "filename"
+
+and to finally see your results
+ +set data style lines
+plot "filename" using 1:2:x +

+where again x denotes the number of the vertex +to be plotted. +

+ + +

Limitations of the gnuplot data format

+ +

The limitations of the gnuplot data format are already well described +in the + +DataOut class description: +

+
+

+This format is somewhat restricted to coninuous data and to finite elements of first order only. The reason for the first restriction is that it takes nodal values and can +therefore only work if a finite element has degrees of freedom in the vertices of each cell. This is not the case for discontinuous elements. The second restriction is only a +problem of quality of output: you actually can print quadratic or higher order elements using this style, but you will only see the contour of each cell with the bounding lines of +each cell being straight lines. You won't see the structure of the solution in the interior of a cell nor on the lines bounding it. +

+
+ +

The two different qualities of gnuplot output

+ +

The limitations mentioned above can to some extent be remedied, +and that is why there is also an option for high quality output. +For how this is done, we quote (again) the + +DataOut class description: +

+ +
+

+To remedy the abovementioned problems, the gnuplot "quality" format +was introduced. [...] gnuplot can handle tensor grids and +displays them quite nicely, +including hidden line removal. It can also handle more than one tensor grid, +then called a patch. The idea now is to describe each cell as a patch of +N x N points (in 2D). +For linear elements, 2 x 2 is sufficient, but for elements +of higher order you will want to use a higher number. The +write_gnuplot +function writes the data in this format and +the argument it takes is the number of subintervals it divides each cell into, + i.e. N-1. +

+

+This output routine also addresses the problem introduced with discontinuous +elements, since it takes its data locally from each cell and displays it as a +patch separately; it +therefore does not use continuity and gnuplot will also plot discontinuities +if there are any. +

+
+ + +

Usage of the gnuplot data format

+ +

+In order to write your data in gnuplot format you need to follow the +steps described above. +The data is written using +

+ + + +
+ + + + + + +
+
+Jan Schrage
+

+Last modified: $Date$ +

+ + -- 2.39.5