Skip to content

Commit

Permalink
Move around some initialization in MultiApp to help with restart refs i…
Browse files Browse the repository at this point in the history
  • Loading branch information
friedmud committed Sep 24, 2015
1 parent 048b19c commit 92db1b0
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions framework/src/multiapps/MultiApp.C
Expand Up @@ -120,6 +120,21 @@ MultiApp::MultiApp(const InputParameters & parameters):

_total_num_apps = _positions.size();
mooseAssert(_input_files.size() == 1 || _positions.size() == _input_files.size(), "Number of positions and input files are not the same!");

// Fill in the _positions vector
fillPositions();

if (_move_apps.size() != _move_positions.size())
mooseError("The number of apps to move and the positions to move them to must be the same for MultiApp " << name());

/// Set up our Comm and set the number of apps we're going to be working on
buildComm();

_backups.resize(_my_num_apps);

// Initialize the backups
for (unsigned int i=0; i<_my_num_apps; i++)
_backups[i] = MooseSharedPointer<Backup>(new Backup);
}

MultiApp::~MultiApp()
Expand All @@ -138,26 +153,12 @@ MultiApp::~MultiApp()
void
MultiApp::initialSetup()
{
// Fill in the _positions vector
fillPositions();

if (_move_apps.size() != _move_positions.size())
mooseError("The number of apps to move and the positions to move them to must be the same for MultiApp " << name());

/// Set up our Comm and set the number of apps we're going to be working on
buildComm();

if (!_has_an_app)
return;

MPI_Comm swapped = Moose::swapLibMeshComm(_my_comm);

_apps.resize(_my_num_apps);
_backups.resize(_my_num_apps);

// Initialize the backups
for (unsigned int i=0; i<_my_num_apps; i++)
_backups[i] = MooseSharedPointer<Backup>(new Backup);

// If the user provided an unregistered app type, see if we can load it dynamically
if (!AppFactory::instance().isRegistered(_app_type))
Expand Down

0 comments on commit 92db1b0

Please sign in to comment.