For this tutorial, we assume that you have a simulation running, and it is properly using the high-performance GPU on your system. Ideally, you have worked through or reviewed the previous tutorials.
For image output, open the “Outputs: Animations & Images” Panel:
From this Panel, the user can write a single jpg to file, an animated gif, or a time stack of jpg images. All files will be saved to the browsers Downloads directory. For the animated gif and jpg time stack, the user can specify the time in between the frames / images. For all of these visualizations, the saved images will match those displayed in the web page. ***There are still some bugs to this feature. In particular, when the time between frames/images is small, sometimes frames are skipped. This is related to the asynchronous nature of javascript, where previous frames are not fully retrieved/written before the next frame is sought.
For raw (binary) data output, open the “Output: Raw Model Data” Panel:
The main purpose of this Panel is to allow the user to write 2D surface data to file – the types of files one would typically expect from a Boussinesq-type numerical model. There is an option to write a single 2D surface to file – here the model will write the chosen surface when the “Download Single 2D Surface Data) button is clicked. This is useful when limited data is desired, or when the bathy/topo or wave height surface data are wanted.
To write many 2D surfaces to file (i.e. a time stack of data), the user should specify the “Time interval” between the write-to-file calls, and which properties should be written to file. File writes are toggled on and off by using the “Start” and “Stop” buttons are the bottom of the Panel. ***There are still some bugs to this feature. In particular, when the time between write calls is small, sometimes writes are skipped. This is related to the asynchronous nature of javascript, where previous writes are not fully retrieved/written before the next write is sought.
The output for these options is a raw, unformatted binary format. Currently, the ability to use structured data files (i.e. netcdf) is limited within javascript, and so the relatively primitive output format is used here. An example of how to load the data is given in the Matlab script attached to this post.
Note that all file writes, whether images or raw data, will slow the simulation down. The slowdown will be a function of the write frequency and size of output files. This is an inherent limitation of the GPU-shader approach, where moving data from the GPU to the CPU for writes is a bottleneck.