https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
12#include "FEProblemBase.h"
13#include "DisplacedProblem.h"
14#include "MooseVariableFEBase.h"
15#include "MooseMesh.h"
16#include "SystemBase.h"
18#include "MooseMeshUtils.h"
19
20#include "libmesh/system.h"
21
28
33
34void
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
54EquationSystems &
55MultiAppFieldTransfer::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}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual libMesh::EquationSystems & es() override
virtual std::shared_ptr< const DisplacedProblem > getDisplacedProblem() const
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
virtual std::vector< VariableName > getFromVarNames() const =0
Virtual function defining variables to be transferred.
virtual std::vector< AuxVariableName > getToVarNames() const =0
Virtual function defining variables to transfer to.
virtual void initialSetup()
Method called at the beginning of the simulation for checking integrity or doing one-time setup.
static InputParameters validParams()
MultiAppFieldTransfer(const InputParameters &parameters)
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...
Base class for all MultiAppTransfer objects.
void initialSetup() override
Method called at the beginning of the simulation for checking integrity or doing one-time setup.
static InputParameters validParams()
void variableIntegrityCheck(const AuxVariableName &var_name, bool is_from_multiapp) const
Utility to verify that the variable in the destination system exists.
@ FROM_MULTIAPP
Definition Transfer.h:71
@ TO_MULTIAPP
Definition Transfer.h:70
MooseEnum _current_direction
Definition Transfer.h:106