コード例 #1
0
void
TransientMultiApp::resetApp(unsigned int global_app, Real /*time*/)  // FIXME: Note that we are passing in time but also grabbing it below
{
  if (hasLocalApp(global_app))
  {
    unsigned int local_app = globalAppToLocal(global_app);

    // Grab the current time the App is at so we can start the new one at the same place
    Real time = _transient_executioners[local_app]->getTime() + _apps[local_app]->getGlobalTimeOffset();

    // Extract the file numbers from the output, so that the numbering is maintained after reset
    std::map<std::string, unsigned int> m = _apps[local_app]->getOutputWarehouse().getFileNumbers();

    // Reset the Multiapp
    MultiApp::resetApp(global_app, time);

    // Reset the file numbers of the newly reset apps
    _apps[local_app]->getOutputWarehouse().setFileNumbers(m);

    MPI_Comm swapped = Moose::swapLibMeshComm(_my_comm);

    setupApp(local_app, time, false);

    // Swap back
    Moose::swapLibMeshComm(swapped);
  }
}
コード例 #2
0
ファイル: TransientMultiApp.C プロジェクト: FHilty/moose
void TransientMultiApp::resetApp(
    unsigned int global_app,
    Real /*time*/) // FIXME: Note that we are passing in time but also grabbing it below
{
  if (hasLocalApp(global_app))
  {
    unsigned int local_app = globalAppToLocal(global_app);

    // Grab the current time the App is at so we can start the new one at the same place
    Real time =
        _transient_executioners[local_app]->getTime() + _apps[local_app]->getGlobalTimeOffset();

    // Reset the Multiapp
    MultiApp::resetApp(global_app, time);

    Moose::ScopedCommSwapper swapper(_my_comm);

    // Setup the app, disable the output so that the initial condition does not output
    // When an app is reset the initial condition was effectively already output before reset
    FEProblemBase & problem = appProblemBase(local_app);
    problem.allowOutput(false);
    setupApp(local_app, time);
    problem.allowOutput(true);
  }
}
コード例 #3
0
ファイル: MultiApp.C プロジェクト: beelbw/moose
void
MultiApp::moveApp(unsigned int global_app, Point p)
{

  _positions[global_app] = p;

  if (hasLocalApp(global_app))
  {
    unsigned int local_app = globalAppToLocal(global_app);

    if (_output_in_position)
      _apps[local_app]->setOutputPosition(p);
  }
}
コード例 #4
0
ファイル: TransientMultiApp.C プロジェクト: kun-liu/moose
void
TransientMultiApp::resetApp(unsigned int global_app, Real /*time*/)  // FIXME: Note that we are passing in time but also grabbing it below
{
  if (hasLocalApp(global_app))
  {
    unsigned int local_app = globalAppToLocal(global_app);

    // Grab the current time the App is at so we can start the new one at the same place
    Real time = _transient_executioners[local_app]->getTime() + _apps[local_app]->getGlobalTimeOffset();

    // Reset the Multiapp
    MultiApp::resetApp(global_app, time);

    MPI_Comm swapped = Moose::swapLibMeshComm(_my_comm);

    setupApp(local_app, time, false);

    // Swap back
    Moose::swapLibMeshComm(swapped);
  }
}
コード例 #5
0
ファイル: MultiApp.C プロジェクト: beelbw/moose
void
MultiApp::resetApp(unsigned int global_app, Real time)
{
  MPI_Comm swapped = Moose::swapLibMeshComm(_my_comm);

  if (hasLocalApp(global_app))
  {
    unsigned int local_app = globalAppToLocal(global_app);

    // Extract the file numbers from the output, so that the numbering is maintained after reset
    std::map<std::string, unsigned int> m = _apps[local_app]->getOutputWarehouse().getFileNumbers();

    // Delete and create a new App
    delete _apps[local_app];
    createApp(local_app, time);

    // Reset the file numbers of the newly reset apps
    _apps[local_app]->getOutputWarehouse().setFileNumbers(m);
  }

  // Swap back
  Moose::swapLibMeshComm(swapped);
}