sfepy.scripts.resview module¶
This is a script for quick VTK-based visualizations of finite element computations results.
In the examples below it is supposed that sfepy is installed. When using the
in-place build, replace sfepy-view
by python3 sfepy/scripts/resview.py
.
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:
sfepy-view 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:
sfepy-view 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:
sfepy-view 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:
sfepy-view output-tests/diffusion-poisson.vtk -o image.png
Take a screenshot without a window popping up:
sfepy-view output-tests/diffusion-poisson.vtk -o image.png --off-screen
Create animation from output-tests/diffusion-time_poisson.*.vtk:
sfepy-view 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:
sfepy-view output-tests/test_hyperelastic_TL.*.vtk -f u:wu:e:p0 mooney_rivlin_stress:p1 -a mov.mp4 -r 3
- class sfepy.scripts.resview.FieldOptsToListAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]¶
- separator = ':'¶
- class sfepy.scripts.resview.OptsToListAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]¶
- separator = '='¶
- class sfepy.scripts.resview.StoreNumberAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]¶
- sfepy.scripts.resview.get_camera_position(bounds, azimuth, elevation, distance=None, zoom=1.0)[source]¶
- sfepy.scripts.resview.pv_plot(filenames, options, plotter=None, step=None, annotations=None, scalar_bar_limits=None, ret_scalar_bar_limits=False, step_inc=None, use_cache=True)[source]¶