Exemple #1
0
void
LayeredBase::threadJoin(const UserObject & y)
{
    const LayeredBase & lb = dynamic_cast<const LayeredBase &>(y);
    for (unsigned int i=0; i<_layer_values.size(); i++)
        if (lb.layerHasValue(i))
            setLayerValue(i, getLayerValue(i) + lb._layer_values[i]);
}
Exemple #2
0
void
LayeredSideIntegral::execute()
{
  Real integral_value = computeIntegral();

  unsigned int layer = getLayer(_current_elem->centroid());

  setLayerValue(layer, getLayerValue(layer) + integral_value);
}
void
LayeredSideAverage::finalize()
{
  LayeredSideIntegral::finalize();

  gatherSum(_layer_volumes);

  // Compute the average for each layer
  for (unsigned int i=0; i<_layer_volumes.size(); i++)
    if (layerHasValue(i))
      setLayerValue(i, getLayerValue(i) / _layer_volumes[i]);
}
Exemple #4
0
void
LayeredBase::finalize()
{
    _layered_base_subproblem.comm().sum(_layer_values);
    _layered_base_subproblem.comm().max(_layer_has_value);

    if (_cumulative)
    {
        Real value = 0;

        for (unsigned i = 0; i < _num_layers; ++i)
        {
            value += getLayerValue(i);
            setLayerValue(i, value);
        }
    }
}