Example codes
and tutorials
The (Not-so) Quick Guide
List of tutorials/demo codes
Single-Physics Problems
Poisson
Adaptivity illustrated for Poisson
Advection-Diffusion
Unsteady heat equation
Linear wave equation
The Young-Laplace equation
Navier-Stokes
Free-surface Navier-Stokes
Axisymmetric Navier-Stokes
Solid mechanics
Beam structures
Shell structures
Multi-physics Problems
Fluid-structure interaction
Boussinesq convection
Steady thermoelasticity
Methods-based example codes and tutorials
Mesh generation
Linear solvers and preconditioners
Visualisation of the results
Parallel processing
How to write a new element
How to write a new refineable element
Default nonlinear solvers -- the sequence of action functions
...
Documentation
FE theory and top-down discussion of the data structure
The (Not-so) Quick Guide
Comprehensive bottom-up discussion of the data structure
List of available structured and unstructured meshes
Linear solvers and preconditioners
Visualisation of the results
Parallel processing
Coding conventions and C++ style
Creating documentation
Optimisation - robustness vs. "raw speed"
Linear vs. nonlinear problems
Storing shape functions
Changing the default "full" integration scheme
Disabling the ALE formulation of unsteady equations
C vs. C++ output
Different sparse assembly techniques and the STL memory pool
Publications
Publications
Talks
Journal publications
Theses
Picture show
Download
Copyright
Download/installation instructions
Download page
FAQ & Contact
FAQ
Change log
Bugs and other known problems
Completeness of the library & our "To-Do List"
Contact the developers
Get involved

 


Beta release!

Please note that the library has not been "officially" released. While we continue to work on the documentation, these web pages are likely to contain broken links and documents in draft form. Please send an email to

oomph-lib AT maths DOT man DOT ac DOT uk

if you wish to be informed of the library's "official" release.

Visualising oomph-lib's output files with Paraview

All of oomph-lib's existing elements implement the GeneralisedElement::output(...) functions, allowing the computed solution to be documented via a simple call to the Mesh::output(...) function, e.g.

// Open output file
ofstream output_file("output.dat")

// Call the mesh's output function which loops over the 
// element and calls theirs...
Problem::mesh_pt()->output(output_file);

By default, the output is written in a format that is suitable for displaying the data with tecplot, a powerful and easy-to-use commercial plotting package -- possibly a somewhat odd choice for a an open-source library.

The FAQ contain an entry that discusses how to display oomph-lib's output with gnuplot and how to adjust oomph-lib's output functions to different formats.

Angelo Simone has written a python script that converts oomph-lib's output to the vtu format that can be read by paraview, an open-source 3D plotting package. The conversion script can currently deal with output from meshes that are composed of 2D quad elements -- the extension to 3D is work in progress.

The oomph-lib distribution contains three scripts:



The oomph-convert.py script for single files

An example session

  1. Add oomph-lib's bin directory to your path (in the example shown here, oomph-lib is installed in the directory /home/mheil/version185/oomph):

       biowulf: 10:31:50$ PATH=$PATH:/home/mheil/version185/oomph/bin
    

  2. Here is what's in the current directory at the moment: soln0.dat is the oomph-lib output produced by the adaptive solution of a Poisson equation in a fish-shaped domain.

       biowulf: 11:05:10$ ll
       total 824
       -rw-r--r--    1 mheil    users        2292 May 21 09:19 soln0.dat
    

  3. Run oomph-convert.py

        biowulf: 11:16:18$  oomph-convert soln0.dat
    
        -- Processing soln0.dat
     oomph-convert.py, ver. 20080514
        Convert from oomph-lib Tecplot format to VTK XML format.
        Dimension of the problem: 2
        Plot cells defined
        Field variables =  1
        Conversion started
        Coordinate defined
        Connectivities defined
        Offset defined
        Element types defined
        Field data defined
        Conversion done
     Output file name: soln0.vtu
    

  4. We now have the corresponding * .vtu file

       biowulf: 11:32:08$ ll
       total 1024
       -rw-r--r--    1 mheil    users      329874 May 21 09:19 soln0.dat
       -rw-r--r--    1 mheil    users      705294 May 21 11:16 soln0.vtu
    

  5. ...which we can visualise with paraview:

       biowulf: 11:34:08$ paraview --data=soln0.vtu
    



Screenshots from the paraview session

Here are a few screenshots from a paraview session, to get you started. When paraview starts up you see the following screen:

paraview1.gif

Select the "Display" tab...

paraview1_select.gif

...and make the data visible:

paraview2_select.gif

Now choose to colour the plot by the first (and, in the present example, only) variable to obtain a contour plot of the solution.

paraview3_select.gif

Switching to a wireframe representation shows the underlying mesh (each element is represented as a 5x5 sub-grid).

paraview4_select.gif



The oomph-convert and makePvd scripts for multiple files and animations

An example session

Here is a quick demonstration of oomph-convert and makePvd scripts in action

  1. Add oomph-lib's bin directory to your path (in the example shown here, oomph-lib is installed in the directory /home/mheil/version185/oomph):

       biowulf: 10:31:50$ PATH=$PATH:/home/mheil/version185/oomph/bin
    

  2. Here is what's in the current directory at the moment: soln?. dat are the oomph-lib output files that illustrate the progress of the mesh adaptation during the adaptive solution of a Poisson equation in a fish-shaped domain.

       biowulf: 11:05:10$ ll
       total 824
       -rw-r--r--    1 mheil    users        2292 May 21 09:19 soln0.dat
       -rw-r--r--    1 mheil    users      176776 May 21 09:19 soln1.dat
       -rw-r--r--    1 mheil    users      278117 May 21 09:19 soln2.dat
       -rw-r--r--    1 mheil    users      367408 May 21 09:19 soln3.dat
    

  3. Run oomph-convert on all files (the -z option adds zeroes to the numbers -- this is only required if the files are to combined into an animation by paraview)

       biowulf: 11:16:13$ oomph-convert -z soln*.dat
    
    
       -- Processing soln0.dat
     oomph-convert.py, ver. 20080514
       Convert from oomph-lib Tecplot format to VTK XML format.
       Dimension of the problem: 2
       Plot cells defined
       Field variables =  1
       Conversion started
       Coordinate defined
       Connectivities defined
       Offset defined
       Element types defined
       Field data defined
       Conversion done
     Output file name: soln00000.vtu
    
       -- Processing soln1.dat
     oomph-convert.py, ver. 20080514
       Convert from oomph-lib Tecplot format to VTK XML format.
       Dimension of the problem: 2
       Plot cells defined
       Field variables =  1
       Conversion started
       Coordinate defined
       Connectivities defined
       Offset defined
       Element types defined
       Field data defined
       Conversion done
     Output file name: soln00001.vtu
    
    
    
       [further output suppressed]
    

  4. We now have the corresponding * .vtu files

       biowulf: 12:37:05$ ll
       total 2568
       -rw-r--r--    1 mheil    users        5979 May 21 12:37 soln00000.vtu
       -rw-r--r--    1 mheil    users      377490 May 21 12:37 soln00001.vtu
       -rw-r--r--    1 mheil    users      592990 May 21 12:37 soln00002.vtu
       -rw-r--r--    1 mheil    users      789325 May 21 12:37 soln00003.vtu
       -rw-r--r--    1 mheil    users        2292 May 21 09:19 soln0.dat
       -rw-r--r--    1 mheil    users      176776 May 21 09:19 soln1.dat
       -rw-r--r--    1 mheil    users      278117 May 21 09:19 soln2.dat
       -rw-r--r--    1 mheil    users      367408 May 21 09:19 soln3.dat
    

    These * .vtu files can be displayed individually as discussed above.

  5. To produce an animation of the results with paraview, create a * .pvd file using makePvd

       biowulf: 12:40:56$ makePvd soln mysoln.pvd
       --> File mysoln.pvd created
    


  6. ...and visualise it:

       biowulf: 12:42:08$ paraview --data=mysoln.pvd  
    


Screenshots from the paraview session

Here's a screenshot from the paraview session: Once the * .pvd file is loaded you can customise the plot style as discussed in the previous example, and then use the "play/stop/..." buttons to animate the progress of the mesh adaptation.

paraview_animation_select.gif

Paraview allows you to save the animation in an avi file. However, note that the file cannot be displayed with xanim. mplayer seems to do the trick, though. Try it by downloading this animation.



PDF file

A pdf version of this document is available.
Generated on Mon Aug 10 11:48:54 2009 by  doxygen 1.4.7