Esempio n. 1
0
Real
NodalExtremeValue::getValue()
{
  switch (_type)
  {
    case MAX:
      gatherMax(_value);
      break;
    case MIN:
      gatherMin(_value);
      break;
  }

  return _value;
}
Real
PikaPhaseTimestepPostprocessor::getValue()
{
  gatherMax(_max_value);
  gatherMin(_min_value);

  // Cut-back
  if (std::abs(_min_value) - std::abs(_range[0]) > _decrease_limit)
    return _dt * _decrease_factor;
  else if (std::abs(_max_value) - std::abs(_range[1]) > _decrease_limit)
    return _dt * _decrease_factor;
  else if (std::abs(_min_value) - std::abs(_range[0]) < _increase_limit)
    return _dt * _increase_factor;
  else if (std::abs(_max_value) - std::abs(_range[1]) < _increase_limit)
    return _dt * _increase_factor;

  return _dt;
}
Esempio n. 3
0
void
PointValue::finalize()
{
  // Gather a consistent id for broadcasting the computed value
  gatherMin(_root_id);

  // Compute the value at the point
  if (_root_id == processor_id())
  {
    const Elem * elem = _mesh.elem(_elem_id);
    std::set<MooseVariable *> var_list;
    var_list.insert(&_var);

    _fe_problem.setActiveElementalMooseVariables(var_list, _tid);
    _subproblem.reinitElemPhys(elem, _point_vec, 0);
    mooseAssert(_u.size() == 1, "No values in u!");
    _value = _u[0];
  }

  // Make sure all processors have the correct computed values
  _communicator.broadcast(_value, _root_id);
}