www.mooseframework.org
SlaveNeighborhoodThread.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef SLAVENEIGHBORHOODTHREAD_H
16 #define SLAVENEIGHBORHOODTHREAD_H
17 
18 // MOOSE includes
19 #include "MooseTypes.h"
20 #include "NearestNodeLocator.h"
21 #include "KDTree.h"
22 
23 // Forward declarations
24 class MooseMesh;
25 class NearestNodeLocator;
26 class KDTree;
27 
29 {
30 public:
32 
34  const std::vector<dof_id_type> & trial_master_nodes,
35  const std::map<dof_id_type, std::vector<dof_id_type>> & node_to_elem_map,
36  const unsigned int patch_size,
37  KDTree & _kd_tree);
38 
40  SlaveNeighborhoodThread(SlaveNeighborhoodThread & x, Threads::split split);
41 
42  void operator()(const NodeIdRange & range);
43 
44  void join(const SlaveNeighborhoodThread & other);
45 
47  std::vector<dof_id_type> _slave_nodes;
48 
50  std::map<dof_id_type, std::vector<dof_id_type>> _neighbor_nodes;
51 
53  std::set<dof_id_type> _ghosted_elems;
54 
55 protected:
57  const MooseMesh & _mesh;
58 
60  const std::vector<dof_id_type> & _trial_master_nodes;
61 
63  const std::map<dof_id_type, std::vector<dof_id_type>> & _node_to_elem_map;
64 
66  unsigned int _patch_size;
67 };
68 
69 #endif // SLAVENEIGHBORHOODTHREAD_H
Definition: KDTree.h:23
StoredRange< std::vector< dof_id_type >::iterator, dof_id_type > NodeIdRange
Definition: MooseTypes.h:81
const std::map< dof_id_type, std::vector< dof_id_type > > & _node_to_elem_map
Node to elem map.
Finds the nearest node to each node in boundary1 to each node in boundary2 and the other way around...
void operator()(const NodeIdRange &range)
Save a patch of nodes that are close to each of the slave nodes to speed the search algorithm TODO: T...
static PetscErrorCode Vec x
std::set< dof_id_type > _ghosted_elems
Elements that we need to ghost.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
std::map< dof_id_type, std::vector< dof_id_type > > _neighbor_nodes
The neighborhood nodes associated with each node.
SlaveNeighborhoodThread(const MooseMesh &mesh, const std::vector< dof_id_type > &trial_master_nodes, const std::map< dof_id_type, std::vector< dof_id_type >> &node_to_elem_map, const unsigned int patch_size, KDTree &_kd_tree)
void join(const SlaveNeighborhoodThread &other)
std::vector< dof_id_type > _slave_nodes
List of the slave nodes we&#39;re actually going to keep track of.
const std::vector< dof_id_type > & _trial_master_nodes
Nodes to search against.
unsigned int _patch_size
The number of nodes to keep.
const MooseMesh & _mesh
The Mesh.