www.mooseframework.org
MultiAppTransfer.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "Transfer.h"
14 #include "MooseEnum.h"
15 
16 #include "libmesh/bounding_box.h"
17 
18 // Forward declarations
19 class MultiAppTransfer;
20 class MooseMesh;
21 class MultiApp;
22 
23 template <>
25 
35 class MultiAppTransfer : public Transfer
36 {
37 public:
39 
40  enum DIRECTION
41  {
44  };
45 
47  static MooseEnum directions() { return MooseEnum("to_multiapp from_multiapp"); }
48 
50  int direction() { return _direction; }
51 
55  void variableIntegrityCheck(const AuxVariableName & var_name) const;
56 
58  const std::shared_ptr<MultiApp> getMultiApp() const { return _multi_app; }
59 
61  virtual const std::vector<ExecFlagType> & execFlags() const;
62 
63 protected:
65  std::shared_ptr<MultiApp> _multi_app;
66 
69 
74  void getAppInfo();
75 
76  std::vector<FEProblemBase *> _to_problems;
77  std::vector<FEProblemBase *> _from_problems;
78  std::vector<EquationSystems *> _to_es;
79  std::vector<EquationSystems *> _from_es;
80  std::vector<MooseMesh *> _to_meshes;
81  std::vector<MooseMesh *> _from_meshes;
82  std::vector<Point> _to_positions;
83  std::vector<Point> _from_positions;
84 
89 
91 
97  std::vector<BoundingBox> getFromBoundingBoxes();
98  std::vector<BoundingBox> getFromBoundingBoxes(BoundaryID boundary_id);
100 
104  std::vector<unsigned int> getFromsPerProc();
105 
110  NumericVector<Real> & getTransferVector(unsigned int i_local, std::string var_name);
111 
112  // Given local app index, returns global app index.
113  std::vector<unsigned int> _local2global_map;
114 
121  void checkMultiAppExecuteOn();
122 };
NumericVector< Real > & getTransferVector(unsigned int i_local, std::string var_name)
If we are transferring to a multiapp, return the appropriate solution vector.
std::vector< EquationSystems * > _to_es
void checkMultiAppExecuteOn()
Helper method for checking the &#39;check_multiapp_execute_on&#39; flag.
MultiAppTransfer(const InputParameters &parameters)
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.
bool _displaced_target_mesh
True if displaced mesh is used for the target mesh, otherwise false.
std::vector< MooseMesh * > _from_meshes
void variableIntegrityCheck(const AuxVariableName &var_name) const
Utility to verify that the vEariable in the destination system exists.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
static MooseEnum directions()
Used to construct InputParameters.
boundary_id_type BoundaryID
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:31
int direction()
The direction this Transfer is going in.
std::vector< unsigned int > _local2global_map
std::vector< Point > _to_positions
const std::shared_ptr< MultiApp > getMultiApp() const
Return the MultiApp that this transfer belongs to.
InputParameters validParams< MultiAppTransfer >()
Base class for all MultiAppTransfer objects.
std::vector< EquationSystems * > _from_es
bool _displaced_source_mesh
True if displaced mesh is used for the source mesh, otherwise false.
const MooseEnum _direction
Whether we&#39;re transferring to or from the MultiApp.
virtual const std::vector< ExecFlagType > & execFlags() const
Return the execution flags, handling "same_as_multiapp".
A MultiApp represents one or more MOOSE applications that are running simultaneously.
Definition: MultiApp.h:57
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:40