17template <
typename BaseType>
50template <
typename BaseType>
58template <
typename BaseType>
65template <
typename BaseType>
71 for (
auto & vol : _layer_volumes)
75template <
typename BaseType>
81 const auto layer = getLayer(_current_elem->vertex_average());
82 _layer_volumes[layer] += volume();
85template <
typename BaseType>
91 gatherSum(_layer_volumes);
94 for (
const auto i : index_range(_layer_volumes))
96 setLayerValue(i, getLayerValue(i) / _layer_volumes[i]);
99template <
typename BaseType>
105 for (
const auto i : index_range(_layer_volumes))
106 if (lsa.layerHasValue(i))
Base class for computing layered averages.
std::vector< Real > _layer_volumes
Value of the volume (area for side integrals) for each layer.
virtual Real volume() const =0
virtual void initialize() override
virtual void execute() override
static InputParameters validParams()
LayeredAverageBase(const InputParameters ¶meters)
virtual void threadJoin(const UserObject &y) override
virtual void finalize() override
unsigned int _num_layers
Number of layers to split the mesh into.
bool layerHasValue(unsigned int layer) const
Whether or not a layer has a value.
virtual Real getLayerValue(unsigned int layer) const
Get the value for a given layer.
virtual unsigned int getLayer(const Point &p) const
Helper function to return the layer the point lies in.
void setLayerValue(unsigned int layer, Real value)
Set the value for a particular layer.
Base class for computing layered side integrals.
virtual void initialize() override
virtual void threadJoin(const UserObject &y) override
static InputParameters validParams()
virtual void finalize() override
virtual void execute() override
Base class for user-specific data.