17 #include "libmesh/threads.h" 21 const std::vector<dof_id_type> & trial_primary_nodes,
22 const std::map<
dof_id_type, std::vector<dof_id_type>> & node_to_elem_map,
23 const unsigned int patch_size,
27 _trial_primary_nodes(trial_primary_nodes),
28 _node_to_elem_map(node_to_elem_map),
29 _patch_size(patch_size)
36 : _kd_tree(x._kd_tree),
38 _trial_primary_nodes(x._trial_primary_nodes),
39 _node_to_elem_map(x._node_to_elem_map),
40 _patch_size(x._patch_size)
53 unsigned int patch_size =
56 std::vector<std::size_t> return_index(patch_size);
58 for (
const auto & node_id : range)
63 query_pt(i) = node(i);
77 std::vector<dof_id_type> neighbor_nodes(return_index.size());
78 for (
unsigned int i = 0; i < return_index.size(); ++i)
91 bool need_to_track =
false;
93 if (
_mesh.
nodeRef(node_id).processor_id() == processor_id)
101 const std::vector<dof_id_type> & elems_connected_to_node = node_to_elem_pair->second;
104 for (
const auto & dof : elems_connected_to_node)
107 need_to_track =
true;
115 for (
const auto & neighbor_node_id : neighbor_nodes)
117 if (
_mesh.
nodeRef(neighbor_node_id).processor_id() == processor_id)
118 need_to_track =
true;
123 "Missing entry in node to elem map");
124 const std::vector<dof_id_type> & elems_connected_to_node = node_to_elem_pair->second;
126 for (
const auto & dof : elems_connected_to_node)
129 need_to_track =
true;
153 const std::vector<dof_id_type> & elems_connected_to_node = node_to_elem_pair->second;
155 for (
const auto & dof : elems_connected_to_node)
160 for (
unsigned int neighbor_it = 0; neighbor_it < neighbor_nodes.size(); neighbor_it++)
164 "Missing entry in node to elem map");
165 const std::vector<dof_id_type> & elems_connected_to_node = node_to_elem_pair->second;
167 for (
const auto & dof : elems_connected_to_node)
const std::vector< dof_id_type > & _trial_primary_nodes
Nodes to search against.
void join(const SecondaryNeighborhoodThread &other)
const std::map< dof_id_type, std::vector< dof_id_type > > & _node_to_elem_map
Node to elem map.
SecondaryNeighborhoodThread(const MooseMesh &mesh, const std::vector< dof_id_type > &trial_primary_nodes, const std::map< dof_id_type, std::vector< dof_id_type >> &node_to_elem_map, const unsigned int patch_size, KDTree &_kd_tree)
virtual Elem * elemPtr(const dof_id_type i)
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
virtual const Node & nodeRef(const dof_id_type i) const
void operator()(const NodeIdRange &range)
Save a patch of nodes that are close to each of the secondary nodes to speed the search algorithm TOD...
uint8_t processor_id_type
std::map< dof_id_type, std::vector< dof_id_type > > _neighbor_nodes
The neighborhood nodes associated with each node.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
void neighborSearch(const Point &query_point, unsigned int patch_size, std::vector< std::size_t > &return_index)
std::set< dof_id_type > _ghosted_elems
Elements that we need to ghost.
unsigned int _patch_size
The number of nodes to keep.
IntRange< T > make_range(T beg, T end)
processor_id_type processor_id() const
const MooseMesh & _mesh
The Mesh.
auto min(const L &left, const R &right)
std::vector< dof_id_type > _secondary_nodes
List of the secondary nodes we're actually going to keep track of.