# 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, deprecated=False)
  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, deprecated=False)
  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, deprecated=False)

sfepy.scripts.resview.add_mat_id_to_grid(grid, cell_groups)

sfepy.scripts.resview.ensure3d(arr)

sfepy.scripts.resview.get_camera_position(bounds, azimuth, elevation, distance=None, zoom=1.0)

sfepy.scripts.resview.get_nonzero_norm(arr, **kwargs)

sfepy.scripts.resview.main()

sfepy.scripts.resview.make_cells_from_conn(conns, convert_to_vtk_type)

sfepy.scripts.resview.make_glyphs(mesh, scalars_name=None, geom_name=None)

sfepy.scripts.resview.make_grid_from_mesh(mesh, add_mat_id=False)

sfepy.scripts.resview.make_title(filenames)

sfepy.scripts.resview.parse_options(opts, separator=':')

sfepy.scripts.resview.print_camera_position(plotter)

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)

sfepy.scripts.resview.read_mesh(filenames, step=None, print_info=True, ret_n_steps=False, use_cache=True)

sfepy.scripts.resview.read_probes_as_annotations(filenames, add_label=True)