This base class computes volume integrals of a variable storing partial sums for the specified number of intervals in a direction (x,y,z). More...
#include <LayeredBase.h>
Public Member Functions | |
LayeredBase (const InputParameters ¶meters) | |
virtual Real | integralValue (const Point &p) const |
Given a Point return the integral value associated with the layer that point falls in. More... | |
virtual Real | getLayerValue (unsigned int layer) const |
Get the value for a given layer. More... | |
virtual unsigned int | getLayer (const Point &p) const |
Helper function to return the layer the point lies in. More... | |
const std::vector< Real > & | getLayerCenters () const |
Get the center coordinates for the layers (along given direction) More... | |
unsigned int | direction () const |
Get direction of the layers. More... | |
virtual void | initialize () |
virtual void | finalize () |
virtual void | threadJoin (const UserObject &y) |
Static Public Member Functions | |
static InputParameters | validParams () |
Protected Member Functions | |
void | setLayerValue (unsigned int layer, Real value) |
Set the value for a particular layer. More... | |
bool | layerHasValue (unsigned int layer) const |
Whether or not a layer has a value. More... | |
void | getBounds () |
Compute bounds, restricted to blocks if given. More... | |
void | computeLayerCenters () |
Compute the center points for each layer. More... | |
Protected Attributes | |
std::string | _layered_base_name |
Name of this object. More... | |
const InputParameters & | _layered_base_params |
Params for this object. More... | |
MooseEnum | _direction_enum |
The MooseEnum direction the layers are going in. More... | |
unsigned int | _direction |
The component direction the layers are going in. We cache this for speed (so we're not always going through the MooseEnum) More... | |
bool | _interval_based |
Whether or not this object is based on equally spaced intervals or "bounds". More... | |
unsigned int | _num_layers |
Number of layers to split the mesh into. More... | |
std::vector< Real > | _layer_bounds |
The boundaries of the layers. More... | |
unsigned int | _sample_type |
How to sample the values. More... | |
unsigned int | _average_radius |
How many layers both above and below the found layer will be used in the average. More... | |
bool | _using_displaced_mesh |
true if this object operates on the displaced mesh, otherwise false More... | |
std::vector< Real > | _layer_centers |
center coordinates of each layer More... | |
Real | _direction_min |
Real | _direction_max |
std::vector< Real > & | _layer_values |
Value of the integral for each layer. More... | |
std::vector< int > & | _layer_has_value |
Whether or not each layer has had any value summed into it. More... | |
bool | _cumulative |
Whether the values are cumulative over the layers. More... | |
const bool | _positive_cumulative_direction |
Whether the cumulative values should be summed in the positive or negative direction. More... | |
Private Member Functions | |
template<typename T , typename... Args> | |
T & | declareRestartableData (const std::string &data_name, Args &&... args) |
Declare a piece of data as "restartable" and initialize it. More... | |
template<typename T , typename... Args> | |
ManagedValue< T > | declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args) |
Declares a piece of "managed" restartable data and initialize it. More... | |
template<typename T , typename... Args> | |
const T & | getRestartableData (const std::string &data_name) const |
Declare a piece of data as "restartable" and initialize it Similar to declareRestartableData but returns a const reference to the object. More... | |
template<typename T , typename... Args> | |
T & | declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args) |
Declare a piece of data as "restartable" and initialize it. More... | |
template<typename T , typename... Args> | |
T & | declareRecoverableData (const std::string &data_name, Args &&... args) |
Declare a piece of data as "recoverable" and initialize it. More... | |
template<typename T , typename... Args> | |
T & | declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args) |
Declare a piece of data as "restartable". More... | |
template<typename T , typename... Args> | |
T & | declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args) |
Declare a piece of data as "restartable". More... | |
std::string | restartableName (const std::string &data_name) const |
Gets the name of a piece of restartable data given a data name, adding the system name and object name prefix. More... | |
Private Attributes | |
SubProblem & | _layered_base_subproblem |
Subproblem for the child object. More... | |
std::vector< SubdomainID > | _layer_bounding_blocks |
List of SubdomainIDs, if given. More... | |
bool | _has_direction_max_min |
whether the max/min coordinate in the direction is known from user input More... | |
MooseApp & | _restartable_app |
Reference to the application. More... | |
const std::string | _restartable_system_name |
The system name this object is in. More... | |
const THREAD_ID | _restartable_tid |
The thread ID for this object. More... | |
const bool | _restartable_read_only |
Flag for toggling read only status (see ReporterData) More... | |
This base class computes volume integrals of a variable storing partial sums for the specified number of intervals in a direction (x,y,z).
Definition at line 36 of file LayeredBase.h.
LayeredBase::LayeredBase | ( | const InputParameters & | parameters | ) |
Definition at line 78 of file LayeredBase.C.
|
protected |
Compute the center points for each layer.
Definition at line 388 of file LayeredBase.C.
Referenced by LayeredBase().
|
protectedinherited |
Declares a piece of "managed" restartable data and initialize it.
Here, "managed" restartable data means that the caller can destruct this data upon destruction of the return value of this method. Therefore, this ManagedValue<T> wrapper should survive after the final calls to dataStore() for it. That is... at the very end.
This is needed for objects whose destruction ordering is important, and enables natural c++ destruction in reverse construction order of the object that declares it.
See delcareRestartableData and declareRestartableDataWithContext for more information.
Definition at line 276 of file Restartable.h.
|
protectedinherited |
Declare a piece of data as "recoverable" and initialize it.
This means that in the event of a restart this piece of data will be restored back to its previous value.
Note - this data will NOT be restored on Restart!
NOTE: This returns a reference! Make sure you store it in a reference!
data_name | The name of the data (usually just use the same name as the member variable) |
args | Arguments to forward to the constructor of the data |
Definition at line 351 of file Restartable.h.
|
protectedinherited |
Declare a piece of data as "restartable" and initialize it.
This means that in the event of a restart this piece of data will be restored back to its previous value.
NOTE: This returns a reference! Make sure you store it in a reference!
data_name | The name of the data (usually just use the same name as the member variable) |
args | Arguments to forward to the constructor of the data |
Definition at line 269 of file Restartable.h.
|
protectedinherited |
Declare a piece of data as "restartable" and initialize it.
This means that in the event of a restart this piece of data will be restored back to its previous value.
NOTE: This returns a reference! Make sure you store it in a reference!
data_name | The name of the data (usually just use the same name as the member variable) |
context | Context pointer that will be passed to the load and store functions |
args | Arguments to forward to the constructor of the data |
Definition at line 294 of file Restartable.h.
|
protectedinherited |
Declare a piece of data as "restartable".
This means that in the event of a restart this piece of data will be restored back to its previous value.
NOTE: This returns a reference! Make sure you store it in a reference!
data_name | The name of the data (usually just use the same name as the member variable) |
object_name | A supplied name for the object that is declaring this data. |
args | Arguments to forward to the constructor of the data |
Definition at line 323 of file Restartable.h.
|
protectedinherited |
Declare a piece of data as "restartable".
This means that in the event of a restart this piece of data will be restored back to its previous value.
NOTE: This returns a reference! Make sure you store it in a reference!
data_name | The name of the data (usually just use the same name as the member variable) |
object_name | A supplied name for the object that is declaring this data. |
context | Context pointer that will be passed to the load and store functions |
args | Arguments to forward to the constructor of the data |
Definition at line 333 of file Restartable.h.
|
inline |
Get direction of the layers.
Definition at line 73 of file LayeredBase.h.
|
virtual |
Reimplemented in FunctionLayeredIntegral, LayeredExtremumMaterialProperty, LayeredIntegralBase< UserObjectType >, LayeredIntegralBase< SideIntegralFunctorUserObject >, LayeredIntegralBase< SideIntegralVariableUserObject >, LayeredIntegralBase< ElementIntegralFunctorUserObject >, LayeredIntegralBase< BaseType >, LayeredIntegralBase< ElementIntegralVariableUserObject >, LayeredAverageBase< BaseType >, LayeredAverageBase< SideIntegralFunctorUserObject >, LayeredAverageBase< SideIntegralVariableUserObject >, LayeredAverageBase< ElementIntegralFunctorUserObject >, and LayeredAverageBase< ElementIntegralVariableUserObject >.
Definition at line 314 of file LayeredBase.C.
Referenced by LayeredIntegralBase< ElementIntegralVariableUserObject >::finalize(), and FunctionLayeredIntegral::finalize().
|
protected |
Compute bounds, restricted to blocks if given.
Definition at line 414 of file LayeredBase.C.
Referenced by initialize(), and LayeredBase().
|
virtual |
Helper function to return the layer the point lies in.
p | The point. |
Definition at line 348 of file LayeredBase.C.
Referenced by LayeredExtremumMaterialProperty::execute(), FunctionLayeredIntegral::execute(), and integralValue().
|
inline |
Get the center coordinates for the layers (along given direction)
Definition at line 67 of file LayeredBase.h.
Referenced by NearestPointBase< LayeredSideDiffusiveFluxAverage, SideIntegralVariableUserObject >::spatialPoints().
Get the value for a given layer.
layer | The layer index |
Definition at line 293 of file LayeredBase.C.
Referenced by LayeredExtremumMaterialProperty::execute(), FunctionLayeredIntegral::execute(), LayeredExtremumMaterialProperty::finalize(), finalize(), LayeredExtremumMaterialProperty::threadJoin(), and threadJoin().
|
protectedinherited |
Declare a piece of data as "restartable" and initialize it Similar to declareRestartableData
but returns a const reference to the object.
Forwarded arguments are not allowed in this case because we assume that the object is restarted and we won't need different constructors to initialize it.
NOTE: This returns a const reference! Make sure you store it in a const reference!
data_name | The name of the data (usually just use the same name as the member variable) |
Definition at line 287 of file Restartable.h.
|
virtual |
Reimplemented in FunctionLayeredIntegral, LayeredExtremumMaterialProperty, LayeredIntegralBase< UserObjectType >, LayeredIntegralBase< SideIntegralFunctorUserObject >, LayeredIntegralBase< SideIntegralVariableUserObject >, LayeredIntegralBase< ElementIntegralFunctorUserObject >, LayeredIntegralBase< BaseType >, LayeredIntegralBase< ElementIntegralVariableUserObject >, LayeredAverageBase< BaseType >, LayeredAverageBase< SideIntegralFunctorUserObject >, LayeredAverageBase< SideIntegralVariableUserObject >, LayeredAverageBase< ElementIntegralFunctorUserObject >, and LayeredAverageBase< ElementIntegralVariableUserObject >.
Definition at line 301 of file LayeredBase.C.
Referenced by LayeredIntegralBase< ElementIntegralVariableUserObject >::initialize(), LayeredExtremumMaterialProperty::initialize(), and FunctionLayeredIntegral::initialize().
|
virtual |
Given a Point return the integral value associated with the layer that point falls in.
p | The point to look for in the layers. |
Definition at line 182 of file LayeredBase.C.
Referenced by LayeredExtremumMaterialProperty::spatialValue(), LayeredIntegralBase< ElementIntegralVariableUserObject >::spatialValue(), and FunctionLayeredIntegral::spatialValue().
|
inlineprotected |
Whether or not a layer has a value.
Definition at line 90 of file LayeredBase.h.
|
protectedinherited |
Gets the name of a piece of restartable data given a data name, adding the system name and object name prefix.
This should only be used in this interface and in testing.
Definition at line 66 of file Restartable.C.
Referenced by Restartable::declareRecoverableData(), and Restartable::declareRestartableDataHelper().
Set the value for a particular layer.
layer | The layer you are setting the value for |
value | The value to set |
Definition at line 407 of file LayeredBase.C.
Referenced by LayeredExtremumMaterialProperty::execute(), FunctionLayeredIntegral::execute(), LayeredExtremumMaterialProperty::finalize(), finalize(), LayeredExtremumMaterialProperty::initialize(), LayeredExtremumMaterialProperty::threadJoin(), and threadJoin().
|
virtual |
Reimplemented in FunctionLayeredIntegral, LayeredExtremumMaterialProperty, LayeredIntegralBase< UserObjectType >, LayeredIntegralBase< SideIntegralFunctorUserObject >, LayeredIntegralBase< SideIntegralVariableUserObject >, LayeredIntegralBase< ElementIntegralFunctorUserObject >, LayeredIntegralBase< BaseType >, LayeredIntegralBase< ElementIntegralVariableUserObject >, LayeredAverageBase< BaseType >, LayeredAverageBase< SideIntegralFunctorUserObject >, LayeredAverageBase< SideIntegralVariableUserObject >, LayeredAverageBase< ElementIntegralFunctorUserObject >, and LayeredAverageBase< ElementIntegralVariableUserObject >.
Definition at line 339 of file LayeredBase.C.
Referenced by LayeredIntegralBase< ElementIntegralVariableUserObject >::threadJoin(), and FunctionLayeredIntegral::threadJoin().
|
static |
Definition at line 22 of file LayeredBase.C.
Referenced by LayeredIntegralBase< ElementIntegralVariableUserObject >::validParams(), LayeredExtremumMaterialProperty::validParams(), and FunctionLayeredIntegral::validParams().
|
protected |
How many layers both above and below the found layer will be used in the average.
Definition at line 127 of file LayeredBase.h.
Referenced by integralValue().
|
protected |
Whether the values are cumulative over the layers.
Definition at line 145 of file LayeredBase.h.
Referenced by LayeredExtremumMaterialProperty::finalize(), finalize(), and LayeredBase().
|
protected |
The component direction the layers are going in. We cache this for speed (so we're not always going through the MooseEnum)
Definition at line 112 of file LayeredBase.h.
Referenced by direction(), getBounds(), getLayer(), integralValue(), LayeredExtremumMaterialProperty::spatialPoints(), and FunctionLayeredIntegral::spatialPoints().
|
protected |
The MooseEnum direction the layers are going in.
Definition at line 109 of file LayeredBase.h.
|
protected |
Definition at line 136 of file LayeredBase.h.
Referenced by computeLayerCenters(), getBounds(), getLayer(), integralValue(), and LayeredBase().
|
protected |
Definition at line 135 of file LayeredBase.h.
Referenced by computeLayerCenters(), getBounds(), getLayer(), integralValue(), and LayeredBase().
|
private |
whether the max/min coordinate in the direction is known from user input
Definition at line 158 of file LayeredBase.h.
Referenced by LayeredBase().
|
protected |
Whether or not this object is based on equally spaced intervals or "bounds".
Definition at line 115 of file LayeredBase.h.
Referenced by computeLayerCenters(), getLayer(), and LayeredBase().
|
private |
List of SubdomainIDs, if given.
Definition at line 155 of file LayeredBase.h.
Referenced by getBounds(), and LayeredBase().
|
protected |
The boundaries of the layers.
Definition at line 121 of file LayeredBase.h.
Referenced by computeLayerCenters(), getLayer(), and LayeredBase().
|
protected |
center coordinates of each layer
Definition at line 133 of file LayeredBase.h.
Referenced by computeLayerCenters(), getLayerCenters(), LayeredExtremumMaterialProperty::spatialPoints(), and FunctionLayeredIntegral::spatialPoints().
|
protected |
Whether or not each layer has had any value summed into it.
Definition at line 142 of file LayeredBase.h.
Referenced by LayeredExtremumMaterialProperty::finalize(), finalize(), initialize(), integralValue(), LayeredBase(), layerHasValue(), and setLayerValue().
|
protected |
Value of the integral for each layer.
Definition at line 139 of file LayeredBase.h.
Referenced by LayeredExtremumMaterialProperty::finalize(), finalize(), getLayerValue(), initialize(), integralValue(), LayeredBase(), setLayerValue(), and threadJoin().
|
protected |
|
protected |
|
private |
Subproblem for the child object.
Definition at line 152 of file LayeredBase.h.
Referenced by finalize(), getBounds(), and LayeredBase().
|
protected |
Number of layers to split the mesh into.
Definition at line 118 of file LayeredBase.h.
Referenced by computeLayerCenters(), LayeredExtremumMaterialProperty::finalize(), finalize(), getLayer(), LayeredExtremumMaterialProperty::initialize(), integralValue(), LayeredAverageBase< ElementIntegralVariableUserObject >::LayeredAverageBase(), LayeredBase(), and LayeredExtremumMaterialProperty::threadJoin().
|
protected |
Whether the cumulative values should be summed in the positive or negative direction.
Definition at line 148 of file LayeredBase.h.
Referenced by LayeredExtremumMaterialProperty::finalize(), and finalize().
|
protectedinherited |
Reference to the application.
Definition at line 227 of file Restartable.h.
Referenced by Restartable::registerRestartableDataOnApp(), and Restartable::registerRestartableNameWithFilterOnApp().
|
protectedinherited |
Flag for toggling read only status (see ReporterData)
Definition at line 236 of file Restartable.h.
Referenced by Restartable::registerRestartableDataOnApp().
|
protectedinherited |
The system name this object is in.
Definition at line 230 of file Restartable.h.
Referenced by Restartable::restartableName().
|
protectedinherited |
The thread ID for this object.
Definition at line 233 of file Restartable.h.
Referenced by Restartable::declareRestartableDataHelper().
|
protected |
How to sample the values.
Definition at line 124 of file LayeredBase.h.
Referenced by integralValue(), and LayeredBase().
|
protected |
true if this object operates on the displaced mesh, otherwise false
Definition at line 130 of file LayeredBase.h.
Referenced by initialize().