This class is responsible for serializing solutions coming from subapps on specific processors. More...
#include <SerializedSolutionTransfer.h>
Public Types | |
enum | DIRECTION |
typedef DataFileName | DataFileParameterType |
Public Member Functions | |
SerializedSolutionTransfer (const InputParameters ¶meters) | |
virtual void | initialSetup () override |
virtual void | execute () override |
void | setGlobalMultiAppIndex (dof_id_type index) |
Method for setting the app index when running in batch mode. More... | |
void | setGlobalRowIndex (dof_id_type row) |
Method for keeping track of the global row index when running in batch mode. More... | |
void | setCurrentRow (const std::vector< Real > &row) |
Method for keeping track of the row data when running in batch mode. More... | |
void | variableIntegrityCheck (const AuxVariableName &var_name, bool is_from_multiapp) const |
const std::shared_ptr< MultiApp > | getMultiApp () const |
const std::shared_ptr< MultiApp > | getFromMultiApp () const |
const std::shared_ptr< MultiApp > | getToMultiApp () const |
std::string | getFromName () const |
std::string | getToName () const |
bool | hasFromMultiApp () const |
bool | hasToMultiApp () const |
virtual void | getAppInfo () |
const MultiMooseEnum & | directions () |
void | setCurrentDirection (const int direction) |
virtual bool | enabled () const |
std::shared_ptr< MooseObject > | getSharedPtr () |
std::shared_ptr< const MooseObject > | getSharedPtr () const |
MooseApp & | getMooseApp () 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 ¶meter_name) const |
const InputParameters & | parameters () const |
MooseObjectName | uniqueName () const |
const T & | getParam (const std::string &name) const |
std::vector< std::pair< T1, T2 > > | getParam (const std::string ¶m1, const std::string ¶m2) const |
const T * | queryParam (const std::string &name) const |
const T & | getRenamedParam (const std::string &old_name, const std::string &new_name) const |
T | 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 ¶m, Args... args) const |
void | paramWarning (const std::string ¶m, Args... args) const |
void | paramInfo (const std::string ¶m, Args... args) const |
void | connectControllableParams (const std::string ¶meter, 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 ¶m) const |
std::string | getDataFileNameByName (const std::string &relative_path) const |
std::string | getDataFilePath (const std::string &relative_path) const |
virtual void | timestepSetup () |
virtual void | jacobianSetup () |
virtual void | residualSetup () |
virtual void | subdomainSetup () |
virtual void | customSetup (const ExecFlagType &) |
const ExecFlagEnum & | getExecuteOnEnum () const |
PerfGraph & | perfGraph () |
MooseEnum | direction () |
MooseEnum | direction () |
MooseEnum | currentDirection () |
MooseEnum | currentDirection () |
const Parallel::Communicator & | comm () const |
processor_id_type | n_processors () const |
processor_id_type | processor_id () const |
void | initializeFromMultiapp () override |
Methods used when running in batch mode (see SamplerFullSolveMultiApp) More... | |
void | executeFromMultiapp () override |
void | finalizeFromMultiapp () override |
void | initializeToMultiapp () override |
Methods for transferring data to sub-applications to the master application. More... | |
void | executeToMultiapp () override |
void | finalizeToMultiapp () override |
Static Public Member Functions | |
static InputParameters | validParams () |
static void | addSkipCoordCollapsingParam (InputParameters ¶ms) |
static libMesh::System * | find_sys (libMesh::EquationSystems &es, const std::string &var_name) |
static std::string | possibleDirections () |
Public Attributes | |
TO_MULTIAPP | |
FROM_MULTIAPP | |
BETWEEN_MULTIAPP | |
const ConsoleStream | _console |
Static Public Attributes | |
static const libMesh::Number | OutOfMeshValue |
Protected Member Functions | |
std::vector< unsigned int > | getFromsPerProc () |
libMesh::NumericVector< Real > & | getTransferVector (unsigned int i_local, std::string var_name) |
unsigned int | getGlobalSourceAppIndex (unsigned int i_from) const |
unsigned int | getGlobalTargetAppIndex (unsigned int i_to) const |
unsigned int | getLocalSourceAppIndex (unsigned int i_from) const |
virtual void | checkSiblingsTransferSupported () const |
void | errorIfObjectExecutesOnTransferInSourceApp (const std::string &object_name) const |
Point | getPointInTargetAppFrame (const Point &p, unsigned int local_i_to, const std::string &phase) const |
void | checkMultiAppExecuteOn () |
void | checkVariable (const FEProblemBase &fe_problem, const VariableName &var_name, const std::string ¶m_name="") const |
void | extendBoundingBoxes (const Real factor, std::vector< libMesh::BoundingBox > &bboxes) const |
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 §ion_name, const unsigned int level) const |
PerfID | registerTimedSection (const std::string §ion_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const |
std::string | timedSectionName (const std::string §ion_name) const |
std::vector< libMesh::BoundingBox > | getFromBoundingBoxes () |
std::vector< libMesh::BoundingBox > | getFromBoundingBoxes (BoundaryID boundary_id) |
std::vector< libMesh::BoundingBox > | getFromBoundingBoxes () |
std::vector< libMesh::BoundingBox > | getFromBoundingBoxes (BoundaryID boundary_id) |
Static Protected Member Functions | |
static void | addBBoxFactorParam (InputParameters ¶ms) |
static void | transformBoundingBox (libMesh::BoundingBox &box, const MultiAppCoordTransform &transform) |
Protected Attributes | |
ParallelSolutionStorage * | _parallel_storage |
The storage on the main application where the serialized solutions should be transferred. More... | |
std::vector< VariableName > | _variable_names |
The names of the variables which should be extracted from the solution vector. More... | |
std::vector< SolutionContainer * > | _solution_container |
Link to the storage spaces on the subapplications (will only hold one in batch mode) More... | |
dof_id_type | _app_index = 0 |
Index for the sub-app that the batch-mode multiapp is working on. More... | |
dof_id_type | _global_index = 0 |
Index for tracking the row index when using batch mode operation. More... | |
std::vector< Real > | _row_data |
The current row of data (comes from multiapp) More... | |
Sampler * | _sampler_ptr |
Pointer to the Sampler object used by the SamplerTransientMultiApp or SamplerFullSolveMultiApp. More... | |
std::shared_ptr< MultiApp > | _multi_app |
std::vector< FEProblemBase *> | _to_problems |
std::vector< FEProblemBase *> | _from_problems |
std::vector< libMesh::EquationSystems *> | _to_es |
std::vector< libMesh::EquationSystems *> | _from_es |
std::vector< MooseMesh *> | _to_meshes |
std::vector< MooseMesh *> | _from_meshes |
std::vector< Point > | _to_positions |
std::vector< Point > | _from_positions |
std::vector< std::unique_ptr< MultiAppCoordTransform > > | _to_transforms |
std::vector< std::unique_ptr< MultiAppCoordTransform > > | _from_transforms |
const bool | _skip_coordinate_collapsing |
bool | _displaced_source_mesh |
bool | _displaced_target_mesh |
Real | _bbox_factor |
std::vector< unsigned int > | _to_local2global_map |
std::vector< unsigned int > | _from_local2global_map |
SubProblem & | _subproblem |
FEProblemBase & | _fe_problem |
SystemBase & | _sys |
THREAD_ID | _tid |
MultiMooseEnum | _directions |
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 |
MooseEnum | _direction |
MooseEnum | _current_direction |
const Parallel::Communicator & | _communicator |
Private Member Functions | |
void | transferToSubAppRoot (FEProblemBase &app_problem, SolutionContainer &solution_container, const dof_id_type global_i) |
Serialize on the root processor of the subapplication and transfer the result to the main application. More... | |
void | transferInParallel (FEProblemBase &app_problem, SolutionContainer &solution_container, const dof_id_type global_i) |
Serialize on methodically determined rank of the subapp and transfer to the main application. More... | |
void | initializeInNormalMode () |
Initializes the solution container if the multiapp is run in normal mode. More... | |
void | initializeInBatchMode () |
This routine queries the solution container addresses from the subapps. More... | |
SystemBase & | getSystem (FEProblemBase &app_problem, const VariableName &vname) |
Return the system which contains the given variable. More... | |
Private Attributes | |
const bool | _serialize_on_root |
User-selected switch that determines if we want to serialize on the root of the subapp only or distribute the solutions between all the ranks of the subapp. More... | |
This class is responsible for serializing solutions coming from subapps on specific processors.
It is designed to serve as an interface between SolutionContainer and ParallelSolutionStorage objects.
Definition at line 26 of file SerializedSolutionTransfer.h.
SerializedSolutionTransfer::SerializedSolutionTransfer | ( | const InputParameters & | parameters | ) |
Definition at line 37 of file SerializedSolutionTransfer.C.
|
overridevirtual |
Implements MultiAppTransfer.
Definition at line 84 of file SerializedSolutionTransfer.C.
|
overridevirtual |
Reimplemented from StochasticToolsTransfer.
Definition at line 111 of file SerializedSolutionTransfer.C.
|
inlineoverridevirtual |
Reimplemented from StochasticToolsTransfer.
Definition at line 45 of file SerializedSolutionTransfer.h.
|
inlineoverridevirtual |
Reimplemented from StochasticToolsTransfer.
Definition at line 42 of file SerializedSolutionTransfer.h.
|
inlineoverridevirtual |
Reimplemented from StochasticToolsTransfer.
Definition at line 46 of file SerializedSolutionTransfer.h.
|
private |
Return the system which contains the given variable.
It can either be a flavor of a nonlinear system or the auxiliary system.
vname | The name of the variable whose system is queried |
Definition at line 211 of file SerializedSolutionTransfer.C.
Referenced by transferInParallel(), and transferToSubAppRoot().
|
inlineoverridevirtual |
Methods used when running in batch mode (see SamplerFullSolveMultiApp)
Reimplemented from StochasticToolsTransfer.
Definition at line 40 of file SerializedSolutionTransfer.h.
|
private |
This routine queries the solution container addresses from the subapps.
We need to redo this every time initialSetup() (batch-reset) is called on the subapp because the address of SolutionContainer changes. Considering that the transfer doesn't know the multiapp setting, we use the same approach for batch-restore as well, which might be a little wasteful if the execution of the subapps is very fast (usually not the case).
Definition at line 71 of file SerializedSolutionTransfer.C.
Referenced by executeFromMultiapp().
|
private |
Initializes the solution container if the multiapp is run in normal mode.
We need this because in normal mode we don't have a function for initialization besides initialSetup()
, which is execute every time regardless of the multiapp settings.
Definition at line 55 of file SerializedSolutionTransfer.C.
Referenced by execute().
|
inlineoverridevirtual |
Methods for transferring data to sub-applications to the master application.
Reimplemented from StochasticToolsTransfer.
Definition at line 44 of file SerializedSolutionTransfer.h.
|
overridevirtual |
Reimplemented from MultiAppTransfer.
Definition at line 47 of file SerializedSolutionTransfer.C.
Method for keeping track of the row data when running in batch mode.
See StochasticTools<FullSolve/Transient>MultiApp
Definition at line 65 of file StochasticToolsTransfer.h.
|
inlineinherited |
Method for setting the app index when running in batch mode.
See StochasticTools<FullSolve/Transient>MultiApp
Definition at line 51 of file StochasticToolsTransfer.h.
|
inlineinherited |
Method for keeping track of the global row index when running in batch mode.
See StochasticTools<FullSolve/Transient>MultiApp
Definition at line 58 of file StochasticToolsTransfer.h.
|
private |
Serialize on methodically determined rank of the subapp and transfer to the main application.
Example: Let's say we have 5 samples and 3 processors on a sub-application. In this case, we will serialize the first two on rank 1, the second two on rank 2 and the last one on rank 3.
Definition at line 130 of file SerializedSolutionTransfer.C.
Referenced by execute(), and executeFromMultiapp().
|
private |
Serialize on the root processor of the subapplication and transfer the result to the main application.
Definition at line 183 of file SerializedSolutionTransfer.C.
Referenced by execute(), and executeFromMultiapp().
|
static |
Definition at line 18 of file SerializedSolutionTransfer.C.
|
protectedinherited |
Index for the sub-app that the batch-mode multiapp is working on.
Definition at line 69 of file StochasticToolsTransfer.h.
Referenced by executeFromMultiapp(), SamplerParameterTransfer::executeToMultiapp(), initializeInBatchMode(), and StochasticToolsTransfer::setGlobalMultiAppIndex().
|
protectedinherited |
Index for tracking the row index when using batch mode operation.
Definition at line 71 of file StochasticToolsTransfer.h.
Referenced by PODResidualTransfer::executeFromMultiapp(), PODSamplerSolutionTransfer::executeFromMultiapp(), executeFromMultiapp(), SamplerReporterTransfer::executeFromMultiapp(), PODSamplerSolutionTransfer::executeToMultiapp(), and StochasticToolsTransfer::setGlobalRowIndex().
|
protected |
The storage on the main application where the serialized solutions should be transferred.
Definition at line 52 of file SerializedSolutionTransfer.h.
Referenced by initialSetup(), transferInParallel(), and transferToSubAppRoot().
|
protectedinherited |
The current row of data (comes from multiapp)
Definition at line 73 of file StochasticToolsTransfer.h.
Referenced by SamplerParameterTransfer::executeToMultiapp(), and StochasticToolsTransfer::setCurrentRow().
|
protectedinherited |
Pointer to the Sampler object used by the SamplerTransientMultiApp or SamplerFullSolveMultiApp.
Definition at line 76 of file StochasticToolsTransfer.h.
Referenced by SamplerParameterTransfer::execute(), PODSamplerSolutionTransfer::execute(), execute(), SamplerReporterTransfer::execute(), SamplerPostprocessorTransfer::execute(), SamplerPostprocessorTransfer::initializeFromMultiapp(), SamplerReporterTransfer::intitializeStochasticReporters(), StochasticToolsTransfer::StochasticToolsTransfer(), transferInParallel(), and SamplerReporterTransfer::transferStochasticReporters().
|
private |
User-selected switch that determines if we want to serialize on the root of the subapp only or distribute the solutions between all the ranks of the subapp.
Definition at line 97 of file SerializedSolutionTransfer.h.
Referenced by execute(), and executeFromMultiapp().
|
protected |
Link to the storage spaces on the subapplications (will only hold one in batch mode)
Definition at line 58 of file SerializedSolutionTransfer.h.
Referenced by execute(), executeFromMultiapp(), initializeInBatchMode(), and initializeInNormalMode().
|
protected |
The names of the variables which should be extracted from the solution vector.
Definition at line 55 of file SerializedSolutionTransfer.h.
Referenced by transferInParallel(), and transferToSubAppRoot().