https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
28public:
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
49protected:
53
55 std::vector<VariableName> _variable_names;
56
58 std::vector<SolutionContainer *> _solution_container;
59
60private:
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
89
93 SystemBase & getSystem(FEProblemBase & app_problem, const VariableName & vname);
94
98};
const InputParameters & parameters() const
A Reporter which stores serialized solution fields for given variables in a distributed fashion.
This class is responsible for serializing solutions coming from subapps on specific processors.
void initializeToMultiapp() override
Methods for transferring data to sub-applications to the master application.
std::vector< SolutionContainer * > _solution_container
Link to the storage spaces on the subapplications (will only hold one in batch mode)
SystemBase & getSystem(FEProblemBase &app_problem, const VariableName &vname)
Return the system which contains the given variable.
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...
const bool _serialize_on_root
User-selected switch that determines if we want to serialize on the root of the subapp only or distri...
std::vector< VariableName > _variable_names
The names of the variables which should be extracted from the solution vector.
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.
static InputParameters validParams()
void initializeInBatchMode()
This routine queries the solution container addresses from the subapps.
ParallelSolutionStorage * _parallel_storage
The storage on the main application where the serialized solutions should be transferred.
void initializeInNormalMode()
Initializes the solution container if the multiapp is run in normal mode.
void initializeFromMultiapp() override
Methods used when running in batch mode (see SamplerFullSolveMultiApp)
This class is responsible for collecting solution vectors in one place.
The class creates an additional API to allow Transfers to work when running the StochasticTools<FullS...