https://mooseframework.inl.gov
SerializedSolutionTransfer.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
15 #include "SolutionContainer.h"
16 #include "UserObjectInterface.h"
17 
18 // Forward declarations
20 
27 {
28 public:
30 
32 
33  virtual void initialSetup() override;
34  virtual void execute() override;
35 
37 
40  void initializeFromMultiapp() override {}
41  void executeFromMultiapp() override;
42  void finalizeFromMultiapp() override {}
43 
44  void initializeToMultiapp() override {}
45  void executeToMultiapp() override {}
46  void finalizeToMultiapp() override {}
48 
49 protected:
53 
55  std::vector<VariableName> _variable_names;
56 
58  std::vector<SolutionContainer *> _solution_container;
59 
60 private:
62  void transferToSubAppRoot(FEProblemBase & app_problem,
63  SolutionContainer & solution_container,
64  const dof_id_type global_i);
65 
72  void transferInParallel(FEProblemBase & app_problem,
73  SolutionContainer & solution_container,
74  const dof_id_type global_i);
75 
82 
88  void initializeInBatchMode();
89 
93  SystemBase & getSystem(FEProblemBase & app_problem, const VariableName & vname);
94 
97  const bool _serialize_on_root;
98 };
void initializeFromMultiapp() override
Methods used when running in batch mode (see SamplerFullSolveMultiApp)
void initializeToMultiapp() override
Methods for transferring data to sub-applications to the master application.
void initializeInNormalMode()
Initializes the solution container if the multiapp is run in normal mode.
SerializedSolutionTransfer(const InputParameters &parameters)
void initializeInBatchMode()
This routine queries the solution container addresses from the subapps.
const bool _serialize_on_root
User-selected switch that determines if we want to serialize on the root of the subapp only or distri...
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.
The class creates an additional API to allow Transfers to work when running the StochasticTools<FullS...
static InputParameters validParams()
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...
SystemBase & getSystem(FEProblemBase &app_problem, const VariableName &vname)
Return the system which contains the given variable.
virtual void initialSetup() override
const InputParameters & parameters() const
ParallelSolutionStorage * _parallel_storage
The storage on the main application where the serialized solutions should be transferred.
This class is responsible for collecting solution vectors in one place.
std::vector< VariableName > _variable_names
The names of the variables which should be extracted from the solution vector.
This class is responsible for serializing solutions coming from subapps on specific processors...
A Reporter which stores serialized solution fields for given variables in a distributed fashion...
std::vector< SolutionContainer * > _solution_container
Link to the storage spaces on the subapplications (will only hold one in batch mode) ...
uint8_t dof_id_type