glvis icon indicating copy to clipboard operation
glvis copied to clipboard

Support time navigation

Open giraldeau opened this issue 10 months ago • 4 comments

When a simulation has multiple time steps, is it possible to navigate backward and forward in time? When pressing the space bar, the animation starts and I haven't seen in the doc or help a shortcut to control the playback.

Attached is an example of a saved session obtained by running the mfem ex10

glvis-saved.0001.zip

giraldeau avatar Feb 09 '25 05:02 giraldeau

The data from previous times steps is discarded when a new time step is received, so going back is not supported at this point.

One way to control the timestep updates is to enable the auto-pause mode by pressing ctrl+space before pressing space. In this mode pressing space advances one time step and auto-pauses. Pressing ctrl+space simply toggles the auto-pause mode.

v-dobrev avatar Feb 09 '25 07:02 v-dobrev

Time navigation will be a useful extension, but it will require new infrastructure and significantly more memory than the current approach (which essentially holds a single instance at a time).

When the data comes by socket, that memory can increase quite significantly... I am not sure we want to do that (ping @justinlaughlin).

tzanio avatar Feb 09 '25 17:02 tzanio

I agree that I don't think we'd want to support this by socket, but it would be a very sensible feature for saved data. I believe the *.sol file type does not have the option to store time-dependent fields (please correct me if I'm wrong). We could use a filename convention (eg velocity_1.sol, velocity_2.sol, etc) but that convention is already used for parallel output.

I think the proper way to implement this would be through something like hdf5; I searched through mfem briefly and see that there is maybe some support through sidre, but I'm not sure yet how robust this interface is. Of course we'd also need to write the interpreter on the GLVis side.

As a holdover solution - another possible option is to save the time-steps by filename and use pyglvis. The last block of example 9 has a time-dependent problem that is visualized with a python loop.

Edit: Actually, as I think about it a bit more, maybe it wouldn't be so bad to support this by socket for small problems; this could be kept at a manageable-level through a default memory limit.

justinlaughlin avatar Feb 10 '25 00:02 justinlaughlin

MFEM supports ParaView, VisIt and other (including Sidre) through DataCollection, where you enter the time level and time for every snapshot. I think it is a good idea to support those in general 👍 . In addition, we may then add some control to move between the levels.

najlkin avatar Feb 10 '25 17:02 najlkin