forked from idaholab/moose
-
Notifications
You must be signed in to change notification settings - Fork 1
/
BoundaryNodeIntegrityCheckThread.C
74 lines (65 loc) · 2.29 KB
/
BoundaryNodeIntegrityCheckThread.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
// MOOSE includes
#include "BoundaryNodeIntegrityCheckThread.h"
#include "AuxiliarySystem.h"
#include "FEProblem.h"
#include "AuxKernel.h"
#include "NodalUserObject.h"
#include "libmesh/threads.h"
#include "libmesh/node.h"
BoundaryNodeIntegrityCheckThread::BoundaryNodeIntegrityCheckThread(
FEProblemBase & fe_problem, const TheWarehouse::Query & query)
: ThreadedNodeLoop<ConstBndNodeRange, ConstBndNodeRange::const_iterator>(fe_problem),
_aux_sys(fe_problem.getAuxiliarySystem()),
_query(query)
{
}
// Splitting Constructor
BoundaryNodeIntegrityCheckThread::BoundaryNodeIntegrityCheckThread(
BoundaryNodeIntegrityCheckThread & x, Threads::split split)
: ThreadedNodeLoop<ConstBndNodeRange, ConstBndNodeRange::const_iterator>(x, split),
_aux_sys(x._aux_sys),
_query(x._query)
{
}
void
BoundaryNodeIntegrityCheckThread::onNode(ConstBndNodeRange::const_iterator & node_it)
{
const BndNode * const bnode = *node_it;
const auto boundary_id = bnode->_bnd_id;
const Node * const node = bnode->_node;
if (node->processor_id() != _fe_problem.processor_id())
return;
// aux check
_aux_sys.boundaryAuxKernelIntegrityCheck(*node, boundary_id, _tid);
// uo check
std::vector<NodalUserObject *> objs;
_query.clone()
.condition<AttribThread>(_tid)
.condition<AttribInterfaces>(Interfaces::NodalUserObject)
.condition<AttribBoundaries>(boundary_id, true)
.queryInto(objs);
for (const auto & uo : objs)
{
const auto & mv_deps = uo->getMooseVariableDependencies();
for (const auto * const var : mv_deps)
if (!node->n_dofs(var->sys().number(), var->number()))
mooseError("Nodal user object '",
uo->name(),
"' depends on variable '",
var->name(),
"'. However, that variable does not have degrees of freedom on node with id ",
node->id());
}
}
void
BoundaryNodeIntegrityCheckThread::join(const BoundaryNodeIntegrityCheckThread & /*y*/)
{
}