21 #include "libmesh/system.h" 22 #include "libmesh/mesh_function.h" 31 "Transfers user object spatial evaluations from an origin app onto a variable in the target " 34 params.
set<std::vector<VariableName>>(
"source_variable") = std::vector<VariableName>{};
37 "The UserObject you want to transfer values from. " 38 "It must implement the SpatialValue() class routine");
50 _user_object_name(getParam<UserObjectName>(
"source_user_object"))
53 paramError(
"variable",
"Only one variable at a time is supported by this transfer");
59 "Source block restriction cannot be used at the same type as allowing extrapolation" 60 " of values for a user object transfer (with 'from_app_must_contain_point=false') " 61 " unless an extrapolation constant is provided (with 'extrapolation_constant')");
66 "Cannot use nearest-position algorithm when sending from the main application");
100 const std::vector<std::pair<Point, unsigned int>> & incoming_points,
101 std::vector<std::pair<Real, Real>> & outgoing_vals)
108 const std::vector<BoundingBox> & local_bboxes,
109 const std::vector<std::pair<Point, unsigned int>> & incoming_points,
110 std::vector<std::pair<Real, Real>> & outgoing_vals)
113 for (
auto & [pt, mesh_div] : incoming_points)
115 bool point_found =
false;
162 if (
distance < outgoing_vals[i_pt].second)
164 outgoing_vals[i_pt].first = val;
165 outgoing_vals[i_pt].second =
distance;
const ExecFlagType EXEC_TRANSFER
bool _source_app_must_contain_point
Whether the source app mesh must actually contain the points for them to be considered or whether the...
MooseEnum _current_direction
void evaluateInterpValuesWithUserObjects(const std::vector< BoundingBox > &local_bboxes, const std::vector< std::pair< Point, unsigned int >> &incoming_points, std::vector< std::pair< Real, Real >> &outgoing_vals)
void registerConflict(unsigned int problem, dof_id_type dof_id, Point p, Real dist, bool local)
Register a potential value conflict, e.g.
virtual void execute() override
Execute the transfer.
virtual void execute() override
Execute the transfer.
Number BetterOutOfMeshValue
FEProblemBase & _fe_problem
static InputParameters validParams()
static InputParameters validParams()
std::vector< BoundingBox > _local_bboxes
Real distance(const Point &p)
const Positions * _nearest_positions_obj
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
const bool _use_bounding_boxes
Whether to use bounding boxes to determine the applications that may receive point requests then send...
void errorIfObjectExecutesOnTransferInSourceApp(const std::string &object_name) const
Error if executing this MooseObject on EXEC_TRANSFER in a source multiapp (from_multiapp, e.g.
bool acceptPointInOriginMesh(unsigned int i_from, const std::vector< BoundingBox > &local_bboxes, const Point &pt, const unsigned int mesh_div, Real &distance) const
const std::vector< AuxVariableName > _to_var_names
Name of variables transferring to.
bool _search_value_conflicts
Whether to look for conflicts between origin points, multiple valid values for a target point...
unsigned int getGlobalSourceAppIndex(unsigned int i_from) const
Return the global app index from the local index in the "from-multiapp" transfer direction.
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 ...
bool detectConflict(Real value_1, Real value_2, Real distance_1, Real distance_2) const
Detects whether two source values are valid and equidistant for a desired target location.
virtual void prepareEvaluationOfInterpValues(const unsigned int) override
virtual void evaluateInterpValues(const std::vector< std::pair< Point, unsigned int >> &incoming_points, std::vector< std::pair< Real, Real >> &outgoing_vals) override
Transfers values computed in the origin mesh by the source user object spatialValue() routine at loca...
const std::string _user_object_name
Name of the source user object in all the source problems.
registerMooseObject("MooseApp", MultiAppGeneralFieldUserObjectTransfer)
virtual Real spatialValue(const Point &) const
Optional interface function for "evaluating" a UserObject at a spatial position.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< std::unique_ptr< MultiAppCoordTransform > > _from_transforms
void extractLocalFromBoundingBoxes(std::vector< BoundingBox > &local_bboxes)
const InputParameters & parameters() const
Get the parameters of the object.
MultiAppGeneralFieldUserObjectTransfer(const InputParameters ¶meters)
virtual void computeUserObjectByName(const ExecFlagType &type, const Moose::AuxGroup &group, const std::string &name)
Compute an user object with the given name.
std::vector< FEProblemBase * > _from_problems
Base class for user-specific data.
It is a general field transfer.