https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MultiAppGeneralFieldTransfer.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
13#include "KDTree.h"
14#include "PointIndexedMap.h"
15
16#include "libmesh/generic_projector.h"
17#include "libmesh/meshfree_interpolation.h"
18#include "libmesh/system.h"
19#include "libmesh/mesh_function.h"
20#include "libmesh/parallel_algebra.h" // for communicator send and receive stuff
21
22class Positions;
23class MeshDivision;
24
38{
39public:
41
43
44 virtual void initialSetup() override;
45 virtual void getAppInfo() override;
46 virtual void execute() override;
47 virtual void postExecute() override;
48
50 VariableName getFromVarName(unsigned int var_index) const;
51
53 VariableName getToVarName(unsigned int var_index);
54
55protected:
57 virtual void checkSiblingsTransferSupported() const override {}
58
60 MooseVariableFieldBase * getToVariable(unsigned int var_index) const
61 {
62 return _to_variables[var_index];
63 }
64
71 virtual std::string getDataSourceName(unsigned int var_index) const;
72
73 /*
74 * Prepare evaluation of interpolation values
75 * @param var_index index of the variable & component to prepare for. This routine is called once
76 * for each variable and component to transfer
77 */
78 virtual void prepareEvaluationOfInterpValues(const unsigned int var_index) = 0;
79
80 /*
81 * Evaluate interpolation values for incoming points
82 * @param var_index the index of the variable being transferred (same for source & target)
83 * @param incoming_points vector of point requests with an additional integer to add constraints
84 * on the source regions
85 * @param outgoing_vals vector of (evaluated value, distance to value location) for each of the
86 * incoming point requests
87 */
88 virtual void
89 evaluateInterpValues(const unsigned int var_index,
90 const std::vector<std::pair<Point, unsigned int>> & incoming_points,
91 std::vector<std::pair<Real, Real>> & outgoing_vals) = 0;
92
93 /*
94 * Local from bounding boxes for current processor
95 * @param local_bboxes vector of the local (to this process) bounding boxes
96 * for the source applications
97 */
98 void extractLocalFromBoundingBoxes(std::vector<BoundingBox> & local_bboxes);
99
100 /*
101 * Whether all source mesh checks pass on the given points:
102 * - within the source mesh bounding box
103 * - inside source block restriction
104 * - inside source boundary restriction / in an element near the origin boundary restriction
105 * - inside source mesh division and at the same index as in the target mesh division
106 * - inside app mesh (if not already known to be inside a block or near a boundary)
107 * @param i_from the index of the source problem/mesh
108 * @param local_bboxes the bounding boxes for the local applications
109 * @param pt the point to consider (in reference frame, not source or target frame)
110 * @param mesh_div index of the point to consider in the target mesh division.
111 * If mesh divisions are used to match regions between two meshes, then the index
112 * must match in the target and source mesh divisions
113 * @param distance distance from the point to the target mesh division. This may be used to favor
114 * a point over another, for example in a nearest-positions algorithm where we want
115 * to report the distance of the point pt to the closest position of the 1-NN partition
116 */
117 bool acceptPointInOriginMesh(unsigned int i_from,
118 const std::vector<BoundingBox> & local_bboxes,
119 const Point & pt,
120 const unsigned int mesh_div,
121 Real & distance) const;
122
123 /*
124 * Whether or not a given point is within the mesh of an origin (from) app
125 * @param pl locator for the mesh of the source app
126 * @param pt point in the local coordinates of the source app we're considering
127 */
128 bool inMesh(const libMesh::PointLocatorBase * const pl, const Point & pt) const;
129
130 /*
131 * Whether or not a given element is part of the given blocks
132 * Passing the mesh is useful to override the definition of the block restriction
133 */
134 bool inBlocks(const std::set<SubdomainID> & blocks, const Elem * elem) const;
135 virtual bool
136 inBlocks(const std::set<SubdomainID> & blocks, const MooseMesh & mesh, const Elem * elem) const;
137
138 /*
139 * Whether or not a given node is part of an element in the given blocks
140 * @param blocks list of blocks to examine.
141 * @param mesh containing the element and the node
142 * @param node node to consider
143 * A node is in a block if an element it is part of is in that block
144 */
145 bool
146 inBlocks(const std::set<SubdomainID> & blocks, const MooseMesh & mesh, const Node * node) const;
147
148 /*
149 * Whether or not a given point is part of an element in the given blocks
150 * @param blocks list of blocks to examine
151 * @param point locator to find the point in the blocks
152 * @param pt point to examine, in the local coordinates (same as the point locator)
153 */
154 bool inBlocks(const std::set<SubdomainID> & blocks,
155 const libMesh::PointLocatorBase * const pl,
156 const Point & pt) const;
157
158 /*
159 * Whether or not a given node is part of the given boundaries
160 */
161 bool onBoundaries(const std::set<BoundaryID> & boundaries,
162 const MooseMesh & mesh,
163 const Node * node) const;
164
165 /*
166 * Whether or not a given element is near the specified boundaries
167 * Depending on the '_elemental_boundary_restriction_on_sides' this can mean it shares a side or
168 * a node with the boundary
169 */
170 bool onBoundaries(const std::set<BoundaryID> & boundaries,
171 const MooseMesh & mesh,
172 const Elem * elem) const;
173
174 /*
175 * Whether or not a point is inside an element that is near the specified boundaries
176 * See onBoundaries(bd, mesh, elem) for definition of near
177 * @param boundaries boundaries of interest for whether the point is near one
178 * @param block_restriction limits the size of the mesh to search for the point.
179 * Note: an empty set means ALL blocks should be considered
180 * @param mesh the mesh to look for the boundaries in
181 * @param pl the point locator that searches the mesh
182 * @param pt the point we want to know whether it is close to a boundary (local coordinates)
183 */
184 bool onBoundaries(const std::set<BoundaryID> & boundaries,
185 const std::set<SubdomainID> & block_restriction,
186 const MooseMesh & mesh,
187 const libMesh::PointLocatorBase * const pl,
188 const Point & pt) const;
189
198 bool acceptPointMeshDivision(const Point & pt,
199 const unsigned int i_local,
200 const unsigned int only_from_this_mesh_div) const;
201
208 bool closestToPosition(unsigned int pos_index, const Point & pt) const;
209
211 const std::vector<unsigned int> _from_var_components;
212
214 const std::vector<unsigned int> _to_var_components;
215
219
222 // NOTE: Keeping track of that distance is not optimal efficiency-wise, because we could find the
223 // closest app and only query the point from there. However, if the value from the closest
224 // app is invalid and the second closest is valid, then the results can vary in parallel
225 // If both apps are the same rank, the closest app is used, the point has an invalid value
226 // If each app are on a different rank, the second closest return a valid value, it gets
227 // used
228
229 // Positions object to use to match target points and origin points as closest to the same
230 // Position
232
236
238 std::set<SubdomainID> _from_blocks;
239
241 std::set<SubdomainID> _to_blocks;
242
244 std::set<BoundaryID> _to_boundaries;
245
247 std::set<BoundaryID> _from_boundaries;
248
250 std::vector<const MeshDivision *> _from_mesh_divisions;
251
253 std::vector<const MeshDivision *> _to_mesh_divisions;
254
257
260
268
271
273 std::vector<std::unique_ptr<libMesh::PointLocatorBase>> _from_point_locators;
274
277 std::vector<unsigned int> _global_app_start_per_proc;
278
283
286
289
292
295
305 bool detectConflict(Real value_1, Real value_2, Real distance_1, Real distance_2) const;
306
318 void registerConflict(unsigned int problem, dof_id_type dof_id, Point p, Real dist, bool local);
319
320private:
322 std::vector<MooseVariableFieldBase *> _to_variables;
323
325 typedef std::unordered_map<processor_id_type, std::vector<std::pair<Point, unsigned int>>>
327
330 {
331 unsigned int problem_id; // problem id
332 dof_id_type dof_object_id; // node or elem id
333 };
334
337 {
338 processor_id_type pid; // Processor id type
339 Real interp; // Interpolation
340 Real distance; // distance from target to source
341 };
342
344 typedef std::unordered_map<processor_id_type, std::vector<PointInfo>> ProcessorToPointInfoVec;
345
347 typedef std::vector<std::unordered_map<dof_id_type, InterpInfo>> DofobjectToInterpValVec;
348
353
355 typedef std::vector<InterpCache> InterpCaches;
356
358 unsigned int _var_size;
359
362
365
368
370 std::vector<Real> _fixed_bbox_size;
371
373 std::vector<unsigned int> _froms_per_proc;
374
379 std::vector<BoundingBox> _from_bboxes;
380
383
388 std::vector<std::tuple<unsigned int, dof_id_type, Point, Real>> _local_conflicts;
389
394 std::vector<std::tuple<unsigned int, dof_id_type, Point, Real>> _received_conflicts;
395
399 void prepareToTransfer();
400
404 void transferVariable(unsigned int i);
405
406 /*
407 * Extract to-points for which we need to compute interpolation values on the source domains
408 */
409 void extractOutgoingPoints(const unsigned int var_index, ProcessorToPointVec & outgoing_points);
410
411 /*
412 * Which processors include this point
413 */
414 void locatePointReceivers(const Point point, std::set<processor_id_type> & processors);
415
416 /*
417 * cache incoming values
418 */
420 processor_id_type pid,
421 const unsigned int var_index,
422 std::vector<PointInfo> & pointInfoVec,
423 const std::vector<std::pair<Point, unsigned int>> & point_requests,
424 const std::vector<std::pair<Real, Real>> & incoming_vals,
425 DofobjectToInterpValVec & dofobject_to_valsvec, // for nodal + constant monomial
426 InterpCaches & interp_caches, // for higher order elemental values
427 InterpCaches & distance_caches); // same but helps make origin point decisions
428
438 void examineReceivedValueConflicts(const unsigned int var_index,
439 const DofobjectToInterpValVec & dofobject_to_valsvec,
440 const InterpCaches & distance_caches);
441
452 void examineLocalValueConflicts(const unsigned int var_index,
453 const DofobjectToInterpValVec & dofobject_to_valsvec,
454 const InterpCaches & distance_caches);
455
457 void outputValueConflicts(const unsigned int var_index,
458 const DofobjectToInterpValVec & dofobject_to_valsvec,
459 const InterpCaches & distance_caches);
460
461 /*
462 * Set values to solution
463 * @param var the variable to set
464 * @param dofobject_to_valsvec a vector of maps from DoF to values, for each to_problem
465 * Used for nodal + constant monomial variables
466 * @param interp_caches a vector of maps from point to value, for each to_problem
467 * Used for higher order elemental variables
468 */
469 void setSolutionVectorValues(const unsigned int var_index,
470 const DofobjectToInterpValVec & dofobject_to_valsvec,
471 const InterpCaches & interp_caches);
472
473 /*
474 * Modify the solution values after having set AND synchronized the solution
475 * @param var the variable to set
476 * @param dofobject_to_valsvec a vector of maps from DoF to values, for each to_problem
477 * Used for nodal + constant monomial variables
478 * @param interp_caches a vector of maps from point to value, for each to_problem
479 * Used for higher order elemental variables
480 */
481 void correctSolutionVectorValues(const unsigned int var_index,
482 const DofobjectToInterpValVec & dofobject_to_valsvec,
483 const InterpCaches & interp_caches);
484
485 /*
486 * Cache pointInfo
487 */
488 void cacheOutgoingPointInfo(const Point point,
489 const dof_id_type dof_object_id,
490 const unsigned int problem_id,
491 ProcessorToPointVec & outgoing_points);
492
498 Real bboxMinDistance(const Point & p, const BoundingBox & bbox) const;
499
505 Real bboxMaxDistance(const Point & p, const BoundingBox & bbox) const;
506
511 Point getMaxToProblemsBBoxDimensions() const;
512
516 std::vector<BoundingBox> getRestrictedFromBoundingBoxes() const;
517
522 std::vector<unsigned int> getGlobalStartAppPerProc() const;
523};
524
525// Anonymous namespace for data, functors to use with GenericProjector.
527{
528// Transfer::OutOfMeshValue is an actual number. Why? Why!
529static_assert(std::numeric_limits<Real>::has_infinity,
530 "What are you trying to use for Real? It lacks infinity!");
531extern Number OutOfMeshValue;
532
533inline bool
535{
536 // Might need to be changed for e.g. NaN
538}
539
540// We need two functors that record point (value and gradient,
541// respectively) requests, so we know what queries we need to make
542// to other processors
543
547template <typename Output>
549{
550protected:
552
553public:
557
559
560 RecordRequests(RecordRequests & primary) : _primary(&primary) {}
561
563 {
564 if (_primary)
565 {
566 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
569 }
570 }
571
573
575 unsigned int /*variable_index*/,
576 unsigned int /*elem_dim*/,
577 const Node & n,
578 bool /*extra_hanging_dofs*/,
579 const Real /*time*/)
580 {
581 _points_requested.push_back(n);
582 return 0;
583 }
584
586 unsigned int /*variable_index*/,
587 const Point & n,
588 const Real /*time*/,
589 bool /*skip_context_check*/)
590 {
591 _points_requested.push_back(n);
592 return 0;
593 }
594
595 bool is_grid_projection() { return false; }
596
598 unsigned int /*i*/,
599 unsigned int /*dim*/,
600 const Node & /*n*/,
601 std::vector<Output> & /*derivs*/)
602 {
603 mooseError("Not implemented");
604 } // this is only for grid projections
605
607 const Elem &, unsigned int, unsigned int, std::vector<dof_id_type> &, std::vector<Output> &)
608 {
609 mooseError("Not implemented");
610 }
611
612 void eval_old_dofs(const Elem &,
613 const libMesh::FEType &,
614 unsigned int,
615 unsigned int,
616 std::vector<dof_id_type> &,
617 std::vector<Output> &)
618 {
619 mooseError("Not implemented");
620 }
621
622 std::vector<Point> & points_requested() { return _points_requested; }
623
624private:
626 std::vector<Point> _points_requested;
627
629};
630
631// We need a null action functor to use
632// with them (because we won't be ready to set any values at that point)
633template <typename Val>
635{
636public:
637 typedef Val InsertInput;
638
640
641 void insert(dof_id_type, Val) {}
642
643 void insert(const std::vector<dof_id_type> &, const DenseVector<Val> &) {}
644};
645
646// We need two functors that respond to point (value and gradient,
647// respectively) requests based on the cached values of queries answered by
648// other processors.
649
653template <typename Output>
655{
656protected:
658
659public:
661
665
671 CachedData(const Cache & cache, const libMesh::FunctionBase<Output> & backup, Real default_value)
672 : _cache(cache), _backup(backup.clone()), _default_value(default_value)
673 {
674 }
675
677 CachedData(const CachedData & primary)
678 : _cache(primary._cache),
679 _backup(primary._backup->clone()),
681 {
682 }
683
685
688 unsigned int /*i*/,
689 unsigned int /*elem_dim*/,
690 const Node & n,
691 bool /*extra_hanging_dofs*/,
692 const Real /*time*/)
693 {
694 auto it = _cache.find(n);
695 if (it == _cache.end())
696 {
698 return _default_value;
699 else
700 return (*_backup)(n);
701 }
702 else
703 return it->second;
704 }
705
708 unsigned int /*i*/,
709 const Point & n,
710 const Real /*time*/,
711 bool /*skip_context_check*/)
712 {
713 auto it = _cache.find(n);
714 if (it == _cache.end())
715 {
717 return _default_value;
718 else
719 return (*_backup)(n);
720 }
721 else
722 return it->second;
723 }
724
725 bool is_grid_projection() { return false; }
726
728 unsigned int /*i*/,
729 unsigned int /*dim*/,
730 const Node & /*n*/,
731 std::vector<Output> & /*derivs*/)
732 {
733 mooseError("Not implemented");
734 } // this is only for grid projections
735
737 const Elem &, unsigned int, unsigned int, std::vector<dof_id_type> &, std::vector<Output> &)
738 {
739 mooseError("Not implemented");
740 }
741
742 void eval_old_dofs(const Elem &,
743 const libMesh::FEType &,
744 unsigned int,
745 unsigned int,
746 std::vector<dof_id_type> &,
747 std::vector<Output> &)
748 {
749 mooseError("Not implemented");
750 }
751
752private:
754 const Cache & _cache;
755
757 std::unique_ptr<libMesh::FunctionBase<Output>> _backup;
758
760 const Real _default_value;
761};
762
763}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
char ** blocks
Value request response base class.
std::unique_ptr< libMesh::FunctionBase< Output > > _backup
Function to evaluate for uncached points.
CachedData(const Cache &cache, const libMesh::FunctionBase< Output > &backup, Real default_value)
Constructor.
Output eval_at_node(const libMesh::FEMContext &, unsigned int, unsigned int, const Node &n, bool, const Real)
Gets a value at the node location.
libMesh::TensorTools::MakeBaseNumber< Output >::type DofValueType
const Cache & _cache
Data to return for cached points.
void eval_old_dofs(const Elem &, unsigned int, unsigned int, std::vector< dof_id_type > &, std::vector< Output > &)
Output eval_at_point(const libMesh::FEMContext &, unsigned int, const Point &n, const Real, bool)
Gets a value at a point.
void eval_mixed_derivatives(const libMesh::FEMContext &, unsigned int, unsigned int, const Node &, std::vector< Output > &)
const Real _default_value
Default value when no point is found.
void eval_old_dofs(const Elem &, const libMesh::FEType &, unsigned int, unsigned int, std::vector< dof_id_type > &, std::vector< Output > &)
CachedData(const CachedData &primary)
Copy constructor.
libMesh::TensorTools::MakeReal< Output >::type RealType
void insert(const std::vector< dof_id_type > &, const DenseVector< Val > &)
libMesh::TensorTools::MakeBaseNumber< Output >::type DofValueType
Output eval_at_node(const libMesh::FEMContext &, unsigned int, unsigned int, const Node &n, bool, const Real)
void eval_mixed_derivatives(const libMesh::FEMContext &, unsigned int, unsigned int, const Node &, std::vector< Output > &)
void eval_old_dofs(const Elem &, unsigned int, unsigned int, std::vector< dof_id_type > &, std::vector< Output > &)
Output eval_at_point(const libMesh::FEMContext &, unsigned int, const Point &n, const Real, bool)
void eval_old_dofs(const Elem &, const libMesh::FEType &, unsigned int, unsigned int, std::vector< dof_id_type > &, std::vector< Output > &)
std::vector< Point > _points_requested
Vector of points requested.
libMesh::TensorTools::MakeReal< Output >::type RealType
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Base class for MeshDivision objects.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
This class provides an interface for common operations on field variables of both FE and FV types wit...
Transfers variables on possibly different meshes while conserving a user defined property (Postproces...
It is a general field transfer.
std::vector< Real > _fixed_bbox_size
Set the bounding box sizes manually.
virtual bool inBlocks(const std::set< SubdomainID > &blocks, const MooseMesh &mesh, const Elem *elem) const
std::set< BoundaryID > _to_boundaries
Target boundary(ies) restriction.
const bool _use_nearest_app
Whether to keep track of the distance from the requested point to the app position.
void prepareToTransfer()
Initialize supporting attributes like bounding boxes, processor app indexes etc.
const MooseEnum _post_transfer_extrapolation
How to post treat after the transfer.
bool acceptPointMeshDivision(const Point &pt, const unsigned int i_local, const unsigned int only_from_this_mesh_div) const
Whether a point lies inside the mesh division delineated by the MeshDivision object.
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.
void outputValueConflicts(const unsigned int var_index, const DofobjectToInterpValVec &dofobject_to_valsvec, const InterpCaches &distance_caches)
Report on conflicts between overlapping child apps, equidistant origin points etc.
void transferVariable(unsigned int i)
Performs the transfer for the variable of index i.
const Real _default_extrapolation_value
Value to use when no received data is valid for a target location.
virtual void getAppInfo() override
This method will fill information into the convenience member variables (_to_problems,...
std::vector< std::unordered_map< dof_id_type, InterpInfo > > DofobjectToInterpValVec
A vector, indexed by to-problem id, of maps from dof object to interpolation values.
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.
virtual std::string getDataSourceName(unsigned int var_index) const
Return a human-readable description of the data source (variable, functor, user object,...
void cacheOutgoingPointInfo(const Point point, const dof_id_type dof_object_id, const unsigned int problem_id, ProcessorToPointVec &outgoing_points)
bool _source_app_must_contain_point
Whether the source app mesh must actually contain the points for them to be considered or whether the...
std::vector< unsigned int > getGlobalStartAppPerProc() const
Get global index for the first app each processes owns Requires a global communication,...
std::vector< std::unique_ptr< libMesh::PointLocatorBase > > _from_point_locators
Point locators, useful to examine point location with regards to domain restriction.
std::vector< MooseVariableFieldBase * > _to_variables
The target variables.
bool inBlocks(const std::set< SubdomainID > &blocks, const libMesh::PointLocatorBase *const pl, const Point &pt) const
std::vector< unsigned int > _global_app_start_per_proc
First app each processor owns, indexed by processor If no app on the processor, will have a -1 for th...
const std::vector< unsigned int > _from_var_components
Origin array/vector variable components.
void setSolutionVectorValues(const unsigned int var_index, const DofobjectToInterpValVec &dofobject_to_valsvec, const InterpCaches &interp_caches)
std::unordered_map< processor_id_type, std::vector< PointInfo > > ProcessorToPointInfoVec
A map from pid to a set of point info.
bool onBoundaries(const std::set< BoundaryID > &boundaries, const std::set< SubdomainID > &block_restriction, const MooseMesh &mesh, const libMesh::PointLocatorBase *const pl, const Point &pt) const
bool _error_on_miss
Error out when some points can not be located.
bool inBlocks(const std::set< SubdomainID > &blocks, const Elem *elem) const
void cacheIncomingInterpVals(processor_id_type pid, const unsigned int var_index, std::vector< PointInfo > &pointInfoVec, const std::vector< std::pair< Point, unsigned int > > &point_requests, const std::vector< std::pair< Real, Real > > &incoming_vals, DofobjectToInterpValVec &dofobject_to_valsvec, InterpCaches &interp_caches, InterpCaches &distance_caches)
Real _bbox_factor
How much we should relax bounding boxes.
VariableName getToVarName(unsigned int var_index)
Get the target variable name, with the suffix for array/vector variables.
std::vector< BoundingBox > _from_bboxes
Bounding boxes for all source applications.
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.
bool onBoundaries(const std::set< BoundaryID > &boundaries, const MooseMesh &mesh, const Node *node) const
Real bboxMinDistance(const Point &p, const BoundingBox &bbox) const
Compute minimum distance.
PointIndexedMap InterpCache
A map from Point to interpolation values NOTE: this is not an asynchronous cache.
MeshDivisionTransferUse
Matching enum for the mesh division behaviors.
virtual void evaluateInterpValues(const unsigned int var_index, const std::vector< std::pair< Point, unsigned int > > &incoming_points, std::vector< std::pair< Real, Real > > &outgoing_vals)=0
const bool _elemental_boundary_restriction_on_sides
Whether elemental variable boundary restriction is considered by element side or element nodes.
const std::vector< unsigned int > _to_var_components
Target array/vector variable components.
bool acceptPointInOriginMesh(unsigned int i_from, const std::vector< BoundingBox > &local_bboxes, const Point &pt, const unsigned int mesh_div, Real &distance) const
bool closestToPosition(unsigned int pos_index, const Point &pt) const
Whether a point is closest to a position at the index specified than any other position.
virtual void prepareEvaluationOfInterpValues(const unsigned int var_index)=0
std::set< SubdomainID > _from_blocks
Origin block(s) restriction.
virtual void initialSetup() override
Method called at the beginning of the simulation for checking integrity or doing one-time setup.
void extractOutgoingPoints(const unsigned int var_index, ProcessorToPointVec &outgoing_points)
void examineLocalValueConflicts(const unsigned int var_index, const DofobjectToInterpValVec &dofobject_to_valsvec, const InterpCaches &distance_caches)
Remove potential value conflicts that did not materialize because another source was closer Several e...
void locatePointReceivers(const Point point, std::set< processor_id_type > &processors)
ProcessorToPointInfoVec _processor_to_pointInfoVec
A map from processor to pointInfo vector.
virtual void checkSiblingsTransferSupported() const override
Siblings transfers fully supported.
unsigned int _var_size
The number of variables to transfer.
std::vector< std::tuple< unsigned int, dof_id_type, Point, Real > > _local_conflicts
Keeps track of all local equidistant points to requested points, creating an indetermination in which...
const bool _use_bounding_boxes
Whether to use bounding boxes to determine the applications that may receive point requests then send...
Real bboxMaxDistance(const Point &p, const BoundingBox &bbox) const
Compute max distance.
MooseVariableFieldBase * getToVariable(unsigned int var_index) const
Return a pointer to a target variable.
std::vector< const MeshDivision * > _from_mesh_divisions
Division of the origin mesh.
std::set< SubdomainID > _to_blocks
Target block(s) restriction.
std::vector< const MeshDivision * > _to_mesh_divisions
Division of the target mesh.
void examineReceivedValueConflicts(const unsigned int var_index, const DofobjectToInterpValVec &dofobject_to_valsvec, const InterpCaches &distance_caches)
Remove potential value conflicts that did not materialize because another source was closer Several e...
void correctSolutionVectorValues(const unsigned int var_index, const DofobjectToInterpValVec &dofobject_to_valsvec, const InterpCaches &interp_caches)
bool inMesh(const libMesh::PointLocatorBase *const pl, const Point &pt) const
Point getMaxToProblemsBBoxDimensions() const
Obtains the max dimensions to scale all points in the mesh.
const unsigned int _search_value_conflicts_max_log
How many conflicts are output to console.
bool _already_output_search_value_conflicts
Whether we already output the search value conflicts.
bool _greedy_search
Whether or not a greedy strategy will be used If true, all the partitions will be checked for a given...
std::vector< InterpCache > InterpCaches
A vector of such caches, indexed by to_problem.
VariableName getFromVarName(unsigned int var_index) const
Get the source variable name, with the suffix for array/vector variables.
std::vector< std::tuple< unsigned int, dof_id_type, Point, Real > > _received_conflicts
Keeps track of all received conflicts.
std::unordered_map< processor_id_type, std::vector< std::pair< Point, unsigned int > > > ProcessorToPointVec
A map from pid to a set of points.
std::vector< BoundingBox > getRestrictedFromBoundingBoxes() const
Get from bounding boxes for given domains and boundaries.
std::vector< unsigned int > _froms_per_proc
Number of source/from applications per processor. This vector is indexed by processor id.
virtual void postExecute() override
Add some extra work if necessary after execute().
std::set< BoundaryID > _from_boundaries
Origin boundary(ies) restriction.
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.
Based class for output objects.
Definition Output.h:52
Positions objects are under the hood Reporters.
Definition Positions.h:21
spin_mutex spin_mtx
An unordered map indexed by Point, eg 3 floating point numbers Because floating point rounding errors...
std::unordered_map< Point, Number, hash_point >::const_iterator end() const
std::unordered_map< Point, Number, hash_point >::const_iterator find(const Point &pt) const