SWE

Main Class for Importing Simulation

To use this class, please first import the class with

from SWELib import SWE

SWE.simulation

Method to import simulation resulted by SimulWave.

swe = SWE()
swe.simulation(dir, chunked)

Parameters

  • dir: string

    directory of the simulation result file

  • chunked: boolean (optional)

    `TRUE` if simulation result is chunked

Returns

  • void


NOTES: From here to below, make sure to import the simulation first like in the example above SWE.simulation. From here on we'll be using 'swe.**' with imported simulation.


SWE.get_eta

Method to get wave amplitude.

swe.get_eta()

Parameters

  • void

Returns

  • res: number[][]

    2D or 3D array (according to simulation type done) of wave amplitude

SWE.get_computational_domain

Method to get simulation computational domain.

swe.get_computational_domain()

Parameters

  • void

Returns

  • res: dictionary

    dictionary of simulation computional domain

SWE.generate_animation

swe.generate_animation(y_lim, nt)

Parameters

  • y_lim: integer[]

    an array of integer that defined the interval of y axis (ex: [-1, 10])

  • nt: integer

    number of animation frame

Returns

  • res: matplotlib.animation.figure

    a matplotlib animation figure

SWE.generate_animation_2d

swe.generate_animation_2d(plane, at, z_lim, nt)

Parameters

  • plane: 'xz' or 'yz'

    generated animation axis plane

  • at: float

    generated animation axis plane point

  • y_lim: integer[]

    an array of integer that defined the interval of y axis (ex: [-1, 10])

  • nt: integer

    number of animation frame

Returns

  • res: matplotlib.animation.figure

    a matplotlib animation figure

SWE.plot_across_spatial

swe.plot_across_spatial(t)

Parameters

  • t: float

    time to plot wave simulation across the spatial domain

Returns

  • res: matplotlib.figure

    a matplotlib figure

SWE.plot_across_spatial_2d

swe.plot_across_spatial_2d(plane, at, t)

Parameters

  • plane: 'xz' or 'yz'

    generated plot axis plane

  • at: float

    generated plot axis plane point

  • t: float

    time to plot wave simulation across the spatial domain

Returns

  • res: matplotlib.figure

    a matplotlib figure

SWE.plot_across_time

swe.plot_across_time(x)

Parameters

  • x: float

    point at x-axis to plot wave simulation across the time domain

Returns

  • res: matplotlib.figure

    a matplotlib figure

SWE.plot_across_time_2d

swe.plot_across_time_2d(x, y)

Parameters

  • x: float

    point at x axis to plot wave simulation across the time domain

  • y: float

    point at y axis to plot wave simulation across the time domain

Returns

  • res: matplotlib.figure

    a matplotlib figure

Last updated