From: bangerth Date: Tue, 16 Aug 2011 13:58:12 +0000 (+0000) Subject: Use VTK instead of the now outdated GMV format. Discuss visualization a bit more... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4f3560a60ef7d14dcfc922d58b3f65815e75c54;p=dealii-svn.git Use VTK instead of the now outdated GMV format. Discuss visualization a bit more and re-generate the pictures. git-svn-id: https://svn.dealii.org/trunk@24093 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-4/doc/results.dox b/deal.II/examples/step-4/doc/results.dox index 803455246d..c76ae08055 100644 --- a/deal.II/examples/step-4/doc/results.dox +++ b/deal.II/examples/step-4/doc/results.dox @@ -23,34 +23,25 @@ much higher. What cannot be seen here, is that besides this higher number of rows and columns in the matrix, there are also significantly more entries per row of the matrix in three space dimensions. Together, this leads to a much higher numerical effort for -solving the system of equation, which you can feel when you actually -run the program. +solving the system of equation, which you can feel in the run time of the two +solution steps when you actually run the program. -The program produces two files: solution-2d.gmv and -solution-3d.gmv, which can be viewed using the program -GMV (in case you do not have that program, you can easily change the +The program produces two files: solution-2d.vtk and +solution-3d.vtk, which can be viewed using the programs +Visit or Paraview (in case you do not have these programs, you can easily +change the output format in the program to something which you can view more -easily). From the two-dimensional output, we have produced the -following two pictures: +easily). Visualizing solutions is a bit of an art, but it can also be fun, so +you should play around with your favorite visualization tool to get familiar +with its functionality. Here's what I have come up with for the 2d solution: +

+ @image html step-4.solution-2d.png +

- - - - - - - -
- @image html step-4.solution-2d.png - - @image html step-4.grid-2d.png -
- - -The left one shows the solution of the problem under consideration as +The picture shows the solution of the problem under consideration as a 3D plot. As can be seen, the solution is almost flat in the interior of the domain and has a higher curvature near the boundary. This, of course, is due to the fact that for Laplace's equation the curvature @@ -62,21 +53,19 @@ the domain, where also the solution is moving most rapidly. It is also nice to see that the solution follows the desired quadratic boundary values along the boundaries of the domain. +On the other hand, even though the picture does not show the mesh lines +explicitly, you can see them as little kinks in the solution. This clearly +indicates that the solution hasn't been computed to very high accuracy and +that to get a better solution, we may have to compute on a finer mesh. - -The right picture shows the two dimensional grid, colorized by the -values of the solution function. This is not very exciting, but the -colors are nice. - - - - -In three spatial dimensions, visualization is a bit more difficult. To -the left, you can see the solution at three of the six outer faces of -the cube in which we solved the equation, and on a plane through the -origin. On some of the planes, the cut through the grid is also shown. - - +In three spatial dimensions, visualization is a bit more difficult. The left +picture shows the solution and the mesh it was computed on on the surface of +the domain. This is nice, but it has the drawback that it completely hides +what is happening on the inside. The picture on the right is an attempt at +visualizing the interior as well, by showing surfaces where the solution has +constant values (as indicated by the legend at the top left). Isosurface +pictures look best if one makes the individual surfaces slightly transparaent +so that it is possible to see through them and see what's behind. @@ -85,17 +74,27 @@ origin. On some of the planes, the cut through the grid is also shown.
- @image html step-4.grid-3d.png + @image html step-4.contours-3d.png
- - -The right picture shows the three dimensional grid, colorized by the -solutions values. 3D grids are difficult to visualize, which can be -seen here already, even though the grid is not even locally refined. - +@note +A final remark on visualization: The idea of visualization is to give insight, +which is not the same as displaying information. In particular, it is easy to +overload a picture with information, but while it shows more information it +makes it also more difficult to glean insight. As an example, the program I +used to generate these pictures, Visit, by default puts tick marks on every +axis, puts a big fat label "X Axis" on the $x$ axis and similar for the other +axes, shows the file name from which the data was taken in the top left and +the name of the user doing so and the time and date on the bottom right. None +of this is important +here: the axes are equally easy to make out because the tripod at the bottom +left is still visible, and we know from the program that the domain is +$[0,1]^3$, so there is no need for tick marks. As a consequence, I have +switched off all the extraneous stuff in the picture: The art of visualization +is to reduce the picture to those parts that are important to see what one +wants to see, but no more. diff --git a/deal.II/examples/step-4/doc/step-4.contours-3d.png b/deal.II/examples/step-4/doc/step-4.contours-3d.png new file mode 100644 index 0000000000..c358da900e Binary files /dev/null and b/deal.II/examples/step-4/doc/step-4.contours-3d.png differ diff --git a/deal.II/examples/step-4/doc/step-4.grid-2d.png b/deal.II/examples/step-4/doc/step-4.grid-2d.png deleted file mode 100644 index a0dc84efe6..0000000000 Binary files a/deal.II/examples/step-4/doc/step-4.grid-2d.png and /dev/null differ diff --git a/deal.II/examples/step-4/doc/step-4.grid-3d.png b/deal.II/examples/step-4/doc/step-4.grid-3d.png deleted file mode 100644 index 236a9efc9d..0000000000 Binary files a/deal.II/examples/step-4/doc/step-4.grid-3d.png and /dev/null differ diff --git a/deal.II/examples/step-4/doc/step-4.solution-2d.png b/deal.II/examples/step-4/doc/step-4.solution-2d.png index 003c8c01b0..d955432148 100644 Binary files a/deal.II/examples/step-4/doc/step-4.solution-2d.png and b/deal.II/examples/step-4/doc/step-4.solution-2d.png differ diff --git a/deal.II/examples/step-4/doc/step-4.solution-3d.png b/deal.II/examples/step-4/doc/step-4.solution-3d.png index 894980dee1..eb5d9aa6b4 100644 Binary files a/deal.II/examples/step-4/doc/step-4.solution-3d.png and b/deal.II/examples/step-4/doc/step-4.solution-3d.png differ diff --git a/deal.II/examples/step-4/step-4.cc b/deal.II/examples/step-4/step-4.cc index 8ef4990a50..c8ee7fedba 100644 --- a/deal.II/examples/step-4/step-4.cc +++ b/deal.II/examples/step-4/step-4.cc @@ -606,17 +606,16 @@ void Step4::solve () // // The only difference to the previous // example is that we want to write output in - // GMV format, rather than for gnuplot (GMV - // is another graphics program that, contrary - // to gnuplot, shows data in nice colors, - // allows rotation of geometries with the - // mouse, and generates reasonable - // representations of 3d data; for ways to - // obtain it see the ReadMe file of + // VTK format, rather than for gnuplot. VTK + // format is currently the most widely used + // one and is supported by a number of + // visualization programs such as Visit and + // Paraview (for ways to obtain these + // programs see the ReadMe file of // deal.II). To write data in this format, we // simply replace the - // data_out.write_gnuplot call by - // data_out.write_gmv. + // data_out.write_gnuplot call + // by data_out.write_vtk. // // Since the program will run both 2d and 3d // versions of the laplace solver, we use the @@ -637,9 +636,9 @@ void Step4::output_results () const data_out.build_patches (); std::ofstream output (dim == 2 ? - "solution-2d.gmv" : - "solution-3d.gmv"); - data_out.write_gmv (output); + "solution-2d.vtk" : + "solution-3d.vtk"); + data_out.write_vtk (output); }