20#include "libmesh/system.h"
21#include "libmesh/mesh_function.h"
30 "Transfers field data at the MultiApp position using the finite element shape "
31 "functions from the origin application.");
49 "Cannot use nearest-position algorithm when sending from the main application");
56 "Matching division index is disabled for shape evaluation transfers");
61 const unsigned int var_index)
73 const unsigned int var_index, std::vector<libMesh::MeshFunction> & local_meshfuns)
78 for (
unsigned int i_from = 0; i_from <
_from_problems.size(); ++i_from)
87 System & from_sys = from_var.
sys().
system();
91 *from_sys.current_local_solution,
92 from_sys.get_dof_map(),
94 local_meshfuns.back().init();
102 const std::vector<std::pair<Point, unsigned int>> & incoming_points,
103 std::vector<std::pair<Real, Real>> & outgoing_vals)
111 const std::vector<BoundingBox> & local_bboxes,
112 std::vector<libMesh::MeshFunction> & local_meshfuns,
113 const std::vector<std::pair<Point, unsigned int>> & incoming_points,
114 std::vector<std::pair<Real, Real>> & outgoing_vals)
116 dof_id_type i_pt = 0;
117 for (
auto & [pt, mesh_div] : incoming_points)
119 bool point_found =
false;
139 auto val = (local_meshfuns[i_from])(local_pt);
164 if (
distance < outgoing_vals[i_pt].second)
166 outgoing_vals[i_pt].first = val;
167 outgoing_vals[i_pt].second =
distance;
registerMooseObject("MooseApp", MultiAppGeneralFieldShapeEvaluationTransfer)
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const override
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
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 isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
SystemBase & sys()
Get the system this variable is part of.
This class provides an interface for common operations on field variables of both FE and FV types wit...
const std::vector< VariableName > _from_var_names
Name of variables transferring from.
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...
Evaluates origin shape functions to compute the target variables.
MultiAppGeneralFieldShapeEvaluationTransfer(const InputParameters ¶meters)
static InputParameters validParams()
std::vector< libMesh::MeshFunction > _local_meshfuns
std::vector< libMesh::BoundingBox > _local_bboxes
virtual void evaluateInterpValues(const unsigned int, const std::vector< std::pair< Point, unsigned int > > &incoming_points, std::vector< std::pair< Real, Real > > &outgoing_vals) override
void evaluateInterpValuesWithMeshFunctions(const std::vector< BoundingBox > &local_bboxes, std::vector< libMesh::MeshFunction > &local_meshfuns, const std::vector< std::pair< Point, unsigned int > > &incoming_points, std::vector< std::pair< Real, Real > > &outgoing_vals)
virtual void prepareEvaluationOfInterpValues(const unsigned int var_index) override
void buildMeshFunctions(const unsigned int var_index, std::vector< libMesh::MeshFunction > &local_meshfuns)
It is a general field transfer.
const Positions * _nearest_positions_obj
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.
const MooseEnum & _from_mesh_division_behavior
How to use the origin mesh divisions to restrict the transfer.
const MooseEnum & _to_mesh_division_behavior
How to use the target mesh divisions to restrict the transfer.
static InputParameters validParams()
void registerConflict(unsigned int problem, dof_id_type dof_id, Point p, Real dist, bool local)
Register a potential value conflict, 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 bool _use_bounding_boxes
Whether to use bounding boxes to determine the applications that may receive point requests then send...
VariableName getFromVarName(unsigned int var_index) const
Get the source variable name, with the suffix for array/vector variables.
void extractLocalFromBoundingBoxes(std::vector< BoundingBox > &local_bboxes)
bool _search_value_conflicts
Whether to look for conflicts between origin points, multiple valid values for a target point.
bool _displaced_source_mesh
True if displaced mesh is used for the source mesh, otherwise false.
std::vector< FEProblemBase * > _from_problems
Point getPointInSourceAppFrame(const Point &p, unsigned int local_i_from, const std::string &phase) const
Get the source app point from a point in the reference frame.
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
unsigned int variable_number(std::string_view var) const
Real distance(const Point &p)