void CoupledTransientExecutioner::execute() { if (_executioners.size() != _fe_problems.size()) mooseError("The number of executioners of different that the number of problems."); unsigned int n_problems = _executioners.size(); // preExecute for (unsigned int i = 0; i < n_problems; i++) { _executioners[i]->init(); _executioners[i]->preExecute(); } std::vector<Transient *> trans(n_problems); for (unsigned int i = 0; i < n_problems; i++) { Transient * exec = dynamic_cast<Transient *>(_executioners[i]); if (exec == NULL) mooseError("Executioner for problem '" << _fe_problems[i]->name() << "' has to be of a transient type."); trans[i] = exec; } bool first = true; for (_t_step = 0; _t_step < _n_steps; _t_step++) { if (first != true) { for (unsigned int i = 0; i < n_problems; i++) trans[i]->incrementStepOrReject(); } first = false; for (unsigned int i = 0; i < n_problems; i++) trans[i]->computeDT(); _dt = trans[0]->getDT(); _time += _dt; for (unsigned int i = 0; i < n_problems; i++) { _console << "Solving '" << _fep_mapping[_fe_problems[i]] << "'" << std::endl; trans[i]->takeStep(_dt); projectVariables(*_fe_problems[(i + 1) % n_problems]); } for (unsigned int i = 0; i < n_problems; i++) trans[i]->endStep(); } }
void SteadyTransientExecutioner::execute() { if (_executioners.size() < 2) mooseError("Not enough problems specified - need at least 2."); _executioners[0]->getMooseApp().setOutputWarehouse(_owhs[0]); _executioners[0]->init(); _executioners[0]->execute(); // project variables need by problem[1] into problem [1] projectVariables(*_fe_problems[1]); _executioners[1]->getMooseApp().setOutputWarehouse(_owhs[1]); _executioners[1]->init(); _executioners[1]->execute(); }