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 28 of file AllLocalDofIndicesThread.h.

Constructor & Destructor Documentation

◆ AllLocalDofIndicesThread() [1/2]

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

Definition at line 21 of file AllLocalDofIndicesThread.C.

22  : _sys(sys), _dof_map(sys.get_dof_map()), _vars(vars)
23 {
24  _var_numbers.resize(_vars.size());
25  for (unsigned int i = 0; i < _vars.size(); i++)
26  _var_numbers[i] = _sys.variable_number(_vars[i]);
27 }
std::vector< unsigned int > _var_numbers
std::vector< std::string > _vars

◆ AllLocalDofIndicesThread() [2/2]

AllLocalDofIndicesThread::AllLocalDofIndicesThread ( AllLocalDofIndicesThread x,
Threads::split  split 
)

Definition at line 30 of file AllLocalDofIndicesThread.C.

32  : _sys(x._sys), _dof_map(x._dof_map), _vars(x._vars), _var_numbers(x._var_numbers)
33 {
34 }
std::vector< unsigned int > _var_numbers
static PetscErrorCode Vec x
std::vector< std::string > _vars

Member Function Documentation

◆ join()

void AllLocalDofIndicesThread::join ( const AllLocalDofIndicesThread y)

Definition at line 65 of file AllLocalDofIndicesThread.C.

66 {
67  _all_dof_indices.insert(y._all_dof_indices.begin(), y._all_dof_indices.end());
68 }
std::set< dof_id_type > _all_dof_indices

◆ operator()()

void AllLocalDofIndicesThread::operator() ( const ConstElemRange &  range)

Definition at line 37 of file AllLocalDofIndicesThread.C.

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

Member Data Documentation

◆ _all_dof_indices

std::set<dof_id_type> AllLocalDofIndicesThread::_all_dof_indices

◆ _dof_map

DofMap& AllLocalDofIndicesThread::_dof_map
protected

Definition at line 43 of file AllLocalDofIndicesThread.h.

Referenced by operator()().

◆ _sys

System& AllLocalDofIndicesThread::_sys
protected

Definition at line 42 of file AllLocalDofIndicesThread.h.

Referenced by AllLocalDofIndicesThread().

◆ _tid

THREAD_ID AllLocalDofIndicesThread::_tid
protected

Definition at line 46 of file AllLocalDofIndicesThread.h.

Referenced by operator()().

◆ _var_numbers

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

Definition at line 45 of file AllLocalDofIndicesThread.h.

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

◆ _vars

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

Definition at line 44 of file AllLocalDofIndicesThread.h.

Referenced by AllLocalDofIndicesThread().


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