Example #1
0
const VariableValue &
Coupleable::coupledValueOld(const std::string & var_name, unsigned int comp)
{
  if (!isCoupled(var_name))
    return *getDefaultValue(var_name);

  validateExecutionerType(var_name);
  coupledCallback(var_name, true);
  MooseVariable * var = getVar(var_name, comp);

  if (!_coupleable_neighbor)
  {
    if (_nodal)
      return (_c_is_implicit) ? var->nodalSlnOld() : var->nodalSlnOlder();
    else
      return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
  }
  else
  {
    if (_nodal)
      return (_c_is_implicit) ? var->nodalSlnOldNeighbor() : var->nodalSlnOlderNeighbor();
    else
      return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
  }
}
Example #2
0
VariableValue &
Coupleable::coupledValueOlder(const std::string & var_name, unsigned int comp)
{
  if (!isCoupled(var_name)) // Need to generate a "default value" filled VariableValue
  {
    VariableValue * value = _default_value[var_name];
    if (value == NULL)
    {
      value = new VariableValue(_coupleable_max_qps, _coupleable_params.defaultCoupledValue(var_name));
      _default_value[var_name] = value;
    }
    return *_default_value[var_name];
  }

  validateExecutionerType(var_name);
  coupledCallback(var_name, true);
  MooseVariable * var = getVar(var_name, comp);
  if (_nodal)
  {
    if (_c_is_implicit)
      return var->nodalSlnOlder();
    else
      mooseError("Older values not available for explicit schemes");
  }
  else
  {
    if (_c_is_implicit)
      return var->slnOlder();
    else
      mooseError("Older values not available for explicit schemes");
  }
}
Example #3
0
const VariableValue &
Coupleable::coupledValueOlder(const std::string & var_name, unsigned int comp)
{
  if (!isCoupled(var_name))
    return *getDefaultValue(var_name);

  validateExecutionerType(var_name);
  coupledCallback(var_name, true);
  MooseVariable * var = getVar(var_name, comp);

  if (!_coupleable_neighbor)
  {
    if (_nodal)
    {
      if (_c_is_implicit)
        return var->nodalSlnOlder();
      else
        mooseError("Older values not available for explicit schemes");
    }
    else
    {
      if (_c_is_implicit)
        return var->slnOlder();
      else
        mooseError("Older values not available for explicit schemes");
    }
  }
  else
  {
    if (_nodal)
    {
      if (_c_is_implicit)
        return var->nodalSlnOlderNeighbor();
      else
        mooseError("Older values not available for explicit schemes");
    }
    else
    {
      if (_c_is_implicit)
        return var->slnOlderNeighbor();
      else
        mooseError("Older values not available for explicit schemes");
    }
  }
}