www.mooseframework.org
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
SamplerTransientMultiApp Class Reference

#include <SamplerTransientMultiApp.h>

Inheritance diagram for SamplerTransientMultiApp:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 SamplerTransientMultiApp (const InputParameters &parameters)
 
virtual bool solveStep (Real dt, Real target_time, bool auto_advance=true) override
 Override solveStep to allow for batch execution. More...
 
virtual void initialSetup () override
 Override to initialize batch backups. More...
 
virtual NumericVector< Number > & appTransferVector (unsigned int app, std::string var_name) override
 
virtual void incrementTStep (Real target_time) override
 
virtual void finishStep (bool recurse_through_multiapp_levels=false) override
 
virtual bool needsRestoration () override
 
virtual void resetApp (unsigned int global_app, Real time) override
 
Real computeDT ()
 
virtual void preExecute ()
 
virtual void finalize ()
 
virtual void postExecute ()
 
void setupPositions ()
 
virtual void createLocalApp (const unsigned int i)
 
virtual void preTransfer (Real dt, Real target_time)
 
virtual void backup ()
 
virtual void restore (bool force=true)
 
virtual ExecutionergetExecutioner (unsigned int app)
 
virtual BoundingBox getBoundingBox (unsigned int app, bool displaced_mesh, const MultiAppCoordTransform *coord_transform=nullptr)
 
FEProblemBaseproblemBase ()
 
FEProblemBaseappProblemBase (unsigned int app)
 
FEProblemappProblem (unsigned int app)
 
const UserObjectappUserObjectBase (unsigned int app, const std::string &name)
 
Real appPostprocessorValue (unsigned int app, const std::string &name)
 
unsigned int numGlobalApps () const
 
unsigned int numLocalApps ()
 
unsigned int firstLocalApp ()
 
bool isFirstLocalRank () const
 
bool hasApp ()
 
bool hasLocalApp (unsigned int global_app) const
 
MooseApplocalApp (unsigned int local_app)
 
const Point & position (unsigned int app) const
 
virtual void moveApp (unsigned int global_app, Point p)
 
virtual void parentOutputPositionChanged ()
 
MPI_Comm & comm ()
 
const Parallel::Communicator & comm () const
 
bool isRootProcessor ()
 
bool usingPositions () const
 
bool runningInPosition () const
 
void addAssociatedTransfer (MultiAppTransfer &transfer)
 
void setAppOutputFileBase ()
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &name, const std::string *param=nullptr) const
 
virtual void timestepSetup ()
 
virtual void jacobianSetup ()
 
virtual void residualSetup ()
 
virtual void subdomainSetup ()
 
virtual void customSetup (const ExecFlagType &)
 
const ExecFlagEnumgetExecuteOnEnum () const
 
PerfGraphperfGraph ()
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
T & getSampler (const std::string &name)
 
SamplergetSampler (const std::string &name)
 
T & getSamplerByName (const SamplerName &name)
 
SamplergetSamplerByName (const SamplerName &name)
 

Static Public Member Functions

static InputParameters validParams ()
 
static void transformBoundingBox (BoundingBox &box, const MultiAppCoordTransform &transform)
 

Public Attributes

const ConsoleStream _console
 

Protected Member Functions

virtual std::string getCommandLineArgsParamHelper (unsigned int local_app) override
 Override to allow to get correct cli_args. More...
 
void setAppOutputFileBase (unsigned int index)
 
virtual std::vector< std::string > cliArgs () const
 
virtual void fillPositions ()
 
void readCommandLineArguments ()
 
void createApp (unsigned int i, Real start_time)
 
void buildComm ()
 
unsigned int globalAppToLocal (unsigned int global_app)
 
virtual void preRunInputFile ()
 
void init (unsigned int num_apps, bool batch_mode=false)
 
void init (unsigned int num_apps, const LocalRankConfig &config)
 
void createApps ()
 
void keepSolutionDuringRestore (bool keep_solution_during_restore)
 
T & declareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< T > declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const T & getRestartableData (const std::string &data_name) const
 
T & declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
T & declareRecoverableData (const std::string &data_name, Args &&... args)
 
T & declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
T & declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 

Static Protected Member Functions

static std::string getMultiAppName (const std::string &base_name, dof_id_type index, dof_id_type total)
 

Protected Attributes

Sampler_sampler
 Sampler to utilize for creating MultiApps. More...
 
const StochasticTools::MultiAppMode _mode
 The Sup-application solve mode. More...
 
dof_id_type _local_batch_app_index
 Counter for extracting command line arguments in batch mode. More...
 
FEProblemBase_fe_problem
 
std::string _app_type
 
std::vector< Point > _positions
 
std::vector< const Positions *> _positions_objs
 
std::vector< unsigned int_positions_index_offsets
 
const bool _use_positions
 
std::vector< FileName > _input_files
 
const bool & _wait_for_first_app_init
 
std::vector< unsigned int_npositions_inputfile
 
std::string _output_base
 
unsigned int _total_num_apps
 
unsigned int _my_num_apps
 
unsigned int _first_local_app
 
const MPI_Comm & _orig_comm
 
libMesh::Parallel::Communicator _my_communicator
 
MPI_Comm & _my_comm
 
int _orig_num_procs
 
int _orig_rank
 
std::string _node_name
 
int _my_rank
 
std::vector< std::shared_ptr< MooseApp > > _apps
 
std::vector< bool > _has_bounding_box
 
std::vector< BoundingBox > _bounding_box
 
Real _inflation
 
Point _bounding_box_padding
 
processor_id_type _max_procs_per_app
 
processor_id_type _min_procs_per_app
 
bool _output_in_position
 
const Real _global_time_offset
 
std::vector< Real_reset_times
 
std::vector< unsigned int_reset_apps
 
std::vector< bool > _reset_happened
 
Real _move_time
 
std::vector< unsigned int_move_apps
 
std::vector< Point > _move_positions
 
bool _move_happened
 
bool _has_an_app
 
const std::vector< CLIArgString > & _cli_args
 
std::vector< std::string > _cli_args_from_file
 
bool _keep_solution_during_restore
 
std::vector< std::unique_ptr< NumericVector< Real > > > _end_solutions
 
LocalRankConfig _rank_config
 
std::vector< MultiAppTransfer *> _associated_transfers
 
const bool _run_in_position
 
SubAppBackups_sub_app_backups
 
const PerfID _solve_step_timer
 
const PerfID _init_timer
 
const PerfID _backup_timer
 
const PerfID _restore_timer
 
const PerfID _reset_timer
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
const ExecFlagEnum_execute_enum
 
const ExecFlagType_current_execute_flag
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 

Private Member Functions

bool solveStepBatch (Real dt, Real target_time, bool auto_advance=true)
 Helper method for running in mode='batch'. More...
 
void updateRowData (dof_id_type local_index)
 Helper function for updating _row_data and _local_row_index. More...
 
std::vector< std::shared_ptr< StochasticToolsTransfer > > getActiveStochasticToolsTransfers (Transfer::DIRECTION direction)
 Helper for getting StochasticToolsTransfer objects. More...
 

Private Attributes

const dof_id_type _number_of_sampler_rows
 Store the number of rows initialized, if this changes error because it doesn't make sense. More...
 
std::vector< std::vector< std::unique_ptr< Backup > > > _batch_backup
 Storage for batch-restore mode; the outer vector if for the local stochastic data and the inner vector is for the number of sub-apps. More...
 
std::vector< Real_row_data
 Current row of data updated by updateRowData. Used by transfers and setting command line args. More...
 
dof_id_type _local_row_index = std::numeric_limits<dof_id_type>::max()
 Current local index representing _row_data. More...
 

Detailed Description

Definition at line 21 of file SamplerTransientMultiApp.h.

Constructor & Destructor Documentation

◆ SamplerTransientMultiApp()

SamplerTransientMultiApp::SamplerTransientMultiApp ( const InputParameters parameters)

Definition at line 51 of file SamplerTransientMultiApp.C.

53  SamplerInterface(this),
54  _sampler(getSampler("sampler")),
55  _mode(getParam<MooseEnum>("mode").getEnum<StochasticTools::MultiAppMode>()),
58 {
60  paramError("mode",
61  "The supplied mode, '",
62  getParam<MooseEnum>("mode"),
63  "', currently is not implemented for the SamplerTransientMultiApp, the available "
64  "options are 'normal' or 'batch-restore'.");
65 
66  if (getParam<unsigned int>("min_procs_per_app") !=
67  _sampler.getParam<unsigned int>("min_procs_per_row") ||
68  getParam<unsigned int>("max_procs_per_app") !=
69  _sampler.getParam<unsigned int>("max_procs_per_row"))
70  paramError("sampler",
71  "Sampler and multiapp communicator configuration inconsistent. Please ensure that "
72  "'MultiApps/",
73  name(),
74  "/min(max)_procs_per_app' and 'Samplers/",
75  _sampler.name(),
76  "/min(max)_procs_per_row' are the same.");
77 
81 }
const StochasticTools::MultiAppMode _mode
The Sup-application solve mode.
virtual const std::string & name() const
TransientMultiApp(const InputParameters &parameters)
const T & getParam(const std::string &name) const
void paramError(const std::string &param, Args... args) const
const LocalRankConfig & getRankConfig(bool batch_mode) const
dof_id_type getNumberOfRows() const
T & getSampler(const std::string &name)
SamplerInterface(const MooseObject *moose_object)
const InputParameters & parameters() const
Sampler & _sampler
Sampler to utilize for creating MultiApps.
dof_id_type _local_batch_app_index
Counter for extracting command line arguments in batch mode.
void init(unsigned int num_apps, bool batch_mode=false)
const dof_id_type _number_of_sampler_rows
Store the number of rows initialized, if this changes error because it doesn&#39;t make sense...

Member Function Documentation

◆ getActiveStochasticToolsTransfers()

std::vector< std::shared_ptr< StochasticToolsTransfer > > SamplerTransientMultiApp::getActiveStochasticToolsTransfers ( Transfer::DIRECTION  direction)
private

Helper for getting StochasticToolsTransfer objects.

This is a copy from SamplerFullSolveMultiapp, but the alternative is to create an intermediate base. But, given the inheritance difference between these object that gets rather complex, so a few lines of copied code is better for now.

Definition at line 202 of file SamplerTransientMultiApp.C.

Referenced by solveStepBatch().

203 {
204  std::vector<std::shared_ptr<StochasticToolsTransfer>> output;
205  const ExecuteMooseObjectWarehouse<Transfer> & warehouse =
207  for (std::shared_ptr<Transfer> transfer : warehouse.getActiveObjects())
208  {
209  std::shared_ptr<StochasticToolsTransfer> ptr =
210  std::dynamic_pointer_cast<StochasticToolsTransfer>(transfer);
211  if (ptr && ptr->getMultiApp().get() == this)
212  output.push_back(ptr);
213  }
214  return output;
215 }
FEProblemBase & _fe_problem
The class creates an additional API to allow Transfers to work when running the StochasticTools<FullS...
const std::vector< std::shared_ptr< Transfer > > & getActiveObjects(THREAD_ID tid=0) const
const ExecuteMooseObjectWarehouse< Transfer > & getMultiAppTransferWarehouse(Transfer::DIRECTION direction) const

◆ getCommandLineArgsParamHelper()

std::string SamplerTransientMultiApp::getCommandLineArgsParamHelper ( unsigned int  local_app)
overrideprotectedvirtual

Override to allow to get correct cli_args.

Reimplemented from TransientMultiApp.

Definition at line 218 of file SamplerTransientMultiApp.C.

219 {
220  std::string args;
221 
222  // With multiple processors per app, there are no local rows for non-root processors
223  if (isRootProcessor())
224  {
225  // Since we only store param_names in cli_args, we need to find the values for each param from
226  // sampler data and combine them to get full command line option strings.
229  const std::vector<std::string> & cli_args_name =
232  }
233 
235  return args;
236 }
virtual std::string getCommandLineArgsParamHelper(unsigned int local_app)
std::vector< Real > _row_data
Current row of data updated by updateRowData. Used by transfers and setting command line args...
static std::string sampledCommandLineArgs(const std::vector< Real > &row, const std::vector< std::string > &full_args_name)
Helper for inserting row data into commandline arguments Used here and in SamplerTransientMultiApp.
const StochasticTools::MultiAppMode _mode
The Sup-application solve mode.
std::vector< std::string > split(const std::string &str, const std::string &delimiter, std::size_t max_count=std::numeric_limits< std::size_t >::max())
void updateRowData(dof_id_type local_index)
Helper function for updating _row_data and _local_row_index.
void broadcast(T &data, const unsigned int root_id=0, const bool identical_sizes=false) const
libMesh::Parallel::Communicator _my_communicator
dof_id_type _local_batch_app_index
Counter for extracting command line arguments in batch mode.

◆ initialSetup()

void SamplerTransientMultiApp::initialSetup ( )
overridevirtual

Override to initialize batch backups.

Reimplemented from TransientMultiApp.

Definition at line 84 of file SamplerTransientMultiApp.C.

85 {
86  TIME_SECTION("initialSetup", 2, "Setting Up SamplerTransientMultiApp");
87 
89 
90  // Perform initial backup for the batch sub-applications
92  {
94  _batch_backup.resize(n);
95  for (MooseIndex(n) i = 0; i < n; ++i)
96  for (MooseIndex(_my_num_apps) j = 0; j < _my_num_apps; j++)
97  _batch_backup[i].emplace_back(_apps[j]->backup());
98  }
99 }
virtual void backup()
LocalRankConfig _rank_config
virtual void initialSetup() override
std::vector< std::shared_ptr< MooseApp > > _apps
const StochasticTools::MultiAppMode _mode
The Sup-application solve mode.
std::vector< std::vector< std::unique_ptr< Backup > > > _batch_backup
Storage for batch-restore mode; the outer vector if for the local stochastic data and the inner vecto...
dof_id_type num_local_sims
unsigned int _my_num_apps
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
uint8_t dof_id_type

◆ solveStep()

bool SamplerTransientMultiApp::solveStep ( Real  dt,
Real  target_time,
bool  auto_advance = true 
)
overridevirtual

Override solveStep to allow for batch execution.

Reimplemented from TransientMultiApp.

Definition at line 102 of file SamplerTransientMultiApp.C.

103 {
104  TIME_SECTION("solveStep", 3, "Solving SamplerTransientMultiApp");
105 
107  mooseError("The size of the sampler has changed; SamplerTransientMultiApp object do not "
108  "support dynamic Sampler output.");
109 
110  bool last_solve_converged = true;
112  last_solve_converged = solveStepBatch(dt, target_time, auto_advance);
113  else
114  last_solve_converged = TransientMultiApp::solveStep(dt, target_time, auto_advance);
115  return last_solve_converged;
116 }
const StochasticTools::MultiAppMode _mode
The Sup-application solve mode.
dof_id_type getNumberOfRows() const
void mooseError(Args &&... args) const
bool solveStepBatch(Real dt, Real target_time, bool auto_advance=true)
Helper method for running in mode=&#39;batch&#39;.
Sampler & _sampler
Sampler to utilize for creating MultiApps.
virtual bool solveStep(Real dt, Real target_time, bool auto_advance=true) override
const dof_id_type _number_of_sampler_rows
Store the number of rows initialized, if this changes error because it doesn&#39;t make sense...

◆ solveStepBatch()

bool SamplerTransientMultiApp::solveStepBatch ( Real  dt,
Real  target_time,
bool  auto_advance = true 
)
private

Helper method for running in mode='batch'.

Definition at line 119 of file SamplerTransientMultiApp.C.

Referenced by solveStep().

120 {
121  // Value to return
122  bool last_solve_converged = true;
123 
124  // List of active relevant Transfer objects
125  std::vector<std::shared_ptr<StochasticToolsTransfer>> to_transfers =
127  std::vector<std::shared_ptr<StochasticToolsTransfer>> from_transfers =
129 
130  // Initialize to/from transfers
131  for (auto transfer : to_transfers)
132  {
133  transfer->setGlobalMultiAppIndex(_rank_config.first_local_app_index);
134  transfer->initializeToMultiapp();
135  }
136  for (auto transfer : from_transfers)
137  {
138  transfer->setGlobalMultiAppIndex(_rank_config.first_local_app_index);
139  transfer->initializeFromMultiapp();
140  }
141 
142  // Perform batch MultiApp solves
146  ++i)
147  {
149 
151  for (MooseIndex(_my_num_apps) j = 0; j < _my_num_apps; j++)
152  {
153  _apps[j]->restore(std::move(_batch_backup[_local_batch_app_index][j]), false);
154  _apps[j]->finalizeRestore();
155  }
156 
158  i,
159  _row_data,
162  _console);
163 
164  // Set the file base based on the current row
165  for (unsigned int ai = 0; ai < _my_num_apps; ++ai)
166  {
167  const std::string mname = getMultiAppName(name(), i, _number_of_sampler_rows);
168  _apps[ai]->setOutputFileBase(_app.getOutputFileBase() + "_" + mname);
169  }
170 
171  const bool curr_last_solve_converged =
172  TransientMultiApp::solveStep(dt, target_time, auto_advance);
173  last_solve_converged = last_solve_converged && curr_last_solve_converged;
174 
176  i,
177  _row_data,
180  _console);
181 
182  incrementTStep(target_time);
183 
185  for (MooseIndex(_my_num_apps) j = 0; j < _my_num_apps; j++)
187 
189  }
191 
192  // Finalize to/from transfers
193  for (auto transfer : to_transfers)
194  transfer->finalizeToMultiapp();
195  for (auto transfer : from_transfers)
196  transfer->finalizeFromMultiapp();
197 
198  return last_solve_converged;
199 }
virtual void backup()
bool verboseMultiApps() const
LocalRankConfig _rank_config
std::vector< Real > _row_data
Current row of data updated by updateRowData. Used by transfers and setting command line args...
std::string getOutputFileBase(bool for_non_moose_build_output=false) const
std::vector< std::shared_ptr< MooseApp > > _apps
dof_id_type first_local_app_index
std::vector< std::shared_ptr< StochasticToolsTransfer > > getActiveStochasticToolsTransfers(Transfer::DIRECTION direction)
Helper for getting StochasticToolsTransfer objects.
const StochasticTools::MultiAppMode _mode
The Sup-application solve mode.
std::vector< std::vector< std::unique_ptr< Backup > > > _batch_backup
Storage for batch-restore mode; the outer vector if for the local stochastic data and the inner vecto...
FEProblemBase & _fe_problem
virtual const std::string & name() const
void updateRowData(dof_id_type local_index)
Helper function for updating _row_data and _local_row_index.
dof_id_type num_local_sims
unsigned int _my_num_apps
static std::string getMultiAppName(const std::string &base_name, dof_id_type index, dof_id_type total)
static void execBatchTransfers(const std::vector< std::shared_ptr< StochasticToolsTransfer >> &transfers, dof_id_type global_row_index, const std::vector< Real > &row_data, Transfer::DIRECTION direction, bool verbose, const ConsoleStream &console)
Helper for executing transfers when doing batch stochastic simulations.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
dof_id_type first_local_sim_index
dof_id_type _local_batch_app_index
Counter for extracting command line arguments in batch mode.
const ConsoleStream _console
virtual void incrementTStep(Real target_time) override
virtual bool solveStep(Real dt, Real target_time, bool auto_advance=true) override
uint8_t dof_id_type
const dof_id_type _number_of_sampler_rows
Store the number of rows initialized, if this changes error because it doesn&#39;t make sense...

◆ updateRowData()

void SamplerTransientMultiApp::updateRowData ( dof_id_type  local_index)
private

Helper function for updating _row_data and _local_row_index.

This allows multiple calls to the same row index

Definition at line 239 of file SamplerTransientMultiApp.C.

Referenced by getCommandLineArgsParamHelper(), and solveStepBatch().

240 {
241  if (!isRootProcessor())
242  return;
243 
244  mooseAssert(local_index < _sampler.getNumberOfLocalRows(),
245  "Local index must be less than number of local rows.");
246 
247  if (_row_data.empty() ||
248  (_local_row_index == _sampler.getNumberOfLocalRows() - 1 && local_index == 0))
249  {
250  mooseAssert(local_index == 0,
251  "The first time calling updateRowData must have a local index of 0.");
252  _local_row_index = 0;
254  }
255  else if (local_index - _local_row_index == 1)
256  {
259  }
260 
261  mooseAssert(local_index == _local_row_index,
262  "Local index must be equal or one greater than the index previously called.");
263 }
std::vector< Real > _row_data
Current row of data updated by updateRowData. Used by transfers and setting command line args...
std::vector< Real > getNextLocalRow()
dof_id_type getNumberOfLocalRows() const
dof_id_type _local_row_index
Current local index representing _row_data.
Sampler & _sampler
Sampler to utilize for creating MultiApps.

◆ validParams()

InputParameters SamplerTransientMultiApp::validParams ( )
static

Definition at line 19 of file SamplerTransientMultiApp.C.

20 {
23  params.addClassDescription("Creates a sub-application for each row of each Sampler matrix.");
24  params.addRequiredParam<SamplerName>("sampler",
25  "The Sampler object to utilize for creating MultiApps.");
26  params.suppressParameter<std::vector<Point>>("positions");
27  params.suppressParameter<bool>("output_in_position");
28  params.suppressParameter<std::vector<FileName>>("positions_file");
29  params.suppressParameter<Real>("move_time");
30  params.suppressParameter<std::vector<Point>>("move_positions");
31  params.suppressParameter<std::vector<unsigned int>>("move_apps");
32  params.set<bool>("use_positions") = false;
33 
34  // use "batch-restore=2" to be consistent with SamplerFullSolveMultiApp and use the
35  // allow_out_of_range flag to allow the StochasticToolsTransfer object to inspect the MultiApp
36  // object parameters without triggering an assert.
37  MooseEnum modes("normal=0 batch-reset=1 batch-restore=2", "normal");
38  params.addParam<MooseEnum>(
39  "mode",
40  modes,
41  "The operation mode, 'normal' creates one sub-application for each row in the Sampler and "
42  "'batch-reset' and 'batch-restore' creates N sub-applications, where N is the minimum of "
43  "'num_rows' in the Sampler and floor(number of processes / min_procs_per_app). To run "
44  "the rows in the Sampler, 'batch-reset' will destroy and re-create sub-apps as needed, "
45  "whereas the 'batch-restore' will backup and restore sub-apps to the initial state prior "
46  "to execution, without destruction.");
47 
48  return params;
49 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
static InputParameters validParams()
T & set(const std::string &name, bool quiet_mode=false)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void suppressParameter(const std::string &name)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _batch_backup

std::vector<std::vector<std::unique_ptr<Backup> > > SamplerTransientMultiApp::_batch_backup
private

Storage for batch-restore mode; the outer vector if for the local stochastic data and the inner vector is for the number of sub-apps.

The later is 1 for this object, but it is included in case that changes in the future or in child classes

Definition at line 78 of file SamplerTransientMultiApp.h.

Referenced by initialSetup(), and solveStepBatch().

◆ _local_batch_app_index

dof_id_type SamplerTransientMultiApp::_local_batch_app_index
protected

Counter for extracting command line arguments in batch mode.

Definition at line 46 of file SamplerTransientMultiApp.h.

Referenced by getCommandLineArgsParamHelper(), and solveStepBatch().

◆ _local_row_index

dof_id_type SamplerTransientMultiApp::_local_row_index = std::numeric_limits<dof_id_type>::max()
private

Current local index representing _row_data.

Definition at line 83 of file SamplerTransientMultiApp.h.

Referenced by updateRowData().

◆ _mode

const StochasticTools::MultiAppMode SamplerTransientMultiApp::_mode
protected

The Sup-application solve mode.

Definition at line 43 of file SamplerTransientMultiApp.h.

Referenced by getCommandLineArgsParamHelper(), initialSetup(), SamplerTransientMultiApp(), solveStep(), and solveStepBatch().

◆ _number_of_sampler_rows

const dof_id_type SamplerTransientMultiApp::_number_of_sampler_rows
private

Store the number of rows initialized, if this changes error because it doesn't make sense.

Definition at line 74 of file SamplerTransientMultiApp.h.

Referenced by solveStep(), and solveStepBatch().

◆ _row_data

std::vector<Real> SamplerTransientMultiApp::_row_data
private

Current row of data updated by updateRowData. Used by transfers and setting command line args.

Definition at line 81 of file SamplerTransientMultiApp.h.

Referenced by getCommandLineArgsParamHelper(), solveStepBatch(), and updateRowData().

◆ _sampler

Sampler& SamplerTransientMultiApp::_sampler
protected

Sampler to utilize for creating MultiApps.

Definition at line 40 of file SamplerTransientMultiApp.h.

Referenced by SamplerTransientMultiApp(), solveStep(), and updateRowData().


The documentation for this class was generated from the following files: