https://mooseframework.inl.gov
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"
16 #include "MortarNodalAuxKernel.h"
17 
18 template <typename AuxKernelType>
20  FEProblemBase & fe_problem,
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  _storage(storage),
27  _bnd_id(bnd_id),
28  _object_container_index(object_container_index)
29 {
30 }
31 
32 // Splitting Constructor
33 template <typename AuxKernelType>
37  _aux_sys(x._aux_sys),
38  _storage(x._storage),
39  _bnd_id(x._bnd_id),
40  _object_container_index(x._object_container_index)
41 {
42 }
43 
44 template <typename AuxKernelType>
45 void
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  const auto & kernel = _storage.getActiveBoundaryObjects(_bnd_id, _tid)[_object_container_index];
58  mooseAssert(dynamic_cast<MortarNodalAuxKernel *>(kernel.get()),
59  "This should be a mortar nodal aux kernel");
60  _fe_problem.reinitNodeFace(node, _bnd_id, _tid);
61  kernel->compute();
62  // This is the same conditional check that the aux kernel performs internally before calling
63  // computeValue and _var.setNodalValue. We don't want to attempt to insert into the solution if
64  // we don't actually have any dofs on this node
65  if (kernel->variable().isNodalDefined())
66  kernel->variable().insert(_aux_sys.solution());
67  }
68 }
69 
70 template <typename AuxKernelType>
71 void
73 {
74 }
75 
void join(const ComputeMortarNodalAuxBndThread &)
This class evaluates a single mortar nodal aux kernel.
ComputeMortarNodalAuxBndThread(FEProblemBase &fe_problem, const MooseObjectWarehouse< AuxKernelType > &storage, BoundaryID bnd_id, std::size_t object_container_index)
BoundaryID _bnd_id
boundary id for the node
Definition: BndNode.h:26
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
boundary_id_type BoundaryID
libMesh::Node * _node
pointer to the node
Definition: BndNode.h:24
tbb::split split
vec_type::const_iterator const_iterator
void onNode(ConstBndNodeRange::const_iterator &node_it) override
Called for each node.