Visualize_RD module

Visualize_RD.main()

Main function to execute the particle deposition visualization script.

This script visualizes the process of particle deposition based on the data from a substrate simulation. It generates a video showing the evolution of the deposition over time. The script offers several command-line options to customize the visualization, such as showing the top envelope, the average height, and adjusting the video playback rate.

Options:

-f, --file

: Required. Path to the substrate file containing simulation data.

-t, --title

: Optional. Title of the plot. If not provided, no title is displayed.

-r, --rate

: Optional. Frame rate for the video. Default is 4 frames per second.

-e, --envelop

: Optional. Flag to display the top envelope of the deposition. Default is False.

-a, --average

: Optional. Flag to display the average height of the deposition. Default is False.

-p, --play

: Optional. Flag to automatically play the video after generation. Default is False.

Example:

> python3 Visualize_RD.py -f substrate.txt -t "Simulation Title" -r 10 --envelop --average --play

This command will run the script on ‘substrate.txt’, set a title, use a frame rate of 10 fps, and display both the top envelope and average height in the visualization.

Visualize_RD.visualize_simulation(filename, plot_title, rate, envelop, show_average)

Visualize the particle deposition simulation and generate a video.

This function loads the substrate data from a file and visualizes the deposition process as an animation. It supports visualizing the top envelope and average height of the deposited particles. The final output is saved as an mp4 video file.

Parameters:
  • filename (str) – The path to the substrate data file.

  • plot_title (str) – The title of the plot.

  • rate (int) – The frame rate for the video.

  • envelop (bool) – Flag to indicate whether to show the top envelope.

  • show_average (bool) – Flag to indicate whether to show the average height.

Returns:

The filename of the generated mp4 video.

Return type:

str