https://mooseframework.inl.gov
MultiAppFieldTransfer.C
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 // MOOSE includes
11 #include "MultiAppFieldTransfer.h"
12 #include "FEProblemBase.h"
13 #include "DisplacedProblem.h"
14 #include "MooseVariableFEBase.h"
15 #include "MooseMesh.h"
16 #include "SystemBase.h"
17 #include "MooseAppCoordTransform.h"
18 #include "MooseMeshUtils.h"
19 
20 #include "libmesh/system.h"
21 
24 {
26  return params;
27 }
28 
30  : MultiAppTransfer(parameters)
31 {
32 }
33 
34 void
36 {
38 
40  for (auto & to_var : getToVarNames())
41  variableIntegrityCheck(to_var, false);
43  for (auto & from_var : getFromVarNames())
44  variableIntegrityCheck(from_var, true);
45  else
46  {
47  for (auto & to_var : getToVarNames())
48  variableIntegrityCheck(to_var, false);
49  for (auto & from_var : getFromVarNames())
50  variableIntegrityCheck(from_var, true);
51  }
52 }
53 
54 EquationSystems &
55 MultiAppFieldTransfer::getEquationSystem(FEProblemBase & problem, bool use_displaced) const
56 {
57  if (use_displaced)
58  {
59  if (!problem.getDisplacedProblem())
60  mooseError("No displaced problem to provide a displaced equation system");
61  return problem.getDisplacedProblem()->es();
62  }
63  else
64  return problem.es();
65 }
MooseEnum _current_direction
Definition: Transfer.h:106
void variableIntegrityCheck(const AuxVariableName &var_name, bool is_from_multiapp) const
Utility to verify that the variable in the destination system exists.
virtual void initialSetup()
Method called at the beginning of the simulation for checking integrity or doing one-time setup...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
static InputParameters validParams()
libMesh::EquationSystems & getEquationSystem(FEProblemBase &problem, bool use_displaced) const
Returns the Problem's equation system, displaced or not Be careful! If you transfer TO a displaced sy...
void initialSetup() override
Method called at the beginning of the simulation for checking integrity or doing one-time setup...
virtual libMesh::EquationSystems & es() override
static InputParameters validParams()
virtual std::shared_ptr< const DisplacedProblem > getDisplacedProblem() const
Base class for all MultiAppTransfer objects.
virtual std::vector< AuxVariableName > getToVarNames() const =0
Virtual function defining variables to transfer to.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
virtual std::vector< VariableName > getFromVarNames() const =0
Virtual function defining variables to be transferred.
MultiAppFieldTransfer(const InputParameters &parameters)