https://mooseframework.inl.gov
BoundaryNodeIntegrityCheckThread.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 // MOOSE includes
13 #include "AuxiliarySystem.h"
14 #include "NonlinearSystemBase.h"
15 #include "FEProblemBase.h"
16 #include "NodalUserObject.h"
17 #include "MooseMesh.h"
19 
20 #include "libmesh/threads.h"
21 #include "libmesh/node.h"
22 #include "libmesh/mesh_base.h"
23 
24 #include <vector>
25 
27  FEProblemBase & fe_problem, const TheWarehouse::Query & query)
28  : ThreadedNodeLoop<ConstBndNodeRange, ConstBndNodeRange::const_iterator>(fe_problem),
29  _aux_sys(fe_problem.getAuxiliarySystem()),
30  _nodal_aux(_aux_sys.nodalAuxWarehouse()),
31  _nodal_vec_aux(_aux_sys.nodalVectorAuxWarehouse()),
32  _nodal_array_aux(_aux_sys.nodalArrayAuxWarehouse()),
33  _query(query)
34 {
35 }
36 
37 // Splitting Constructor
41  _aux_sys(x._aux_sys),
42  _nodal_aux(x._nodal_aux),
43  _nodal_vec_aux(x._nodal_vec_aux),
44  _nodal_array_aux(x._nodal_array_aux),
45  _query(x._query)
46 {
47 }
48 
49 void
51 {
52  const BndNode * const bnode = *node_it;
53  const auto boundary_id = bnode->_bnd_id;
54  const Node * const node = bnode->_node;
55 
56  // We can distribute work just as the actual execution code will
57  if (node->processor_id() != _fe_problem.processor_id())
58  return;
59 
60  const auto & bnd_name = _fe_problem.mesh().getBoundaryName(boundary_id);
61 
62  // uo check
63  std::vector<NodalUserObject *> objs;
64  _query.clone()
66  .condition<AttribInterfaces>(Interfaces::NodalUserObject)
67  .condition<AttribBoundaries>(boundary_id, true)
68  .queryInto(objs);
69  for (const auto & uo : objs)
70  if (uo->checkVariableBoundaryIntegrity())
71  boundaryIntegrityCheckError(*uo, uo->checkAllVariables(*node), bnd_name);
72 
73  auto check = [node, boundary_id, &bnd_name, this](const auto & warehouse)
74  {
75  if (!warehouse.hasBoundaryObjects(boundary_id, _tid))
76  return;
77 
78  const auto & bnd_objects = warehouse.getBoundaryObjects(boundary_id, _tid);
79  for (const auto & bnd_object : bnd_objects)
80  // Skip if this object uses geometric search because coupled variables may be defined on
81  // paired boundaries instead of the boundary this node is on
82  if (!bnd_object->requiresGeometricSearch() && bnd_object->checkVariableBoundaryIntegrity())
83  boundaryIntegrityCheckError(*bnd_object, bnd_object->checkAllVariables(*node), bnd_name);
84  };
85 
86  check(_nodal_aux);
87  check(_nodal_vec_aux);
88  check(_nodal_array_aux);
89 }
90 
91 void
93 {
94 }
const ExecuteMooseObjectWarehouse< ArrayAuxKernel > & _nodal_array_aux
Nodal auxiliary kernels acting on array field variables.
QueryCache is a convenient way to construct and pass around (possible partially constructed) warehous...
Definition: TheWarehouse.h:209
const std::string & getBoundaryName(const BoundaryID boundary_id) const
Return the name of the boundary given the id.
Definition: MooseMesh.C:1787
BoundaryID _bnd_id
boundary id for the node
Definition: BndNode.h:26
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
void join(const BoundaryNodeIntegrityCheckThread &)
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:189
QueryCache clone() const
clone creates and returns an independent copy of the query in its current state.
Definition: TheWarehouse.h:293
const ExecuteMooseObjectWarehouse< AuxKernel > & _nodal_aux
Nodal auxiliary kernels acting on standard field variables.
libMesh::Node * _node
pointer to the node
Definition: BndNode.h:24
query_obj query
tbb::split split
vec_type::const_iterator const_iterator
virtual MooseMesh & mesh() override
QueryCache & condition(Args &&... args)
Adds a new condition to the query.
Definition: TheWarehouse.h:285
BoundaryNodeIntegrityCheckThread(FEProblemBase &fe_problem, const TheWarehouse::Query &query)
const ExecuteMooseObjectWarehouse< VectorAuxKernel > & _nodal_vec_aux
Nodal auxiliary kernels acting on vector field variables.
processor_id_type processor_id() const
virtual void onNode(ConstBndNodeRange::const_iterator &node_it) override
Called for each node.