https://mooseframework.inl.gov
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BoundaryNodeIntegrityCheckThread Class Reference

#include <BoundaryNodeIntegrityCheckThread.h>

Inheritance diagram for BoundaryNodeIntegrityCheckThread:
[legend]

Public Member Functions

 BoundaryNodeIntegrityCheckThread (FEProblemBase &fe_problem, const TheWarehouse::Query &query)
 
 BoundaryNodeIntegrityCheckThread (BoundaryNodeIntegrityCheckThread &x, Threads::split split)
 
virtual void onNode (ConstBndNodeRange::const_iterator &node_it) override
 Called for each node. More...
 
void join (const BoundaryNodeIntegrityCheckThread &)
 
void operator() (const ConstBndNodeRange &range)
 
virtual void pre ()
 Called before the node range loop. More...
 
virtual void post ()
 Called after the node range loop. More...
 
virtual void postNode (ConstBndNodeRange::const_iterator &node_it)
 Called after the node assembly is done (including surface assembling) More...
 
virtual void caughtMooseException (MooseException &e)
 Called if a MooseException is caught anywhere during the computation. More...
 
virtual bool keepGoing ()
 Whether or not the loop should continue. More...
 

Protected Member Functions

virtual void printGeneralExecutionInformation () const
 Print information about the loop, mostly order of execution of objects. More...
 

Protected Attributes

const AuxiliarySystem_aux_sys
 The auxiliary system to whom we'll delegate the boundary variable dependency integrity check. More...
 
const ExecuteMooseObjectWarehouse< AuxKernel > & _nodal_aux
 Nodal auxiliary kernels acting on standard field variables. More...
 
const ExecuteMooseObjectWarehouse< VectorAuxKernel > & _nodal_vec_aux
 Nodal auxiliary kernels acting on vector field variables. More...
 
const ExecuteMooseObjectWarehouse< ArrayAuxKernel > & _nodal_array_aux
 Nodal auxiliary kernels acting on array field variables. More...
 
const TheWarehouse::Query_query
 A warehouse query that we will use to obtain user objects for boundary variable dependency integrity checks. More...
 
const std::map< dof_id_type, std::vector< dof_id_type > > _node_to_elem_map
 Node to element map. Used for determining vertex vs. non-vertex nodes. More...
 
FEProblemBase_fe_problem
 
THREAD_ID _tid
 

Detailed Description

Definition at line 24 of file BoundaryNodeIntegrityCheckThread.h.

Constructor & Destructor Documentation

◆ BoundaryNodeIntegrityCheckThread() [1/2]

BoundaryNodeIntegrityCheckThread::BoundaryNodeIntegrityCheckThread ( FEProblemBase fe_problem,
const TheWarehouse::Query query 
)

Definition at line 26 of file BoundaryNodeIntegrityCheckThread.C.

29  _aux_sys(fe_problem.getAuxiliarySystem()),
33  _query(query),
35 {
36 }
const ExecuteMooseObjectWarehouse< ArrayAuxKernel > & _nodal_array_aux
Nodal auxiliary kernels acting on array field variables.
const AuxiliarySystem & _aux_sys
The auxiliary system to whom we&#39;ll delegate the boundary variable dependency integrity check...
const ExecuteMooseObjectWarehouse< VectorAuxKernel > & nodalVectorAuxWarehouse() const
const std::map< dof_id_type, std::vector< dof_id_type > > & nodeToActiveSemilocalElemMap()
If not already created, creates a map from every node to all active semilocal elements to which they ...
Definition: MooseMesh.C:1203
const ExecuteMooseObjectWarehouse< AuxKernel > & nodalAuxWarehouse() const
const std::map< dof_id_type, std::vector< dof_id_type > > _node_to_elem_map
Node to element map. Used for determining vertex vs. non-vertex nodes.
const TheWarehouse::Query & _query
A warehouse query that we will use to obtain user objects for boundary variable dependency integrity ...
const ExecuteMooseObjectWarehouse< AuxKernel > & _nodal_aux
Nodal auxiliary kernels acting on standard field variables.
AuxiliarySystem & getAuxiliarySystem()
virtual MooseMesh & mesh() override
const ExecuteMooseObjectWarehouse< VectorAuxKernel > & _nodal_vec_aux
Nodal auxiliary kernels acting on vector field variables.
const ExecuteMooseObjectWarehouse< ArrayAuxKernel > & nodalArrayAuxWarehouse() const

◆ BoundaryNodeIntegrityCheckThread() [2/2]

BoundaryNodeIntegrityCheckThread::BoundaryNodeIntegrityCheckThread ( BoundaryNodeIntegrityCheckThread x,
Threads::split  split 
)

Definition at line 39 of file BoundaryNodeIntegrityCheckThread.C.

42  _aux_sys(x._aux_sys),
43  _nodal_aux(x._nodal_aux),
44  _nodal_vec_aux(x._nodal_vec_aux),
45  _nodal_array_aux(x._nodal_array_aux),
46  _query(x._query),
47  _node_to_elem_map(x._node_to_elem_map)
48 {
49 }
const ExecuteMooseObjectWarehouse< ArrayAuxKernel > & _nodal_array_aux
Nodal auxiliary kernels acting on array field variables.
const AuxiliarySystem & _aux_sys
The auxiliary system to whom we&#39;ll delegate the boundary variable dependency integrity check...
const std::map< dof_id_type, std::vector< dof_id_type > > _node_to_elem_map
Node to element map. Used for determining vertex vs. non-vertex nodes.
const TheWarehouse::Query & _query
A warehouse query that we will use to obtain user objects for boundary variable dependency integrity ...
const ExecuteMooseObjectWarehouse< AuxKernel > & _nodal_aux
Nodal auxiliary kernels acting on standard field variables.
tbb::split split
const ExecuteMooseObjectWarehouse< VectorAuxKernel > & _nodal_vec_aux
Nodal auxiliary kernels acting on vector field variables.

Member Function Documentation

◆ caughtMooseException()

virtual void ThreadedNodeLoop< ConstBndNodeRange , ConstBndNodeRange::const_iterator >::caughtMooseException ( MooseException e)
inlinevirtualinherited

Called if a MooseException is caught anywhere during the computation.

The single input parameter taken is a MooseException object.

Definition at line 56 of file ThreadedNodeLoop.h.

57  {
58  Threads::spin_mutex::scoped_lock lock(threaded_node_mutex);
59 
60  std::string what(e.what());
62  };
virtual const char * what() const
Get out the error message.
virtual void setException(const std::string &message)
Set an exception, which is stored at this point by toggling a member variable in this class...
static Threads::spin_mutex threaded_node_mutex

◆ join()

void BoundaryNodeIntegrityCheckThread::join ( const BoundaryNodeIntegrityCheckThread )

Definition at line 103 of file BoundaryNodeIntegrityCheckThread.C.

104 {
105 }

◆ keepGoing()

virtual bool ThreadedNodeLoop< ConstBndNodeRange , ConstBndNodeRange::const_iterator >::keepGoing ( )
inlinevirtualinherited

Whether or not the loop should continue.

Returns
true to keep going, false to stop.

Definition at line 69 of file ThreadedNodeLoop.h.

69 { return !_fe_problem.hasException(); }
virtual bool hasException()
Whether or not an exception has occurred.

◆ onNode()

void BoundaryNodeIntegrityCheckThread::onNode ( ConstBndNodeRange::const_iterator node_it)
overridevirtual

Called for each node.

Reimplemented from ThreadedNodeLoop< ConstBndNodeRange, ConstBndNodeRange::const_iterator >.

Definition at line 52 of file BoundaryNodeIntegrityCheckThread.C.

53 {
54  const BndNode * const bnode = *node_it;
55  const auto boundary_id = bnode->_bnd_id;
56  const Node * const node = bnode->_node;
57 
58  // We can distribute work just as the actual execution code will
59  if (node->processor_id() != _fe_problem.processor_id())
60  return;
61 
62  auto & mesh = _fe_problem.mesh();
63 
64  // Only check vertices. Variables may not be defined on non-vertex nodes (think first order
65  // Lagrange on a second order mesh) and user-code can often handle that
66  const Elem * const an_elem =
67  mesh.getMesh().elem_ptr(libmesh_map_find(_node_to_elem_map, node->id()).front());
68  if (!an_elem->is_vertex(an_elem->get_node_index(node)))
69  return;
70 
71  const auto & bnd_name = mesh.getBoundaryName(boundary_id);
72 
73  // uo check
74  std::vector<NodalUserObject *> objs;
75  _query.clone()
77  .condition<AttribInterfaces>(Interfaces::NodalUserObject)
78  .condition<AttribBoundaries>(boundary_id, true)
79  .queryInto(objs);
80  for (const auto & uo : objs)
81  if (uo->checkVariableBoundaryIntegrity())
82  boundaryIntegrityCheckError(*uo, uo->checkAllVariables(*node), bnd_name);
83 
84  auto check = [node, boundary_id, &bnd_name, this](const auto & warehouse)
85  {
86  if (!warehouse.hasBoundaryObjects(boundary_id, _tid))
87  return;
88 
89  const auto & bnd_objects = warehouse.getBoundaryObjects(boundary_id, _tid);
90  for (const auto & bnd_object : bnd_objects)
91  // Skip if this object uses geometric search because coupled variables may be defined on
92  // paired boundaries instead of the boundary this node is on
93  if (!bnd_object->requiresGeometricSearch() && bnd_object->checkVariableBoundaryIntegrity())
94  boundaryIntegrityCheckError(*bnd_object, bnd_object->checkAllVariables(*node), bnd_name);
95  };
96 
100 }
const ExecuteMooseObjectWarehouse< ArrayAuxKernel > & _nodal_array_aux
Nodal auxiliary kernels acting on array field variables.
MeshBase & mesh
BoundaryID _bnd_id
boundary id for the node
Definition: BndNode.h:26
const std::map< dof_id_type, std::vector< dof_id_type > > _node_to_elem_map
Node to element map. Used for determining vertex vs. non-vertex nodes.
const TheWarehouse::Query & _query
A warehouse query that we will use to obtain user objects for boundary variable dependency integrity ...
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...
AttribBoundaries tracks all boundary IDs associated with an object.
Definition: Attributes.h:188
QueryCache clone() const
clone creates and returns an independent copy of the query in its current state.
Definition: TheWarehouse.h:292
const ExecuteMooseObjectWarehouse< AuxKernel > & _nodal_aux
Nodal auxiliary kernels acting on standard field variables.
libMesh::Node * _node
pointer to the node
Definition: BndNode.h:24
virtual MooseMesh & mesh() override
QueryCache & condition(Args &&... args)
Adds a new condition to the query.
Definition: TheWarehouse.h:284
const ExecuteMooseObjectWarehouse< VectorAuxKernel > & _nodal_vec_aux
Nodal auxiliary kernels acting on vector field variables.
processor_id_type processor_id() const
Result check(std::string requirements, const Registry &capabilities)
Checks if a set of requirements is satisified by the given capability registry.

◆ operator()()

Definition at line 94 of file ThreadedNodeLoop.h.

95 {
96  try
97  {
98  ParallelUniqueId puid;
99  _tid = puid.id;
100 
101  pre();
103 
104  for (IteratorType nd = range.begin(); nd != range.end(); ++nd)
105  {
106  if (!keepGoing())
107  break;
108 
109  onNode(nd);
110 
111  postNode(nd);
112  }
113 
114  post();
115  }
116  catch (MooseException & e)
117  {
119  }
120 }
virtual void printGeneralExecutionInformation() const
Print information about the loop, mostly order of execution of objects.
virtual void caughtMooseException(MooseException &e)
Called if a MooseException is caught anywhere during the computation.
virtual bool keepGoing()
Whether or not the loop should continue.
const_iterator end() const
Provides a way for users to bail out of the current solve.
const_iterator begin() const
virtual void postNode(ConstBndNodeRange::const_iterator &node_it)
Called after the node assembly is done (including surface assembling)
virtual void onNode(ConstBndNodeRange::const_iterator &node_it)
Called for each node.

◆ post()

Called after the node range loop.

Definition at line 130 of file ThreadedNodeLoop.h.

131 {
132 }

◆ postNode()

Called after the node assembly is done (including surface assembling)

Parameters
node- active node

Definition at line 142 of file ThreadedNodeLoop.h.

143 {
144 }

◆ pre()

Called before the node range loop.

Reimplemented in ComputeNodalKernelBCJacobiansThread, and ComputeNodalKernelBcsThread.

Definition at line 124 of file ThreadedNodeLoop.h.

125 {
126 }

◆ printGeneralExecutionInformation()

virtual void ThreadedNodeLoop< ConstBndNodeRange , ConstBndNodeRange::const_iterator >::printGeneralExecutionInformation ( ) const
inlineprotectedvirtualinherited

Print information about the loop, mostly order of execution of objects.

Reimplemented in ComputeNodalKernelBCJacobiansThread, ComputeNodalAuxBcsThread< AuxKernelType >, and ComputeNodalKernelBcsThread.

Definition at line 76 of file ThreadedNodeLoop.h.

76 {}

Member Data Documentation

◆ _aux_sys

const AuxiliarySystem& BoundaryNodeIntegrityCheckThread::_aux_sys
protected

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

Definition at line 39 of file BoundaryNodeIntegrityCheckThread.h.

◆ _fe_problem

Definition at line 72 of file ThreadedNodeLoop.h.

Referenced by ComputeBoundaryInitialConditionThread::onNode(), and onNode().

◆ _nodal_array_aux

const ExecuteMooseObjectWarehouse<ArrayAuxKernel>& BoundaryNodeIntegrityCheckThread::_nodal_array_aux
protected

Nodal auxiliary kernels acting on array field variables.

Definition at line 48 of file BoundaryNodeIntegrityCheckThread.h.

Referenced by onNode().

◆ _nodal_aux

const ExecuteMooseObjectWarehouse<AuxKernel>& BoundaryNodeIntegrityCheckThread::_nodal_aux
protected

Nodal auxiliary kernels acting on standard field variables.

Definition at line 42 of file BoundaryNodeIntegrityCheckThread.h.

Referenced by onNode().

◆ _nodal_vec_aux

const ExecuteMooseObjectWarehouse<VectorAuxKernel>& BoundaryNodeIntegrityCheckThread::_nodal_vec_aux
protected

Nodal auxiliary kernels acting on vector field variables.

Definition at line 45 of file BoundaryNodeIntegrityCheckThread.h.

Referenced by onNode().

◆ _node_to_elem_map

const std::map<dof_id_type, std::vector<dof_id_type> > BoundaryNodeIntegrityCheckThread::_node_to_elem_map
protected

Node to element map. Used for determining vertex vs. non-vertex nodes.

Definition at line 55 of file BoundaryNodeIntegrityCheckThread.h.

Referenced by onNode().

◆ _query

const TheWarehouse::Query& BoundaryNodeIntegrityCheckThread::_query
protected

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

Definition at line 52 of file BoundaryNodeIntegrityCheckThread.h.

Referenced by onNode().

◆ _tid


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