Skip to content

Latest commit

 

History

History
76 lines (49 loc) · 4.55 KB

README.md

File metadata and controls

76 lines (49 loc) · 4.55 KB

Web version of GLVis

The index.html page in this directory contains a fully-featured web version of GLVis, also available at https://glvis.org/live. This web version enables GLVis capabilities on any machine with a modern browser, and is also fully supported on mobile touch devices, such as tablets and phones.

Interaction and help

The web version of GLVis support virtually all features of the desktop client, including key commands, mouse interactions, socket connections, and adds touch support for mobile devices.

Additional functionality is available via several buttons that appear when hovering at the top of the screen. These buttons are (from top left to top right):

  • Load local file
  • Connect to socket
  • Help
  • Examples
  • Visualization controls
  • Fullscreen mode

In addition to the Help button, help is accessible via the h key.

Loading local and external files

The web version of GLVis can be used to load local files in the glvis*.saved format, which can be generated by the -save option of the desktop version. See the Load local file button in the upper left of the index.html page and https://glvis.org/live. This is analogous to the -saved option of the desktop version and can be used as an for ./glvis –m mesh –g gf.

The web version of GLVis can also load local or remote streams by directly parsing the stream HTML argument in the format: <site>/live?stream=<url>, which can be used for hosting and presenting simulation data on the web.

For example, https://glvis.org/live?stream=https://glvis.org/data/streams/ex9.saved will fetch ex9.saved from glvis.org and render it instead of the normal quad.saved on startup. The same can be done with data from an external site or if you're hosting locally after running make serve: https://localhost:8000/live?stream=https://glvis.org/data/streams/ex9.saved.

Loading streams from MFEM

Just like the desktop version, the web version of GLVis can also be used to view MFEM visualization streams via the ../glvis-browser-server script, which forwards MFEM streams to the index.html page or https://glvis.org/live using websockets. This can be used as an alternative to running a local server with ./glvis,

The connection is established in the Connect to socket button of the web version (in the upper left), which has controls for connecting to and disconnecting from a glvis-browser-server. To pause/resume a stream (e.g. in from a time-dependent MFEM simulation) press space or double-tap on mobile. The speed of the animation can be adjusted with a slider under Visualization controls / Animation. Socket connection can also be established from mobile devices when the web version is run locally with make serve.

Example usages:

  1. cd glvis-js && ./glvis-browser-server

    • Requires Python 3.6.1+ and websockets (installable with pip).
    • Assumes default MFEM port of 19916.
  2. Visit https://glvis.org/live or open glvis-js/live in a browser

  3. Open the Setup menu and click the Connect to socket button

    • Default host and websocket port are localhost:8080.
    • You can also use {hostname}:8080 if you are connecting from another device on your network.
    • Press space (or double-tap on mobile) to pause the stream or, in the case that a pause message was sent, resume the stream.
    • Does not currently work in Safari from https://glvis.org/live (seems to require a secure websocket).
  4. cd mfem/examples && ./ex9 in a separate terminal

  5. Ctrl-c to stop glvis-browser-server

Examples and visualization controls

A number of pre-defined example streams are included in the https://glvis.org/live page. See the Examples button in the upper right. These include the results of several MFEM examples and miniapps which are also linked from their corresponding images at https://mfem.org/examples.

Next to Examples is the Visualization controls button that provides a touch-friendly interface to some of the most used GLVis key commands. Note the Redraw button at the bottom of the Visualization controls list, which can be useful to redraw the visualization scene.

Fullscreen mode

In the upper right corner of the web version there is a button for expanding to fullscreen. Follow your browsers instructions, press the fullscreen button, or use the esc key to exit.

Note: Fullscreen mode does not currently work in Safari.