const VariableValue & Coupleable::coupledValuePreviousNL(const std::string & var_name, unsigned int comp) { if (!isCoupled(var_name)) return *getDefaultValue(var_name); _c_fe_problem.needsPreviousNewtonIteration(true); coupledCallback(var_name, true); MooseVariable * var = getVar(var_name, comp); if (!_coupleable_neighbor) { if (_nodal) return var->nodalSlnPreviousNL(); else return var->slnPreviousNL(); } else { if (_nodal) return var->nodalSlnPreviousNLNeighbor(); else return var->slnPreviousNLNeighbor(); } }
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(); } }
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"); } }
VariableSecond & Coupleable::coupledSecond(const std::string & var_name, unsigned int comp) { coupledCallback(var_name, false); if (_nodal) mooseError("Nodal variables do not have second derivatives"); MooseVariable * var = getVar(var_name, comp); return (_c_is_implicit) ? var->secondSln() : var->secondSlnOlder(); }
VariableGradient & Coupleable::coupledGradient(const std::string & var_name, unsigned int comp) { coupledCallback(var_name, false); if (_nodal) mooseError("Nodal variables do not have gradients"); MooseVariable * var = getVar(var_name, comp); return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld(); }
const VariableValue & Coupleable::coupledNodalDot(const std::string & var_name, unsigned int comp) { if (!isCoupled(var_name)) // Return default 0 return _default_value_zero; coupledCallback(var_name, false); MooseVariable * var = getVar(var_name, comp); if (!_coupleable_neighbor) return var->nodalValueDot(); else return var->nodalValueDotNeighbor(); }
VariableSecond & Coupleable::coupledSecondOld(const std::string & var_name, unsigned int comp) { if (!isCoupled(var_name)) // Return default 0 return _default_second; coupledCallback(var_name, true); if (_nodal) mooseError("Nodal variables do not have second derivatives"); validateExecutionerType(var_name); MooseVariable * var = getVar(var_name, comp); return (_c_is_implicit) ? var->secondSlnOld() : var->secondSlnOlder(); }
VariableSecond & Coupleable::coupledSecondOlder(const std::string & var_name, unsigned int comp) { coupledCallback(var_name, true); if (_nodal) mooseError("Nodal variables do not have second derivatives"); validateExecutionerType(var_name); MooseVariable * var = getVar(var_name, comp); if (_c_is_implicit) return var->secondSlnOlder(); else mooseError("Older values not available for explicit schemes"); }
const VariableValue & Coupleable::coupledNodalValue(const std::string & var_name, unsigned int comp) { if (!isCoupled(var_name)) return *getDefaultValue(var_name); coupledCallback(var_name, false); MooseVariable * var = getVar(var_name, comp); if (!_coupleable_neighbor) return (_c_is_implicit) ? var->nodalValue() : var->nodalValueOld(); else return (_c_is_implicit) ? var->nodalValueNeighbor() : var->nodalValueOldNeighbor(); }
const VariableSecond & Coupleable::coupledSecondPreviousNL(const std::string & var_name, unsigned int comp) { if (!isCoupled(var_name)) // Return default 0 return _default_second; _c_fe_problem.needsPreviousNewtonIteration(true); coupledCallback(var_name, true); if (_nodal) mooseError("Nodal variables do not have second derivatives"); MooseVariable * var = getVar(var_name, comp); if (!_coupleable_neighbor) return var->secondSlnPreviousNL(); else return var->secondSlnPreviousNLNeighbor(); }
const VariableSecond & Coupleable::coupledSecond(const std::string & var_name, unsigned int comp) { if (!isCoupled(var_name)) // Return default 0 return _default_second; coupledCallback(var_name, false); if (_nodal) mooseError("Nodal variables do not have second derivatives"); MooseVariable * var = getVar(var_name, comp); if (!_coupleable_neighbor) return (_c_is_implicit) ? var->secondSln() : var->secondSlnOlder(); else return (_c_is_implicit) ? var->secondSlnNeighbor() : var->secondSlnOlderNeighbor(); }
const VariableGradient & Coupleable::coupledGradient(const std::string & var_name, unsigned int comp) { if (!isCoupled(var_name)) // Return default 0 return _default_gradient; coupledCallback(var_name, false); if (_nodal) mooseError("Nodal variables do not have gradients"); MooseVariable * var = getVar(var_name, comp); if (!_coupleable_neighbor) return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld(); else return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor(); }
VariableGradient & Coupleable::coupledGradientOlder(const std::string & var_name, unsigned int comp) { if (!isCoupled(var_name)) // Return default 0 return _default_gradient; coupledCallback(var_name, true); if (_nodal) mooseError("Nodal variables do not have gradients"); validateExecutionerType(var_name); MooseVariable * var = getVar(var_name, comp); if (_c_is_implicit) return var->gradSlnOlder(); else mooseError("Older values not available for explicit schemes"); }
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"); } } }
const DenseVector<Number> & Coupleable::coupledSolutionDoFs(const std::string & var_name, unsigned int comp) { // default coupling is not available for elemental solutions if (!isCoupled(var_name)) mooseError("invalid variable name for coupledSolutionDoFs"); if (_nodal) mooseError("nodal objects should not call coupledSolutionDoFs"); coupledCallback(var_name, false); MooseVariable * var = getVar(var_name, comp); if (!_coupleable_neighbor) return (_c_is_implicit) ? var->solutionDoFs() : var->solutionDoFsOld(); else return (_c_is_implicit) ? var->solutionDoFsNeighbor() : var->solutionDoFsOldNeighbor(); }
VariableValue & Coupleable::coupledNodalValue(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]; } coupledCallback(var_name, false); MooseVariable * var = getVar(var_name, comp); return (_c_is_implicit) ? var->nodalValue() : var->nodalValueOld(); }
const DenseVector<Number> & Coupleable::coupledSolutionDoFsOlder(const std::string & var_name, unsigned int comp) { // default coupling is not available for elemental solutions if (!isCoupled(var_name)) mooseError("invalid variable name for coupledSolutionDoFsOlder"); if (_nodal) mooseError("nodal objects should not call coupledSolutionDoFsOlder"); validateExecutionerType(var_name); coupledCallback(var_name, true); MooseVariable * var = getVar(var_name, comp); if (_c_is_implicit) { if (!_coupleable_neighbor) return var->solutionDoFsOlder(); else return var->solutionDoFsOlderNeighbor(); } else mooseError("Older values not available for explicit schemes"); }