https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CacheInfoThread.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#include "CacheInfoThread.h"
11
12#include "libmesh/elem.h"
13#include "libmesh/threads.h"
14
16
18
19void
20CacheInfoThread::operator()(const ConstElemRange & range)
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}
60
61void
std::array< Real, 2 > values
Definition MortarUtils.C:52
Fills lower-d side maps and node-to-block ownership for MooseMesh::cacheInfo().
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
CacheInfoThread(MooseMesh &mesh)
std::unordered_map< const Elem *, unsigned short int > _lower_d_elem_to_higher_d_elem_side
MooseMesh & _mesh
std::set< SubdomainID > _lower_d_interior_blocks
std::set< SubdomainID > _lower_d_boundary_blocks
void operator()(const ConstElemRange &range)
void join(const CacheInfoThread &y)
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition MooseMesh.C:3512
MeshBase & mesh
const unsigned int invalid_uint