- num_binsThe number of bins for the histograms
C++ Type:unsigned int
Description:The number of bins for the histograms
- vppThe VectorPostprocessor to compute histogram of
C++ Type:VectorPostprocessorName
Description:The VectorPostprocessor to compute histogram of
HistogramVectorPostprocessor
Short Description
Compute a histogram for each column of a VectorPostprocessor
Description
Used to compute the histogram for all columns of another VectorPostprocessor (VPP). The only inputs are the other VPP (vpp
) and the number of bins to use in the histogram (num_bins
).
This will actually generate three columns for each column in the original VPP:
column_name: The histogram data
column_name_lower: The lower bound for each bin
column_name_upper: The upper bound for each bin
Plotting
MOOSE comes with built-in plotting capabilities that can help plot the output of a HistogramVectorPostprocessor. These plotting capabilities are part of the Chigger
suite of visualization tools located in the moose/python
directory. To use them you must add the full path of your moose/python
directory to the environment variable called $PYTHONPATH
using something like:
export PYTHONPATH=/full/path/to/moose/python:$PYTHONPATH
Once that is completed a script such as the following will plot your data:
import matplotlib.pyplot as plt
import mooseutils
# Create Figure and Axes
figure = plt.figure(facecolor='white')
axes0 = figure.add_subplot(111)
# Read Postprocessor Data
data = mooseutils.PostprocessorReader('histogram_vector_postprocessor_out_histo_0001.csv')
# Grab upper and lower bin bounds
lower = data('value_lower')
upper = data('value_upper')
# Compute the midpoint and width of each bin
mid = (lower + upper) / 2.0
width = upper - lower
# Grab the data to be plotted
y = data('value')
# Plot everything
axes0.bar(mid, y, width=width)
# Show the plot and save it
plt.show()
figure.savefig("output.pdf")
Input Parameters
- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Description:The list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM.
- contains_complete_historyFalseSet this flag to indicate that the values in all vectors declared by this VPP represent a time history (e.g. with each invocation, new values are added and old values are never removed). This changes the output so that only a single file is output and updated with each invocation
Default:False
C++ Type:bool
Description:Set this flag to indicate that the values in all vectors declared by this VPP represent a time history (e.g. with each invocation, new values are added and old values are never removed). This changes the output so that only a single file is output and updated with each invocation
Optional Parameters
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Description:Set the enabled status of the MooseObject.
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
- outputsVector of output names were you would like to restrict the output of variables(s) associated with this object
C++ Type:std::vector
Description:Vector of output names were you would like to restrict the output of variables(s) associated with this object
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector
Description:Adds user-defined labels for accessing object parameters via control logic.
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- force_preauxFalseForces the GeneralUserObject to be executed in PREAUX
Default:False
C++ Type:bool
Description:Forces the GeneralUserObject to be executed in PREAUX