https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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 "AuxKernelBase.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
32
33// Splitting Constructor
40
41void
43{
44 const BndNode * const bnode = *node_it;
45 const auto boundary_id = bnode->_bnd_id;
46 const Node * const node = bnode->_node;
47
48 // We can distribute work just as the actual execution code will
49 if (node->processor_id() != _fe_problem.processor_id())
50 return;
51
52 const auto & bnd_name = _fe_problem.mesh().getBoundaryName(boundary_id);
53
54 // uo check
55 std::vector<NodalUserObject *> objs;
58 .condition<AttribInterfaces>(Interfaces::NodalUserObject)
59 .condition<AttribBoundaries>(boundary_id, true)
60 .queryInto(objs);
61 for (const auto & uo : objs)
62 if (uo->checkVariableBoundaryIntegrity())
63 boundaryIntegrityCheckError(*uo, uo->checkAllVariables(*node), bnd_name);
64
65 // AttribSystem groups AuxKernel/VectorAuxKernel/ArrayAuxKernel under the same "AuxKernel" tag,
66 // so one query into the common AuxKernelBase type covers all three value types. Mortar
67 // AuxKernels are excluded: their boundaryIDs() report the primary/secondary boundaries they
68 // couple across, but their coupled variables are only required to be defined on the mortar
69 // segment mesh, not on every node of those boundaries.
70 std::vector<AuxKernelBase *> auxkernels;
72 .query()
73 .condition<AttribSystem>("AuxKernel")
74 .condition<AttribThread>(_tid)
76 .condition<AttribBoundaries>(boundary_id, true)
77 .queryInto(auxkernels);
78 for (const auto & aux : auxkernels)
79 // Skip if this object uses geometric search because coupled variables may be defined on
80 // paired boundaries instead of the boundary this node is on
81 if (!aux->requiresGeometricSearch() && aux->checkVariableBoundaryIntegrity())
82 boundaryIntegrityCheckError(*aux, aux->checkAllVariables(*node), bnd_name);
83}
84
85void
@ 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...
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 void onNode(ConstBndNodeRange::const_iterator &node_it) override
void join(const BoundaryNodeIntegrityCheckThread &)
const TheWarehouse::Query & _query
A warehouse query that we will use to obtain user objects for boundary variable dependency integrity ...
BoundaryNodeIntegrityCheckThread(FEProblemBase &fe_problem, const TheWarehouse::Query &query)
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual MooseMesh & mesh() override
TheWarehouse & theWarehouse() const
const std::string & getBoundaryName(const BoundaryID boundary_id) const
Return the name of the boundary given the id.
Definition MooseMesh.C:1787
QueryCache is a convenient way to construct and pass around (possible partially constructed) warehous...
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
const object_type * const_iterator
query_obj query
BoundaryID _bnd_id
boundary id for the node
Definition BndNode.h:26
libMesh::Node * _node
pointer to the node
Definition BndNode.h:24