https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Friends | List of all members
CacheInfoThread Class Reference

Fills lower-d side maps and node-to-block ownership for MooseMesh::cacheInfo(). More...

#include <CacheInfoThread.h>

Public Member Functions

 CacheInfoThread (MooseMesh &mesh)
 
 CacheInfoThread (CacheInfoThread &x, Threads::split split)
 
void operator() (const ConstElemRange &range)
 
void join (const CacheInfoThread &y)
 

Protected Attributes

MooseMesh & _mesh
 
std::map< dof_id_type, std::set< SubdomainID > > _block_node_list
 
std::set< SubdomainID > _lower_d_interior_blocks
 
std::set< SubdomainID > _lower_d_boundary_blocks
 
std::unordered_map< std::pair< const Elem *, unsigned short int >, const Elem * > _higher_d_elem_side_to_lower_d_elem
 
std::unordered_map< const Elem *, unsigned short int > _lower_d_elem_to_higher_d_elem_side
 

Friends

class MooseMesh
 

Detailed Description

Fills lower-d side maps and node-to-block ownership for MooseMesh::cacheInfo().

The range is all elements this rank knows about (local and ghosted).

Definition at line 21 of file CacheInfoThread.h.

Constructor & Destructor Documentation

◆ CacheInfoThread() [1/2]

CacheInfoThread::CacheInfoThread ( MooseMesh &  mesh)

Definition at line 15 of file CacheInfoThread.C.

15: _mesh(mesh) {}
MooseMesh & _mesh

◆ CacheInfoThread() [2/2]

CacheInfoThread::CacheInfoThread ( CacheInfoThread &  x,
Threads::split  split 
)

Definition at line 17 of file CacheInfoThread.C.

17: _mesh(x._mesh) {}

Member Function Documentation

◆ join()

void CacheInfoThread::join ( const CacheInfoThread &  y)

Definition at line 62 of file CacheInfoThread.C.

63{
64 for (const auto & [key, values] : y._block_node_list)
65 _block_node_list[key].insert(values.begin(), values.end());
66
75}
std::array< Real, 2 > values
Definition MortarUtils.C:52
std::unordered_map< std::pair< const Elem *, unsigned short int >, const Elem * > _higher_d_elem_side_to_lower_d_elem
std::map< dof_id_type, std::set< SubdomainID > > _block_node_list
std::unordered_map< const Elem *, unsigned short int > _lower_d_elem_to_higher_d_elem_side
std::set< SubdomainID > _lower_d_interior_blocks
std::set< SubdomainID > _lower_d_boundary_blocks

◆ operator()()

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

Definition at line 20 of file CacheInfoThread.C.

21{
22 const auto & mesh = _mesh.getMesh();
23
24 for (const auto & elem : range)
25 {
26 const Elem * ip_elem = elem->interior_parent();
27
28 if (ip_elem)
29 {
30 unsigned int ip_side = ip_elem->which_side_am_i(elem);
31
32 // For some grid sequencing tests: ip_side == libMesh::invalid_uint
33 if (ip_side != libMesh::invalid_uint)
34 {
35 auto pair = std::make_pair(ip_elem, static_cast<unsigned short int>(ip_side));
36 _higher_d_elem_side_to_lower_d_elem.emplace(pair, elem);
37 _lower_d_elem_to_higher_d_elem_side.emplace(elem, pair.second);
38
39 auto id = elem->subdomain_id();
40 if (ip_elem->neighbor_ptr(ip_side))
41 {
42 if (mesh.subdomain_name(id).find("INTERNAL_SIDE_LOWERD_SUBDOMAIN_") != std::string::npos)
43 _lower_d_interior_blocks.insert(id);
44 }
45 else
46 {
47 if (mesh.subdomain_name(id).find("BOUNDARY_SIDE_LOWERD_SUBDOMAIN_") != std::string::npos)
48 _lower_d_boundary_blocks.insert(id);
49 }
50 }
51 }
52
53 for (const auto nd : make_range(elem->n_nodes()))
54 {
55 const Node & node = *elem->node_ptr(nd);
56 _block_node_list[node.id()].insert(elem->subdomain_id());
57 }
58 }
59}
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition MooseMesh.C:3512
MeshBase & mesh
const unsigned int invalid_uint
IntRange< T > make_range(T beg, T end)
const dof_id_type n_nodes

Friends And Related Symbol Documentation

◆ MooseMesh

friend class MooseMesh
friend

Definition at line 41 of file CacheInfoThread.h.

Member Data Documentation

◆ _block_node_list

std::map<dof_id_type, std::set<SubdomainID> > CacheInfoThread::_block_node_list
protected

Definition at line 34 of file CacheInfoThread.h.

Referenced by MooseMesh::cacheInfo(), join(), and operator()().

◆ _higher_d_elem_side_to_lower_d_elem

std::unordered_map<std::pair<const Elem *, unsigned short int>, const Elem *> CacheInfoThread::_higher_d_elem_side_to_lower_d_elem
protected

Definition at line 38 of file CacheInfoThread.h.

Referenced by MooseMesh::cacheInfo(), join(), and operator()().

◆ _lower_d_boundary_blocks

std::set<SubdomainID> CacheInfoThread::_lower_d_boundary_blocks
protected

Definition at line 36 of file CacheInfoThread.h.

Referenced by MooseMesh::cacheInfo(), join(), and operator()().

◆ _lower_d_elem_to_higher_d_elem_side

std::unordered_map<const Elem *, unsigned short int> CacheInfoThread::_lower_d_elem_to_higher_d_elem_side
protected

Definition at line 39 of file CacheInfoThread.h.

Referenced by MooseMesh::cacheInfo(), join(), and operator()().

◆ _lower_d_interior_blocks

std::set<SubdomainID> CacheInfoThread::_lower_d_interior_blocks
protected

Definition at line 35 of file CacheInfoThread.h.

Referenced by MooseMesh::cacheInfo(), join(), and operator()().

◆ _mesh

MooseMesh& CacheInfoThread::_mesh
protected

Definition at line 32 of file CacheInfoThread.h.

Referenced by operator()().


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