www.mooseframework.org
Public Member Functions | Public Attributes | Protected Attributes | List of all members
AllLocalDofIndicesThread Class Reference

Grab all the local dof indices for the variables passed in, in the system passed in. More...

#include <AllLocalDofIndicesThread.h>

Public Member Functions

 AllLocalDofIndicesThread (System &sys, std::vector< std::string > vars)
 
 AllLocalDofIndicesThread (AllLocalDofIndicesThread &x, Threads::split split)
 
void operator() (const ConstElemRange &range)
 
void join (const AllLocalDofIndicesThread &y)
 

Public Attributes

std::set< dof_id_type > _all_dof_indices
 

Protected Attributes

System & _sys
 
DofMap & _dof_map
 
std::vector< std::string > _vars
 
std::vector< unsigned int > _var_numbers
 
THREAD_ID _tid
 

Detailed Description

Grab all the local dof indices for the variables passed in, in the system passed in.

Definition at line 33 of file AllLocalDofIndicesThread.h.

Constructor & Destructor Documentation

LIBMESH_DEFINE_HASH_POINTERS AllLocalDofIndicesThread::AllLocalDofIndicesThread ( System &  sys,
std::vector< std::string >  vars 
)

Definition at line 26 of file AllLocalDofIndicesThread.C.

27  : _sys(sys), _dof_map(sys.get_dof_map()), _vars(vars)
28 {
29  _var_numbers.resize(_vars.size());
30  for (unsigned int i = 0; i < _vars.size(); i++)
31  _var_numbers[i] = _sys.variable_number(_vars[i]);
32 }
std::vector< unsigned int > _var_numbers
std::vector< std::string > _vars
AllLocalDofIndicesThread::AllLocalDofIndicesThread ( AllLocalDofIndicesThread x,
Threads::split  split 
)

Definition at line 35 of file AllLocalDofIndicesThread.C.

Member Function Documentation

void AllLocalDofIndicesThread::join ( const AllLocalDofIndicesThread y)

Definition at line 70 of file AllLocalDofIndicesThread.C.

71 {
72  _all_dof_indices.insert(y._all_dof_indices.begin(), y._all_dof_indices.end());
73 }
std::set< dof_id_type > _all_dof_indices
void AllLocalDofIndicesThread::operator() ( const ConstElemRange &  range)

Definition at line 42 of file AllLocalDofIndicesThread.C.

43 {
44  ParallelUniqueId puid;
45  _tid = puid.id;
46 
47  for (const auto & elem : range)
48  {
49  std::vector<dof_id_type> dof_indices;
50 
51  dof_id_type local_dof_begin = _dof_map.first_dof();
52  dof_id_type local_dof_end = _dof_map.end_dof();
53 
54  // prepare variables
55  for (unsigned int i = 0; i < _var_numbers.size(); i++)
56  {
57  _dof_map.dof_indices(elem, dof_indices, _var_numbers[i]);
58  for (unsigned int j = 0; j < dof_indices.size(); j++)
59  {
60  dof_id_type dof = dof_indices[j];
61 
62  if (dof >= local_dof_begin && dof < local_dof_end)
63  _all_dof_indices.insert(dof_indices[j]);
64  }
65  }
66  }
67 }
std::vector< unsigned int > _var_numbers
std::set< dof_id_type > _all_dof_indices

Member Data Documentation

std::set<dof_id_type> AllLocalDofIndicesThread::_all_dof_indices
DofMap& AllLocalDofIndicesThread::_dof_map
protected

Definition at line 48 of file AllLocalDofIndicesThread.h.

Referenced by operator()().

System& AllLocalDofIndicesThread::_sys
protected

Definition at line 47 of file AllLocalDofIndicesThread.h.

Referenced by AllLocalDofIndicesThread().

THREAD_ID AllLocalDofIndicesThread::_tid
protected

Definition at line 51 of file AllLocalDofIndicesThread.h.

Referenced by operator()().

std::vector<unsigned int> AllLocalDofIndicesThread::_var_numbers
protected

Definition at line 50 of file AllLocalDofIndicesThread.h.

Referenced by AllLocalDofIndicesThread(), and operator()().

std::vector<std::string> AllLocalDofIndicesThread::_vars
protected

Definition at line 49 of file AllLocalDofIndicesThread.h.

Referenced by AllLocalDofIndicesThread().


The documentation for this class was generated from the following files: