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();
101 const std::vector<std::pair<Point, unsigned int>> & incoming_points,
102 std::vector<std::pair<Real, Real>> & outgoing_vals)
110 const std::vector<BoundingBox> & local_bboxes,
111 std::vector<libMesh::MeshFunction> & local_meshfuns,
112 const std::vector<std::pair<Point, unsigned int>> & incoming_points,
113 std::vector<std::pair<Real, Real>> & outgoing_vals)
116 for (
auto & [pt, mesh_div] : incoming_points)
118 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;
virtual void evaluateInterpValues(const std::vector< std::pair< Point, unsigned int >> &incoming_points, std::vector< std::pair< Real, Real >> &outgoing_vals) override
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 ...
void registerConflict(unsigned int problem, dof_id_type dof_id, Point p, Real dist, bool local)
Register a potential value conflict, e.g.
static InputParameters validParams()
void buildMeshFunctions(const unsigned int var_index, std::vector< libMesh::MeshFunction > &local_meshfuns)
VariableName getFromVarName(unsigned int var_index)
Get the source variable name, with the suffix for array/vector variables.
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
const std::vector< VariableName > _from_var_names
Name of variables transferring from.
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)
Number BetterOutOfMeshValue
virtual void prepareEvaluationOfInterpValues(const unsigned int var_index) override
static InputParameters validParams()
This class provides an interface for common operations on field variables of both FE and FV types wit...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Real distance(const Point &p)
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...
const Positions * _nearest_positions_obj
unsigned int variable_number(std::string_view var) const
MultiAppGeneralFieldShapeEvaluationTransfer(const InputParameters ¶meters)
Evaluates origin shape functions to compute the target variables.
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...
const bool _use_bounding_boxes
Whether to use bounding boxes to determine the applications that may receive point requests then send...
bool acceptPointInOriginMesh(unsigned int i_from, const std::vector< BoundingBox > &local_bboxes, const Point &pt, const unsigned int mesh_div, Real &distance) const
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.
std::vector< libMesh::MeshFunction > _local_meshfuns
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.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MooseEnum & _to_mesh_division_behavior
How to use the target mesh divisions to restrict the transfer.
registerMooseObject("MooseApp", MultiAppGeneralFieldShapeEvaluationTransfer)
std::vector< std::unique_ptr< MultiAppCoordTransform > > _from_transforms
bool _displaced_source_mesh
True if displaced mesh is used for the source mesh, otherwise false.
void extractLocalFromBoundingBoxes(std::vector< BoundingBox > &local_bboxes)
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
std::vector< libMesh::BoundingBox > _local_bboxes
SystemBase & sys()
Get the system this variable is part of.
std::vector< FEProblemBase * > _from_problems
It is a general field transfer.
const MooseEnum & _from_mesh_division_behavior
How to use the origin mesh divisions to restrict the transfer.