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 AuxiliarySystem_aux_sys
 The auxiliary system to whom we'll delegate the boundary variable dependency integrity check.
 
const ExecuteMooseObjectWarehouse< AuxKernel > & _elem_aux
 Elemental auxiliary kernels acting on standard field variables.
 
const ExecuteMooseObjectWarehouse< VectorAuxKernel > & _elem_vec_aux
 Elemental auxiliary kernels acting on vector field variables.
 
const ExecuteMooseObjectWarehouse< ArrayAuxKernel > & _elem_array_aux
 Elemental auxiliary kernels acting on array field variables.
 
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 32 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),
29 _aux_sys(fe_problem.getAuxiliarySystem()),
33 _query(query)
34{
35}
const ExecuteMooseObjectWarehouse< VectorAuxKernel > & elemVectorAuxWarehouse() const
const ExecuteMooseObjectWarehouse< ArrayAuxKernel > & elemArrayAuxWarehouse() const
const ExecuteMooseObjectWarehouse< AuxKernel > & elemAuxWarehouse() const
const AuxiliarySystem & _aux_sys
The auxiliary system to whom we'll delegate the boundary variable dependency integrity check.
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
const ExecuteMooseObjectWarehouse< AuxKernel > & _elem_aux
Elemental auxiliary kernels acting on standard field variables.
const ExecuteMooseObjectWarehouse< ArrayAuxKernel > & _elem_array_aux
Elemental auxiliary kernels acting on array field variables.
const ExecuteMooseObjectWarehouse< VectorAuxKernel > & _elem_vec_aux
Elemental auxiliary kernels acting on vector field variables.
AuxiliarySystem & getAuxiliarySystem()

◆ BoundaryElemIntegrityCheckThread() [2/2]

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

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 50 of file BoundaryElemIntegrityCheckThread.C.

51{
53 const auto tid = puid.id;
54
55 for (const auto & belem : range)
56 {
57 const Elem * elem = belem->_elem;
58 const auto boundary_id = belem->_bnd_id;
59 const auto side = belem->_side;
60
61 // We can distribute work just as the actual execution code will
62 if (elem->processor_id() != _fe_problem.processor_id())
63 return;
64
65 auto & mesh = _fe_problem.mesh();
66
67 const auto & bnd_name = mesh.getBoundaryName(boundary_id);
68
69 // uo check
70 std::vector<SideUserObject *> objs;
73 .condition<AttribInterfaces>(Interfaces::SideUserObject)
74 .condition<AttribBoundaries>(boundary_id, true)
75 .queryInto(objs);
76 for (const auto & uo : objs)
77 if (uo->checkVariableBoundaryIntegrity())
78 {
79 auto leftover_vars = uo->checkAllVariables(*elem);
80 if (!leftover_vars.empty())
81 {
82 const auto neighbor = elem->neighbor_ptr(side);
83 const bool upwind_elem = !neighbor || elem->id() < neighbor->id();
84 const Elem * lower_d_elem =
85 upwind_elem ? mesh.getLowerDElem(elem, side)
86 : mesh.getLowerDElem(neighbor, neighbor->which_neighbor_am_i(elem));
87 if (lower_d_elem)
88 leftover_vars = uo->checkVariables(*lower_d_elem, leftover_vars);
89 }
90 boundaryIntegrityCheckError(*uo, leftover_vars, bnd_name);
91 }
92
93 auto check = [elem, boundary_id, &bnd_name, tid, &mesh, side](const auto & warehouse)
94 {
95 if (!warehouse.hasBoundaryObjects(boundary_id, tid))
96 return;
97
98 const auto & bnd_objects = warehouse.getBoundaryObjects(boundary_id, tid);
99 for (const auto & bnd_object : bnd_objects)
100 // Skip if this object uses geometric search because coupled variables may be defined on
101 // paired boundaries instead of the boundary this elem is on
102 if (!bnd_object->requiresGeometricSearch() && bnd_object->checkVariableBoundaryIntegrity())
103 {
104 // First check the higher-dimensional element
105 auto leftover_vars = bnd_object->checkAllVariables(*elem);
106 if (!leftover_vars.empty())
107 {
108 const auto neighbor = elem->neighbor_ptr(side);
109 const bool upwind_elem = !neighbor || elem->id() < neighbor->id();
110 const Elem * lower_d_elem =
111 upwind_elem ? mesh.getLowerDElem(elem, side)
112 : mesh.getLowerDElem(neighbor, neighbor->which_neighbor_am_i(elem));
113 if (lower_d_elem)
114 leftover_vars = bnd_object->checkVariables(*lower_d_elem, leftover_vars);
115 }
116
117 boundaryIntegrityCheckError(*bnd_object, leftover_vars, bnd_name);
118 }
119 };
120
121 check(_elem_aux);
122 check(_elem_vec_aux);
123 check(_elem_array_aux);
124 for (const auto i : make_range(_fe_problem.numNonlinearSystems()))
125 check(_fe_problem.getNonlinearSystemBase(i).getIntegratedBCWarehouse());
126 }
127}
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
AttribBoundaries tracks all boundary IDs associated with an object.
Definition Attributes.h:190
virtual MooseMesh & mesh() override
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.
processor_id_type processor_id() const
MeshBase & mesh
IntRange< T > make_range(T beg, T end)

Member Data Documentation

◆ _aux_sys

const AuxiliarySystem& BoundaryElemIntegrityCheckThread::_aux_sys
protected

The auxiliary system to whom we'll delegate the boundary variable dependency integrity check.

Definition at line 49 of file BoundaryElemIntegrityCheckThread.h.

◆ _elem_array_aux

const ExecuteMooseObjectWarehouse<ArrayAuxKernel>& BoundaryElemIntegrityCheckThread::_elem_array_aux
protected

Elemental auxiliary kernels acting on array field variables.

Definition at line 58 of file BoundaryElemIntegrityCheckThread.h.

Referenced by operator()().

◆ _elem_aux

const ExecuteMooseObjectWarehouse<AuxKernel>& BoundaryElemIntegrityCheckThread::_elem_aux
protected

Elemental auxiliary kernels acting on standard field variables.

Definition at line 52 of file BoundaryElemIntegrityCheckThread.h.

Referenced by operator()().

◆ _elem_vec_aux

const ExecuteMooseObjectWarehouse<VectorAuxKernel>& BoundaryElemIntegrityCheckThread::_elem_vec_aux
protected

Elemental auxiliary kernels acting on vector field variables.

Definition at line 55 of file BoundaryElemIntegrityCheckThread.h.

Referenced by operator()().

◆ _fe_problem

FEProblemBase& BoundaryElemIntegrityCheckThread::_fe_problem
protected

the finite element (or volume) problem

Definition at line 46 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 62 of file BoundaryElemIntegrityCheckThread.h.

Referenced by operator()().


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