Visualize_RD module¶
- Visualize_RD.Envelop(substrate)¶
Compute the top envelope of a substrate.
This function calculates the highest particle position in each column of the substrate. It is used to visualize the top envelope of the substrate in the simulation.
- Parameters
substrate (numpy.ndarray) – The substrate matrix to compute the envelop for.
- Returns
Array representing the top envelope of the substrate.
- Return type
numpy.ndarray
- 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.
The script is executed from the command line with various 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.
- -a, --average
: Optional. Flag to display the average height of the deposition.
- -p, --play
: Optional. Flag to automatically play the video after generation.
python script_name.py -f path/to/substrate.txt -t “Simulation Title” -r 10 –envelop –average
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.
By Le Chen (le.chen@auburn.edu, chenle02@gmail.com), 2023-10-22
- 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