void
AuxiliarySystem::computeScalarVars(ExecFlagType type)
{
  Moose::perf_log.push("update_aux_vars_scalar()","Solve");

  std::vector<AuxWarehouse> & auxs = _auxs(type);
  PARALLEL_TRY {
    // FIXME: run multi-threaded
    THREAD_ID tid = 0;
    if (auxs[tid].scalars().size() > 0)
    {
      _mproblem.reinitScalars(tid);

      const std::vector<AuxScalarKernel *> & scalars = auxs[tid].scalars();
      for (std::vector<AuxScalarKernel *>::const_iterator it = scalars.begin(); it != scalars.end(); ++it)
      {
        AuxScalarKernel * kernel = *it;
        kernel->compute();
      }

      const std::vector<MooseVariableScalar *> & scalar_vars = getScalarVariables(tid);
      for (std::vector<MooseVariableScalar *>::const_iterator it = scalar_vars.begin(); it != scalar_vars.end(); ++it)
      {
        MooseVariableScalar * var = *it;
        var->insert(solution());
      }
    }
  }
  PARALLEL_CATCH;
  Moose::perf_log.pop("update_aux_vars_scalar()","Solve");

  solution().close();
  _sys.update();
}
Example #2
0
VariableValue &
ScalarCoupleable::coupledScalarDotDu(const std::string & var_name, unsigned int comp)
{
  checkVar(var_name);
  validateExecutionerType(var_name, "coupledScalarDotDu");
  MooseVariableScalar * var = getScalarVar(var_name, comp);
  return var->duDotDu();
}
Example #3
0
VariableValue &
ScalarCoupleable::coupledScalarValueOld(const std::string & var_name, unsigned int comp)
{
  if (!isCoupledScalar(var_name, comp))
    return *getDefaultValue(var_name);

  MooseVariableScalar * var = getScalarVar(var_name, comp);
  return (_sc_is_implicit) ? var->slnOld() : var->slnOlder();
}
Example #4
0
void
SystemBase::reinitScalars(THREAD_ID tid)
{
  const std::vector<MooseVariableScalar *> & vars = _vars[tid].scalars();
  for (std::vector<MooseVariableScalar *>::const_iterator it = vars.begin(); it != vars.end(); ++it)
  {
    MooseVariableScalar *var = *it;
    var->reinit();
  }
}
Example #5
0
VariableValue &
ScalarCoupleable::coupledScalarValueOlder(const std::string & var_name, unsigned int comp)
{
  checkVar(var_name);
  if (!isCoupledScalar(var_name, comp))
    return *getDefaultValue(var_name);

  validateExecutionerType(var_name, "coupledScalarValueOlder");
  MooseVariableScalar * var = getScalarVar(var_name, comp);
  if (_sc_is_implicit)
    return var->slnOlder();
  else
    mooseError("Older values not available for explicit schemes");
}
Example #6
0
void
ODEKernel::computeJacobian()
{
  DenseMatrix<Number> & ke = _assembly.jacobianBlock(_var.number(), _var.number());

  for (_i = 0; _i < _var.order(); _i++)
    for (_j = 0; _j < _var.order(); _j++)
      ke(_i, _j) += computeQpJacobian();

  // compute off-diagonal jacobians wrt scalar variables
  const std::vector<MooseVariableScalar *> & scalar_vars = _sys.getScalarVariables(_tid);
  for (std::vector<MooseVariableScalar *>::const_iterator it = scalar_vars.begin(); it != scalar_vars.end(); ++it)
  {
    MooseVariableScalar * jvar = *it;
    computeOffDiagJacobian(jvar->number());
  }
}
Example #7
0
VariableValue &
ScalarCoupleable::coupledScalarDot(const std::string & var_name, unsigned int comp)
{
  MooseVariableScalar * var = getScalarVar(var_name, comp);
  return var->uDot();
}
Example #8
0
VariableValue &
ScalarCoupleable::coupledScalarValue(const std::string & var_name, unsigned int comp)
{
  MooseVariableScalar * var = getScalarVar(var_name, comp);
  return (_sc_is_implicit) ? var->sln() : var->slnOld();
}