www.mooseframework.org
MultiAppTransfer.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef MULTIAPPTRANSFER_H
16 #define MULTIAPPTRANSFER_H
17 
18 // MOOSE includes
19 #include "Transfer.h"
20 #include "MooseEnum.h"
21 
22 #include "libmesh/bounding_box.h"
23 
24 // Forward declarations
25 class MultiAppTransfer;
26 class MooseMesh;
27 class MultiApp;
28 
29 template <>
31 
41 class MultiAppTransfer : public Transfer
42 {
43 public:
45 
46  enum DIRECTION
47  {
50  };
51 
53  static MooseEnum directions() { return MooseEnum("to_multiapp from_multiapp"); }
54 
56  int direction() { return _direction; }
57 
61  void variableIntegrityCheck(const AuxVariableName & var_name) const;
62 
64  const std::shared_ptr<MultiApp> getMultiApp() const { return _multi_app; }
65 
67  virtual const std::vector<ExecFlagType> & execFlags() const;
68 
69 protected:
71  std::shared_ptr<MultiApp> _multi_app;
72 
75 
80  void getAppInfo();
81 
82  std::vector<FEProblemBase *> _to_problems;
83  std::vector<FEProblemBase *> _from_problems;
84  std::vector<EquationSystems *> _to_es;
85  std::vector<EquationSystems *> _from_es;
86  std::vector<MooseMesh *> _to_meshes;
87  std::vector<MooseMesh *> _from_meshes;
88  std::vector<Point> _to_positions;
89  std::vector<Point> _from_positions;
90 
93 
98  std::vector<BoundingBox> getFromBoundingBoxes();
99 
103  std::vector<unsigned int> getFromsPerProc();
104 
109  NumericVector<Real> & getTransferVector(unsigned int i_local, std::string var_name);
110 
111  // Given local app index, returns global app index.
112  std::vector<unsigned int> _local2global_map;
113 };
114 
115 #endif /* MULTIAPPTRANSFER_H */
NumericVector< Real > & getTransferVector(unsigned int i_local, std::string var_name)
If we are transferring to a multiapp, return the appropriate solution vector.
void variableIntegrityCheck(const AuxVariableName &var_name) const
Utility to verify that the vEariable in the destination system exists.
std::vector< EquationSystems * > _to_es
MultiAppTransfer(const InputParameters &parameters)
Here we need to remove the special option that indicates to the user that this object will follow it&#39;...
std::vector< BoundingBox > getFromBoundingBoxes()
Return the bounding boxes of all the "from" domains, including all the domains not local to this proc...
std::vector< FEProblemBase * > _to_problems
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::vector< Point > _from_positions
std::shared_ptr< MultiApp > _multi_app
The MultiApp this Transfer is transferring data to or from.
std::vector< MooseMesh * > _from_meshes
MooseEnum _direction
Whether we&#39;re transferring to or from the MultiApp.
static MooseEnum directions()
Used to construct InputParameters.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
std::vector< unsigned int > getFromsPerProc()
Return the number of "from" domains that each processor owns.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:37
int direction()
The direction this Transfer is going in.
std::vector< unsigned int > _local2global_map
virtual const std::vector< ExecFlagType > & execFlags() const
Return the execution flags, handling "same_as_multiapp".
std::vector< Point > _to_positions
InputParameters validParams< MultiAppTransfer >()
Base class for all MultiAppTransfer objects.
std::vector< EquationSystems * > _from_es
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
A MultiApp represents one or more MOOSE applications that are running simultaneously.
Definition: MultiApp.h:59
void getAppInfo()
This method will fill information into the convenience member variables (_to_problems, _from_meshes, etc.)
std::vector< FEProblemBase * > _from_problems
std::vector< MooseMesh * > _to_meshes
Base class for all Transfer objects.
Definition: Transfer.h:46
const std::shared_ptr< MultiApp > getMultiApp() const
Return the MultiApp that this transfer belongs to.