19 #include "libmesh/meshfree_interpolation.h" 20 #include "libmesh/system.h" 30 "variable from different applications.");
32 "The name of the scalar variable to " 33 "transfer the value from.");
35 "The name of the scalar auxiliary variable to " 36 "transfer the value to.");
43 _from_variable_name(getParam<VariableName>(
"source_variable")),
44 _to_aux_name(getParam<VariableName>(
"to_aux_scalar"))
47 paramError(
"direction",
"This transfer is only unidirectional");
54 "MultiAppScalarToAuxScalarTransfer::execute()", 5,
"Performing a scalar variable transfer");
68 for (
unsigned int i = 0; i <
getToMultiApp()->numGlobalApps(); i++)
79 auto & from_values = from_variable->
sln();
82 if (from_variable->
sln().size() != to_variable->
sln().size())
83 mooseError(
"Order of SCALAR variables do not match for sending and " 84 "receiving data for the " 85 "MultiAppScalarToAuxScalarTransfer!");
87 for (MooseIndex(from_values) j = 0; j < from_values.size(); ++j)
119 auto & from_values = from_variable->
sln();
122 if (from_variable->
sln().size() != to_variable->
sln().size())
123 mooseError(
"Order of SCALAR variables do not match for sending and " 124 "receiving data for the " 125 "MultiAppScalarToAuxScalarTransfer!");
127 for (MooseIndex(from_values) j = 0; j < from_values.size(); ++j)
160 auto & from_values = from_variable->
sln();
163 if (from_variable->
sln().size() != to_variable->
sln().size())
164 mooseError(
"Order of SCALAR variables do not match for sending and " 165 "receiving data for the " 166 "MultiAppScalarToAuxScalarTransfer!");
168 for (MooseIndex(from_values) k = 0; k < from_values.size(); ++k)
189 mooseError(
"Child application allocation on parallel processes must be the same to support " 190 "siblings scalar variable transfer");
193 mooseError(
"Number of source and target child apps must match for siblings transfer");
VariableName _to_aux_name
The name of the auxiliary scalar variable to which the scalar values are being transfered.
const std::shared_ptr< MultiApp > getFromMultiApp() const
Get the MultiApp to transfer data from.
NumericVector< Number > & solution()
MooseEnum _current_direction
void reinit(bool reinit_for_derivative_reordering=false)
Fill out the VariableValue arrays from the system solution vector.
MultiAppScalarToAuxScalarTransfer(const InputParameters ¶meters)
virtual void execute() override
Execute the transfer.
unsigned int size() const
Return the number of active items in the MultiMooseEnum.
const std::shared_ptr< MultiApp > getToMultiApp() const
Get the MultiApp to transfer data to.
Copies the value of a SCALAR variable from one App to another.
VariableName _from_variable_name
The name of the scalar variable from which the values are being transfered.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual void checkSiblingsTransferSupported() const override
Whether the transfer supports siblings transfer.
virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the scalar variable reference from whichever system contains it.
virtual const std::vector< dof_id_type > & dofIndices() const
Get local DoF indices.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
static InputParameters validParams()
MultiMooseEnum _directions
The directions this Transfer is to be executed on.
Base class for all MultiAppTransfer objects.
Class for scalar variables (they are different).
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
virtual void set(const numeric_index_type i, const Number value)=0
SystemBase & sys()
Get the system this variable is part of.
registerMooseObject("MooseApp", MultiAppScalarToAuxScalarTransfer)
static InputParameters validParams()
const VariableValue & sln() const