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

#include <BoundaryElemIntegrityCheckThread.h>

Public Member Functions

 BoundaryElemIntegrityCheckThread (FEProblemBase &fe_problem, const TheWarehouse::Query &query)
 
 BoundaryElemIntegrityCheckThread (BoundaryElemIntegrityCheckThread &x, Threads::split split)
 
void operator() (const ConstBndElemRange &range)
 
void join (const BoundaryElemIntegrityCheckThread &)
 

Protected Attributes

FEProblemBase & _fe_problem
 the finite element (or volume) problem
 
const TheWarehouse::Query & _query
 A warehouse query that we will use to obtain user objects for boundary variable dependency integrity checks.
 

Detailed Description

Definition at line 28 of file BoundaryElemIntegrityCheckThread.h.

Constructor & Destructor Documentation

◆ BoundaryElemIntegrityCheckThread() [1/2]

BoundaryElemIntegrityCheckThread::BoundaryElemIntegrityCheckThread ( FEProblemBase &  fe_problem,
const TheWarehouse::Query &  query 
)

Definition at line 26 of file BoundaryElemIntegrityCheckThread.C.

28 : _fe_problem(fe_problem), _query(query)
29{
30}
const TheWarehouse::Query & _query
A warehouse query that we will use to obtain user objects for boundary variable dependency integrity ...
FEProblemBase & _fe_problem
the finite element (or volume) problem

◆ BoundaryElemIntegrityCheckThread() [2/2]

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

Definition at line 33 of file BoundaryElemIntegrityCheckThread.C.

36{
37}

Member Function Documentation

◆ join()

void BoundaryElemIntegrityCheckThread::join ( const BoundaryElemIntegrityCheckThread &  )

Definition at line 130 of file BoundaryElemIntegrityCheckThread.C.

131{
132}

◆ operator()()

void BoundaryElemIntegrityCheckThread::operator() ( const ConstBndElemRange &  range)

Definition at line 40 of file BoundaryElemIntegrityCheckThread.C.

41{
43 const auto tid = puid.id;
44
45 for (const auto & belem : range)
46 {
47 const Elem * elem = belem->_elem;
48 const auto boundary_id = belem->_bnd_id;
49 const auto side = belem->_side;
50
51 // We can distribute work just as the actual execution code will
52 if (elem->processor_id() != _fe_problem.processor_id())
53 return;
54
55 auto & mesh = _fe_problem.mesh();
56
57 const auto & bnd_name = mesh.getBoundaryName(boundary_id);
58
59 // uo check
60 std::vector<SideUserObject *> objs;
63 .condition<AttribInterfaces>(Interfaces::SideUserObject)
64 .condition<AttribBoundaries>(boundary_id, true)
65 .queryInto(objs);
66 for (const auto & uo : objs)
67 if (uo->checkVariableBoundaryIntegrity())
68 {
69 auto leftover_vars = uo->checkAllVariables(*elem);
70 if (!leftover_vars.empty())
71 {
72 const auto neighbor = elem->neighbor_ptr(side);
73 const bool upwind_elem = !neighbor || elem->id() < neighbor->id();
74 const Elem * lower_d_elem =
75 upwind_elem ? mesh.getLowerDElem(elem, side)
76 : mesh.getLowerDElem(neighbor, neighbor->which_neighbor_am_i(elem));
77 if (lower_d_elem)
78 leftover_vars = uo->checkVariables(*lower_d_elem, leftover_vars);
79 }
80 boundaryIntegrityCheckError(*uo, leftover_vars, bnd_name);
81 }
82
83 auto check = [elem, &bnd_name, &mesh, side](const auto & bnd_objects)
84 {
85 for (const auto & bnd_object : bnd_objects)
86 // Skip if this object uses geometric search because coupled variables may be defined on
87 // paired boundaries instead of the boundary this elem is on
88 if (!bnd_object->requiresGeometricSearch() && bnd_object->checkVariableBoundaryIntegrity())
89 {
90 // First check the higher-dimensional element
91 auto leftover_vars = bnd_object->checkAllVariables(*elem);
92 if (!leftover_vars.empty())
93 {
94 const auto neighbor = elem->neighbor_ptr(side);
95 const bool upwind_elem = !neighbor || elem->id() < neighbor->id();
96 const Elem * lower_d_elem =
97 upwind_elem ? mesh.getLowerDElem(elem, side)
98 : mesh.getLowerDElem(neighbor, neighbor->which_neighbor_am_i(elem));
99 if (lower_d_elem)
100 leftover_vars = bnd_object->checkVariables(*lower_d_elem, leftover_vars);
101 }
102
103 boundaryIntegrityCheckError(*bnd_object, leftover_vars, bnd_name);
104 }
105 };
106
107 // Mortar AuxKernels are excluded here: their boundaryIDs() report the primary/secondary
108 // boundaries they couple across, but their coupled variables are only required to be
109 // defined on the mortar segment mesh, not on every element of those boundaries.
110 std::vector<AuxKernelBase *> auxkernels;
112 .query()
113 .condition<AttribSystem>("AuxKernel")
114 .condition<AttribThread>(tid)
116 .condition<AttribBoundaries>(boundary_id, true)
117 .queryInto(auxkernels);
118 check(auxkernels);
119
120 for (const auto i : make_range(_fe_problem.numNonlinearSystems()))
121 {
122 const auto & warehouse = _fe_problem.getNonlinearSystemBase(i).getIntegratedBCWarehouse();
123 if (warehouse.hasBoundaryObjects(boundary_id, tid))
124 check(warehouse.getBoundaryObjects(boundary_id, tid));
125 }
126 }
127}
@ Nodal
Execution categories.
void boundaryIntegrityCheckError(const MooseObject &object, const std::set< MooseVariableFieldBase * > &variables, const BoundaryName &boundary_name)
Compose boundary restricted error message for the provided object, variables, and boundary_name if th...
if(!dmm->_nl) SETERRQ(PETSC_COMM_WORLD
Tracks the AuxKernelType of an AuxKernel: its value type (Real/Vector/Array) and its execution catego...
Definition Attributes.h:336
AttribBoundaries tracks all boundary IDs associated with an object.
Definition Attributes.h:223
virtual MooseMesh & mesh() override
TheWarehouse & theWarehouse() const
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
MooseObjectTagWarehouse< IntegratedBCBase > & getIntegratedBCWarehouse()
QueryCache & condition(Args &&... args)
Adds a new condition to the query.
QueryCache clone() const
clone creates and returns an independent copy of the query in its current state.
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse.
processor_id_type processor_id() const
MeshBase & mesh
IntRange< T > make_range(T beg, T end)

Member Data Documentation

◆ _fe_problem

FEProblemBase& BoundaryElemIntegrityCheckThread::_fe_problem
protected

the finite element (or volume) problem

Definition at line 42 of file BoundaryElemIntegrityCheckThread.h.

Referenced by operator()().

◆ _query

const TheWarehouse::Query& BoundaryElemIntegrityCheckThread::_query
protected

A warehouse query that we will use to obtain user objects for boundary variable dependency integrity checks.

Definition at line 46 of file BoundaryElemIntegrityCheckThread.h.

Referenced by operator()().


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