https://mooseframework.inl.gov
SamplerTransientMultiApp.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 // MOOSE includes
13 #include "TransientMultiApp.h"
14 #include "SamplerInterface.h"
15 
16 #include "StochasticToolsTypes.h"
17 
18 class Sampler;
20 
22 {
23 public:
25 
27 
31  virtual bool solveStep(Real dt, Real target_time, bool auto_advance = true) override;
32 
36  virtual void initialSetup() override;
37 
38 protected:
41 
44 
47 
49  virtual std::vector<std::string> getCommandLineArgs(const unsigned int local_app) override;
50 
51 private:
55  bool solveStepBatch(Real dt, Real target_time, bool auto_advance = true);
56 
61  void updateRowData(dof_id_type local_index);
62 
70  std::vector<std::shared_ptr<StochasticToolsTransfer>>
72 
78  std::vector<std::vector<std::unique_ptr<Backup>>> _batch_backup;
79 
81  std::vector<Real> _row_data;
83  dof_id_type _local_row_index = std::numeric_limits<dof_id_type>::max();
84 };
std::vector< Real > _row_data
Current row of data updated by updateRowData. Used by transfers and setting command line args...
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...
static InputParameters validParams()
virtual std::vector< std::string > getCommandLineArgs(const unsigned int local_app) override
Override to allow to get correct cli_args.
The class creates an additional API to allow Transfers to work when running the StochasticTools<FullS...
void updateRowData(dof_id_type local_index)
Helper function for updating _row_data and _local_row_index.
virtual bool solveStep(Real dt, Real target_time, bool auto_advance=true) override
Override solveStep to allow for batch execution.
dof_id_type _local_row_index
Current local index representing _row_data.
SamplerTransientMultiApp(const InputParameters &parameters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool solveStepBatch(Real dt, Real target_time, bool auto_advance=true)
Helper method for running in mode=&#39;batch&#39;.
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.
virtual void initialSetup() override
Override to initialize batch backups.
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...