https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ComputeMortarNodalAuxBndThread.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#include "libmesh/threads.h"
11
12// MOOSE includes
14#include "AuxiliarySystem.h"
15#include "FEProblem.h"
17
18template <typename AuxKernelType>
20 FEProblemBase & fe_problem,
21 const TheWarehouse::Query & query,
22 const BoundaryID bnd_id,
23 const std::size_t object_container_index)
24 : ThreadedNodeLoop<ConstBndNodeRange, ConstBndNodeRange::const_iterator>(fe_problem),
25 _aux_sys(fe_problem.getAuxiliarySystem()),
26 _query_boundary(query),
27 _bnd_id(bnd_id),
28 _object_container_index(object_container_index)
29{
30}
31
32// Splitting Constructor
33template <typename AuxKernelType>
36 : ThreadedNodeLoop<ConstBndNodeRange, ConstBndNodeRange::const_iterator>(x, split),
37 _aux_sys(x._aux_sys),
38 _query_boundary(x._query_boundary),
39 _bnd_id(x._bnd_id),
40 _object_container_index(x._object_container_index)
41{
42}
43
44template <typename AuxKernelType>
45void
47{
48 const BndNode * bnode = *node_it;
49
50 if (bnode->_bnd_id != _bnd_id)
51 return;
52
53 Node * node = bnode->_node;
54
55 if (node->processor_id() == _fe_problem.processor_id())
56 {
57 std::vector<AuxKernelType *> kernels;
58 _query_boundary.queryInto(kernels, _tid, std::make_tuple(_bnd_id, /*must_be_restricted=*/true));
59 mooseAssert(_object_container_index < kernels.size(),
60 "The mortar nodal aux kernel index is out of range for this boundary.");
61 auto * kernel = kernels[_object_container_index];
62 mooseAssert(dynamic_cast<MortarNodalAuxKernel *>(kernel),
63 "This should be a mortar nodal aux kernel");
64 _fe_problem.reinitNodeFace(node, _bnd_id, _tid);
65 kernel->compute();
66 // This is the same conditional check that the aux kernel performs internally before calling
67 // computeValue and _var.setNodalValue. We don't want to attempt to insert into the solution if
68 // we don't actually have any dofs on this node
69 if (kernel->variable().isNodalDefined())
70 kernel->variable().insert(_aux_sys.solution());
71 }
72}
73
74template <typename AuxKernelType>
75void
79
boundary_id_type BoundaryID
This class evaluates a single mortar nodal aux kernel.
void join(const ComputeMortarNodalAuxBndThread &)
void onNode(ConstBndNodeRange::const_iterator &node_it) override
ComputeMortarNodalAuxBndThread(FEProblemBase &fe_problem, const TheWarehouse::Query &query, BoundaryID bnd_id, std::size_t object_container_index)
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Base class for creating new nodally-based mortar auxiliary kernels.
QueryCache is a convenient way to construct and pass around (possible partially constructed) warehous...
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