# 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')

# 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

• vppThe VectorPostprocessor to compute histogram of

C++ Type:VectorPostprocessorName

Options:

Description:The VectorPostprocessor to compute histogram of

• num_binsThe number of bins for the histograms

C++ Type:unsigned int

Options:

Description:The number of bins for the histograms

### Required 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

Options:NONE INITIAL LINEAR NONLINEAR TIMESTEP_END TIMESTEP_BEGIN FINAL CUSTOM

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

Options:

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

Options:

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

Options:

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

Options:

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

Options:

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

Options:

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

Options:

Description:Forces the GeneralUserObject to be executed in PREAUX