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

Fills subdomain neighbor and attached boundary-id caches for MooseMesh::cacheInfo(). More...

#include <CacheSubdomainInfoThread.h>

Public Member Functions

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

Protected Attributes

MooseMesh & _mesh
 
std::unordered_map< SubdomainID, std::set< SubdomainID > > _neighbor_subs
 
std::unordered_map< SubdomainID, std::set< BoundaryID > > _sub_boundary_ids
 
std::unordered_map< SubdomainID, std::set< BoundaryID > > _neighbor_subdomain_boundary_ids
 

Friends

class MooseMesh
 

Detailed Description

Fills subdomain neighbor and attached boundary-id caches for MooseMesh::cacheInfo().

The range is active local elements; sides are walked inside operator().

Definition at line 21 of file CacheSubdomainInfoThread.h.

Constructor & Destructor Documentation

◆ CacheSubdomainInfoThread() [1/2]

CacheSubdomainInfoThread::CacheSubdomainInfoThread ( MooseMesh &  mesh)

Definition at line 15 of file CacheSubdomainInfoThread.C.

15: _mesh(mesh) {}

◆ CacheSubdomainInfoThread() [2/2]

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

Definition at line 17 of file CacheSubdomainInfoThread.C.

19 : _mesh(x._mesh)
20{
21}

Member Function Documentation

◆ join()

void CacheSubdomainInfoThread::join ( const CacheSubdomainInfoThread &  y)

Definition at line 49 of file CacheSubdomainInfoThread.C.

50{
51 for (const auto & [key, values] : y._neighbor_subs)
52 _neighbor_subs[key].insert(values.begin(), values.end());
53
54 for (const auto & [key, values] : y._sub_boundary_ids)
55 _sub_boundary_ids[key].insert(values.begin(), values.end());
56
57 for (const auto & [key, values] : y._neighbor_subdomain_boundary_ids)
58 _neighbor_subdomain_boundary_ids[key].insert(values.begin(), values.end());
59}
std::array< Real, 2 > values
Definition MortarUtils.C:52
std::unordered_map< SubdomainID, std::set< SubdomainID > > _neighbor_subs
std::unordered_map< SubdomainID, std::set< BoundaryID > > _neighbor_subdomain_boundary_ids
std::unordered_map< SubdomainID, std::set< BoundaryID > > _sub_boundary_ids

◆ operator()()

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

Definition at line 24 of file CacheSubdomainInfoThread.C.

25{
26 for (const auto & elem : range)
27 {
28 SubdomainID subdomain_id = elem->subdomain_id();
29 const auto elem_boundary_ids = _mesh.getBoundaryIDs(elem);
30 for (const auto side : make_range(elem->n_sides()))
31 {
32 const auto & boundary_ids = elem_boundary_ids[side];
33 _sub_boundary_ids[subdomain_id].insert(boundary_ids.begin(), boundary_ids.end());
34
35 const Elem * neig = elem->neighbor_ptr(side);
36 if (neig)
37 {
38 _neighbor_subdomain_boundary_ids[neig->subdomain_id()].insert(boundary_ids.begin(),
39 boundary_ids.end());
40 SubdomainID neighbor_subdomain_id = neig->subdomain_id();
41 if (neighbor_subdomain_id != subdomain_id)
42 _neighbor_subs[subdomain_id].insert(neighbor_subdomain_id);
43 }
44 }
45 }
46}
subdomain_id_type SubdomainID
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
Returns a vector of boundary IDs for the requested element on the requested side.
Definition MooseMesh.C:2990
IntRange< T > make_range(T beg, T end)

Friends And Related Symbol Documentation

◆ MooseMesh

friend class MooseMesh
friend

Definition at line 38 of file CacheSubdomainInfoThread.h.

Member Data Documentation

◆ _mesh

MooseMesh& CacheSubdomainInfoThread::_mesh
protected

Definition at line 32 of file CacheSubdomainInfoThread.h.

Referenced by operator()().

◆ _neighbor_subdomain_boundary_ids

std::unordered_map<SubdomainID, std::set<BoundaryID> > CacheSubdomainInfoThread::_neighbor_subdomain_boundary_ids
protected

Definition at line 36 of file CacheSubdomainInfoThread.h.

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

◆ _neighbor_subs

std::unordered_map<SubdomainID, std::set<SubdomainID> > CacheSubdomainInfoThread::_neighbor_subs
protected

Definition at line 34 of file CacheSubdomainInfoThread.h.

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

◆ _sub_boundary_ids

std::unordered_map<SubdomainID, std::set<BoundaryID> > CacheSubdomainInfoThread::_sub_boundary_ids
protected

Definition at line 35 of file CacheSubdomainInfoThread.h.

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


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