resview.py script¶
This is a script for quick VTK-based visualizations of finite element computations results.
Examples¶
The examples assume that
python -c "import sfepy; sfepy.test('--output-dir=output-tests')"
has been run successfully and the resulting data files are present.
View data in output-tests/test_navier_stokes.vtk:
$ python resview.py output-tests/navier_stokes-navier_stokes.vtk
Customize the above output: plot0: field “p”, switch on edges, plot1: field “u”, surface with opacity 0.4, glyphs scaled by factor 2e-2.
$ python resview.py output-tests/navier_stokes-navier_stokes.vtk -f p:e:p0 u:o.4:p1 u:g:f2e-2:p1
As above, but glyphs are scaled by the factor determined automatically as 20% of the minimum bounding box size.
$ python resview.py output-tests/navier_stokes-navier_stokes.vtk -f p:e:p0 u:o.4:p1 u:g:f10%:p1
View data and take a screenshot.
$ python resview.py output-tests/diffusion-poisson.vtk -o image.png
Take a screenshot without a window popping up.
$ python resview.py output-tests/diffusion-poisson.vtk -o image.png –off-screen
Create animation from output-tests/diffusion-time_poisson.*.vtk.
$ python resview.py output-tests/diffusion-time_poisson.*.vtk -a mov.mp4
Create animation from output-tests/test_hyperelastic.*.vtk, set frame rate to 3, plot displacements and mooney_rivlin_stress.
$ python resview.py output-tests/test_hyperelastic_TL.*.vtk -f u:wu:e:p0 mooney_rivlin_stress:p1 -a mov.mp4 -r 3
- class resview.FieldOptsToListAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]¶
- separator = ':'¶
- class resview.OptsToListAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]¶
- separator = '='¶
- class resview.StoreNumberAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]¶