コード例 #1
0
ファイル: EigenExecutionerBase.C プロジェクト: njl14/moose
EigenExecutionerBase::EigenExecutionerBase(const InputParameters & parameters) :
    Executioner(parameters),
    _problem(_fe_problem),
     _eigen_sys(static_cast<EigenSystem &>(_problem.getNonlinearSystem())),
     _eigenvalue(declareRestartableData("eigenvalue", 1.0)),
     _source_integral(getPostprocessorValue("bx_norm")),
     _normalization(isParamValid("normalization") ? getPostprocessorValue("normalization")
                    : getPostprocessorValue("bx_norm")) // use |Bx| for normalization by default
{
  //FIXME: currently we have to use old and older solution vectors for power iteration.
  //       We will need 'step' in the future.
  _problem.transient(true);

  {
    // No time integrator for eigenvalue problem
    std::string ti_str = "SteadyState";
    InputParameters params = _app.getFactory().getValidParams(ti_str);
    _problem.addTimeIntegrator(ti_str, "ti", params);
  }

  // we want to tell the App about what our system time is (in case anyone else is interested).
  Real system_time = getParam<Real>("time");
  _app.setStartTime(system_time);

  // set the system time
  _problem.time() = system_time;
  _problem.timeOld() = system_time;

  // used for controlling screen print-out
  _problem.timeStep() = 0;
  _problem.dt() = 1.0;
}
コード例 #2
0
InitialSolutionAdaptiveDT::InitialSolutionAdaptiveDT(const InputParameters & parameters) :
    SolutionTimeAdaptiveDT(parameters),
    _initial_dt(getParam<Real>("initial_dt")),
    _has_initial_dt(getParam<bool>("has_initial_dt")),
    _n_initial_steps(getParam<unsigned int>("n_initial_steps")),
    _total_t_step(declareRestartableData("total_t_step", -1))
{
}
コード例 #3
0
DiscreteNucleationInserter::DiscreteNucleationInserter(const InputParameters & parameters)
  : ElementUserObject(parameters),
    _probability(getMaterialProperty<Real>("probability")),
    _hold_time(getParam<Real>("hold_time")),
    _changes_made(0),
    _global_nucleus_list(declareRestartableData("global_nucleus_list", NucleusList(0))),
    _local_nucleus_list(declareRestartableData("local_nucleus_list", NucleusList(0)))
{
  setRandomResetFrequency(EXEC_TIMESTEP_END);

  // debugging code (this will insert the entry into every processors list, but duplicate entries in
  // global should be OK)
  // we also assume that time starts at 0! But hey, this is only for debugging anyways...
  if (isParamValid("test"))
    _insert_test = true;
  else
    _insert_test = false;

  // force a map rebuild after restart or recover
  _changes_made = _app.isRecovering() || _app.isRestarting();
}
コード例 #4
0
ファイル: TimeStepper.C プロジェクト: ChaliZhg/moose
TimeStepper::TimeStepper(const std::string & name, InputParameters parameters) :
    MooseObject(name, parameters),
    Restartable(parameters, "TimeSteppers"),
    _fe_problem(*parameters.getCheckedPointerParam<FEProblem *>("_fe_problem")),
    _executioner(*parameters.getCheckedPointerParam<Transient *>("_executioner")),
    _time(_fe_problem.time()),
    _time_old(_fe_problem.timeOld()),
    _t_step(_fe_problem.timeStep()),
    _dt(_fe_problem.dt()),
    _dt_min(_executioner.dtMin()),
    _dt_max(_executioner.dtMax()),
    _end_time(_executioner.endTime()),
    _sync_times(_app.getOutputWarehouse().getSyncTimes()),
    _timestep_tolerance(_executioner.timestepTol()),
    _verbose(_executioner.verbose()),
    _converged(true),
    _reset_dt(getParam<bool>("reset_dt")),
    _has_reset_dt(false),
    _current_dt(declareRestartableData("current_dt", 1.0))
{
}