Command-line Plotter

The EarthBox command-line plotter allows the user to build customized functions for plotting EarthBox output files. The standard way to use the EarthBox plotter involves creating a script called Plot.jl in a directory containing model input files and scripts. The Plot.jl script should contain a module called Plot with plotting functions, model output paths, material definition (for marker and yield plots) and a function that executes the plotter function run_cl_plotter. Paths and options are specified via command line with an option to directly pass the root path of the model output directory as a function argument to eliminate the need to write the full path via command line.

For more detailed information about available plotting functions that can be used with the command-line plotter see the following:

EarthBox.PlotToolsManager.ModelPlots2DManager.run_cl_plotterFunction
run_cl_plotter(;
    model_output_path::Union{String, Nothing}=nothing,
    root_path_output::Union{String, Nothing}=nothing,
    marker_plots_func::Function,
    scalar_plots_func::Function,
    velocity_plots_func::Function,
    stokes_convergence_plots_func::Function,
    yield_strength_plots_func::Function,
)::Nothing

EarthBox plot runner function that uses command line arguments. Run this function from a script that is executed via command line.

Arguments

  • model_output_path::Union{String, Nothing}:
    • Path to the model output directory containing the model output files. If not provided, then the model output path is defined using the case_name and the root_path or the model output path provided as a command-line argument.
  • root_path_output::Union{String, Nothing}:
    • Root path to the model output directory containing the model output files. If not provided, then the root path is defined using the command-line argument root_path=....
  • marker_plots_func::Function:
    • Function to plot markers.
  • scalar_plots_func::Function:
    • Function to plot scalars
  • velocity_plots_func::Function:
    • Function to plot velocity
  • stokes_convergence_plots_func::Function:
    • Function to plot Stokes convergence
  • yield_strength_plots_func::Function:
    • Function to plot yield strength
  • model_output_from_script_path::String:
    • Path to the model output directory sent from the script executing the plotter. This is used if the model output path is not specified in the command line arguments.

Usage

Assuming the run_cl_plotter function is called from a script called Plot.jl ...

To run the plotter with the full model output path specified via a command-line argument:

julia Plot.jl <plot_option_name> istart=<istart> iend=<iend> model_output_path=<model_output_path> 

To run the plotter with the modeloutputpath defined by case_name=<case_name> and root_path=<root_path> from command line arguments:

julia Plot.jl <plot_option_name> case_name=<case_name> root_path=<root_path> istart=<istart> iend=<iend>

To run plotter with model_output_path defined by case_name=<case_name> from command line and the parameter root_path_output:

julia Plot.jl <plot_option_name> case_name=<case_name> istart=<istart> iend=<iend>

where:

  • <plot_option_name>
    • The name of the plot option to use with the following options:
      • marker_plots: Plot the markers using the user defined function.
      • scalar_plots: Plot the scalars using the user defined function.
      • velocity_plots: Plot the velocity using the user defined function.
      • stokes_convergence_plots: Plot the Stokes convergence using the user defined function.
      • yield_strength_plots: Plot the yield strength using the user defined function.
  • case_name=<case_name>
    • The name of the model case to plot like case0, case1, case2, etc. If not provided, then the default case name is case0.
  • model_output_path=<model_output_path>
    • The path to the model output directory containing the model output files. If not provided, then the model output path is defined using the case_name and the root_path or a root path provided as an argument to the run_cl_plotter function.
  • root_path=<root_path>
    • The root path to the model output directory. This will be used along with the case_name to define the model output path if the model output path is not provided via command line and the root_path_output argument is not defined in the call to the command-line plotter (run_cl_plotter).
  • istart=<istart>
    • The starting time step. Default is 1.
  • iend=<iend>
    • The ending time step. If not provided, then the ending time step is set to the starting time step.

Examples

julia Plot.jl marker_plots istart=1 iend=100 model_output_path=/path/to/naliboff17_case0_output

or to use case_name=<case_name> and root_path=<root_path> to define the model output path, run:

julia Plot.jl marker_plots case_name=case0 root_path=/path/to/root_path istart=1 iend=100

or to use case_name=<case_name> and the parameter root_path_output to define the model output path, run:

julia Plot.jl marker_plots case_name=case0 istart=1 iend=100
source