19#include "libmesh/meshfree_interpolation.h"
20#include "libmesh/system.h"
29 params.
addClassDescription(
"Transfers from a postprocessor to a scalar auxiliary variable.");
31 "from_postprocessor",
"The name of the Postprocessor to transfer the value from.");
33 "to_aux_scalar",
"The name of the scalar AuxVariable to transfer the value to.");
42 _from_pp_name(getParam<PostprocessorName>(
"from_postprocessor")),
43 _to_aux_name(getParam<VariableName>(
"to_aux_scalar"))
46 paramError(
"direction",
"This transfer is only unidirectional");
52 TIME_SECTION(
"MultiAppPostprocessorToAuxScalarTransfer::execute()",
54 "Performing transfer between a scalar variable and a postprocessor");
112 for (
unsigned int i = 0; i <
getToMultiApp()->numGlobalApps(); i++)
148 if (num_apps != scalar.
sln().size())
151 ") must be equal to the order of the scalar AuxVariable (",
178 for (
const auto i : make_range(
getToMultiApp()->numGlobalApps()))
180 mooseError(
"Child application allocation on parallel processes must be the same to support "
181 "siblings postprocessor to scalar variable transfer");
184 mooseError(
"Number of source and target child apps must match for siblings transfer");
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
const ExecFlagType EXEC_TRANSFER
registerMooseObject("MooseApp", MultiAppPostprocessorToAuxScalarTransfer)
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName &name, std::size_t t_index=0) const
Get a read-only reference to the value associated with a Postprocessor that exists.
virtual void computeUserObjectByName(const ExecFlagType &type, const Moose::AuxGroup &group, const std::string &name)
Compute an user object with the given name.
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 ...
virtual const std::vector< dof_id_type > & dofIndices() const
Get local DoF indices.
SystemBase & sys()
Get the system this variable is part of.
libMesh::Order order() const
Get the order of this variable Note: Order enum can be implicitly converted to unsigned int.
Class for scalar variables (they are different).
const VariableValue & sln() const
void insert(NumericVector< Number > &soln)
void reinit(bool reinit_for_derivative_reordering=false)
Fill out the VariableValue arrays from the system solution vector.
void setValues(Number value)
Set all of the values of this scalar variable to the same value.
Copies the value of a Postprocessor from one app to a scalar AuxVariable in another.
VariableName _to_aux_name
The name of the field variable to which the postprocessor is being transferred.
virtual void execute() override
Execute the transfer.
virtual void checkSiblingsTransferSupported() const override
Whether the transfer supports siblings transfer.
MultiAppPostprocessorToAuxScalarTransfer(const InputParameters ¶meters)
static InputParameters validParams()
PostprocessorName _from_pp_name
The name of the postprocessor that the transfer originates.
Base class for all MultiAppTransfer objects.
void errorIfObjectExecutesOnTransferInSourceApp(const std::string &object_name) const
Error if executing this MooseObject on EXEC_TRANSFER in a source multiapp (from_multiapp,...
static void addUserObjectExecutionCheckParam(InputParameters ¶ms)
Add the execution order check parameter (to skip the warning if needed)
void checkParentAppUserObjectExecuteOn(const std::string &object_name) const
Checks the execute_on flags for user object transfers with user objects on the source app which is al...
const std::shared_ptr< MultiApp > getToMultiApp() const
Get the MultiApp to transfer data to.
static InputParameters validParams()
const std::shared_ptr< MultiApp > getFromMultiApp() const
Get the MultiApp to transfer data from.
unsigned int size() const
Return the number of active items in the MultiMooseEnum.
NumericVector< Number > & solution()
MultiMooseEnum _directions
The directions this Transfer is to be executed on.
FEProblemBase & _fe_problem
MooseEnum _current_direction
virtual void set(const numeric_index_type i, const T value)=0