https://mooseframework.inl.gov
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ComputeNodalAuxBcsThread< AuxKernelType > Class Template Reference

#include <ComputeNodalAuxBcsThread.h>

Inheritance diagram for ComputeNodalAuxBcsThread< AuxKernelType >:
[legend]

Public Member Functions

 ComputeNodalAuxBcsThread (FEProblemBase &fe_problem, const MooseObjectWarehouse< AuxKernelType > &storage)
 
 ComputeNodalAuxBcsThread (ComputeNodalAuxBcsThread &x, Threads::split split)
 
virtual void onNode (ConstBndNodeRange::const_iterator &node_it) override
 Called for each node. More...
 
void join (const ComputeNodalAuxBcsThread &)
 
void operator() (const ConstBndNodeRange &range)
 
virtual void pre ()
 Called before the node range loop. More...
 
virtual void post ()
 Called after the node range loop. More...
 
virtual void postNode (ConstBndNodeRange::const_iterator &node_it)
 Called after the node assembly is done (including surface assembling) More...
 
virtual void caughtMooseException (MooseException &e)
 Called if a MooseException is caught anywhere during the computation. More...
 
virtual bool keepGoing ()
 Whether or not the loop should continue. More...
 

Protected Member Functions

void printGeneralExecutionInformation () const override
 Print information about the loop, mostly order of execution of objects. More...
 

Protected Attributes

AuxiliarySystem_aux_sys
 
const MooseObjectWarehouse< AuxKernelType > & _storage
 Storage object containing active AuxKernel objects. More...
 
FEProblemBase_fe_problem
 
THREAD_ID _tid
 

Detailed Description

template<typename AuxKernelType>
class ComputeNodalAuxBcsThread< AuxKernelType >

Definition at line 21 of file ComputeNodalAuxBcsThread.h.

Constructor & Destructor Documentation

◆ ComputeNodalAuxBcsThread() [1/2]

template<typename AuxKernelType >
ComputeNodalAuxBcsThread< AuxKernelType >::ComputeNodalAuxBcsThread ( FEProblemBase fe_problem,
const MooseObjectWarehouse< AuxKernelType > &  storage 
)

Definition at line 19 of file ComputeNodalAuxBcsThread.C.

22  _aux_sys(fe_problem.getAuxiliarySystem()),
23  _storage(storage)
24 {
25 }
const MooseObjectWarehouse< AuxKernelType > & _storage
Storage object containing active AuxKernel objects.
AuxiliarySystem & getAuxiliarySystem()

◆ ComputeNodalAuxBcsThread() [2/2]

template<typename AuxKernelType >
ComputeNodalAuxBcsThread< AuxKernelType >::ComputeNodalAuxBcsThread ( ComputeNodalAuxBcsThread< AuxKernelType > &  x,
Threads::split  split 
)

Definition at line 29 of file ComputeNodalAuxBcsThread.C.

32  _aux_sys(x._aux_sys),
33  _storage(x._storage)
34 {
35 }
const MooseObjectWarehouse< AuxKernelType > & _storage
Storage object containing active AuxKernel objects.
tbb::split split

Member Function Documentation

◆ caughtMooseException()

virtual void ThreadedNodeLoop< ConstBndNodeRange , ConstBndNodeRange::const_iterator >::caughtMooseException ( MooseException e)
inlinevirtualinherited

Called if a MooseException is caught anywhere during the computation.

The single input parameter taken is a MooseException object.

Definition at line 56 of file ThreadedNodeLoop.h.

57  {
58  Threads::spin_mutex::scoped_lock lock(threaded_node_mutex);
59 
60  std::string what(e.what());
62  };
virtual const char * what() const
Get out the error message.
virtual void setException(const std::string &message)
Set an exception, which is stored at this point by toggling a member variable in this class...
static Threads::spin_mutex threaded_node_mutex

◆ join()

template<typename AuxKernelType >
void ComputeNodalAuxBcsThread< AuxKernelType >::join ( const ComputeNodalAuxBcsThread< AuxKernelType > &  )

Definition at line 73 of file ComputeNodalAuxBcsThread.C.

74 {
75 }

◆ keepGoing()

virtual bool ThreadedNodeLoop< ConstBndNodeRange , ConstBndNodeRange::const_iterator >::keepGoing ( )
inlinevirtualinherited

Whether or not the loop should continue.

Returns
true to keep going, false to stop.

Definition at line 69 of file ThreadedNodeLoop.h.

69 { return !_fe_problem.hasException(); }
virtual bool hasException()
Whether or not an exception has occurred.

◆ onNode()

template<typename AuxKernelType >
void ComputeNodalAuxBcsThread< AuxKernelType >::onNode ( ConstBndNodeRange::const_iterator node_it)
overridevirtual

Called for each node.

Reimplemented from ThreadedNodeLoop< ConstBndNodeRange, ConstBndNodeRange::const_iterator >.

Definition at line 39 of file ComputeNodalAuxBcsThread.C.

40 {
41  const BndNode * bnode = *node_it;
42 
43  BoundaryID boundary_id = bnode->_bnd_id;
44 
45  Node * node = bnode->_node;
46 
47  if (node->processor_id() == _fe_problem.processor_id())
48  {
49  // Get a map of all active block restricted AuxKernel objects
50  const auto & kernels = _storage.getActiveBoundaryObjects(_tid);
51 
52  // Operate on the node BoundaryID only
53  const auto iter = kernels.find(boundary_id);
54  if (iter != kernels.end())
55  {
56  _fe_problem.reinitNodeFace(node, boundary_id, _tid);
57 
58  for (const auto & aux : iter->second)
59  {
60  aux->compute();
61  // This is the same conditional check that the aux kernel performs internally before calling
62  // computeValue and _var.setNodalValue. We don't want to attempt to insert into the solution
63  // if we don't actually have any dofs on this node
64  if (aux->variable().isNodalDefined())
65  aux->variable().insert(_aux_sys.solution());
66  }
67  }
68  }
69 }
NumericVector< Number > & solution()
Definition: SystemBase.h:195
const MooseObjectWarehouse< AuxKernelType > & _storage
Storage object containing active AuxKernel objects.
BoundaryID _bnd_id
boundary id for the node
Definition: BndNode.h:26
boundary_id_type BoundaryID
libMesh::Node * _node
pointer to the node
Definition: BndNode.h:24
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const
processor_id_type processor_id() const
virtual void reinitNodeFace(const Node *node, BoundaryID bnd_id, const THREAD_ID tid) override

◆ operator()()

Definition at line 94 of file ThreadedNodeLoop.h.

95 {
96  try
97  {
98  ParallelUniqueId puid;
99  _tid = puid.id;
100 
101  pre();
103 
104  for (IteratorType nd = range.begin(); nd != range.end(); ++nd)
105  {
106  if (!keepGoing())
107  break;
108 
109  onNode(nd);
110 
111  postNode(nd);
112  }
113 
114  post();
115  }
116  catch (MooseException & e)
117  {
119  }
120 }
virtual void printGeneralExecutionInformation() const
Print information about the loop, mostly order of execution of objects.
virtual void caughtMooseException(MooseException &e)
Called if a MooseException is caught anywhere during the computation.
virtual bool keepGoing()
Whether or not the loop should continue.
const_iterator end() const
Provides a way for users to bail out of the current solve.
const_iterator begin() const
virtual void postNode(ConstBndNodeRange::const_iterator &node_it)
Called after the node assembly is done (including surface assembling)
virtual void onNode(ConstBndNodeRange::const_iterator &node_it)
Called for each node.

◆ post()

Called after the node range loop.

Definition at line 130 of file ThreadedNodeLoop.h.

131 {
132 }

◆ postNode()

Called after the node assembly is done (including surface assembling)

Parameters
node- active node

Definition at line 142 of file ThreadedNodeLoop.h.

143 {
144 }

◆ pre()

Called before the node range loop.

Reimplemented in ComputeNodalKernelBCJacobiansThread, and ComputeNodalKernelBcsThread.

Definition at line 124 of file ThreadedNodeLoop.h.

125 {
126 }

◆ printGeneralExecutionInformation()

template<typename AuxKernelType >
void ComputeNodalAuxBcsThread< AuxKernelType >::printGeneralExecutionInformation ( ) const
overrideprotectedvirtual

Print information about the loop, mostly order of execution of objects.

Reimplemented from ThreadedNodeLoop< ConstBndNodeRange, ConstBndNodeRange::const_iterator >.

Definition at line 79 of file ComputeNodalAuxBcsThread.C.

80 {
82  return;
83 
84  const auto & console = _fe_problem.console();
85  const auto & execute_on = _fe_problem.getCurrentExecuteOnFlag();
86  console << "[DBG] Executing nodal auxiliary kernels on boundary nodes on " << execute_on
87  << std::endl;
88  console << "[DBG] Ordering of the kernels on each boundary they are defined on:" << std::endl;
89  // TODO Check that all objects are active at this point
90  console << _storage.activeObjectsToFormattedString() << std::endl;
91 }
std::string activeObjectsToFormattedString(THREAD_ID tid=0, const std::string &prefix="[DBG]") const
Output the active content of the warehouse to a string, meant to be output to the console...
const MooseObjectWarehouse< AuxKernelType > & _storage
Storage object containing active AuxKernel objects.
const ExecFlagType & getCurrentExecuteOnFlag() const
Return/set the current execution flag.
bool shouldPrintExecution(const THREAD_ID tid) const
Check whether the problem should output execution orders at this time.
const ConsoleStream & console() const
Return console handle.
Definition: Problem.h:48
bool hasActiveObjects(THREAD_ID tid=0) const

Member Data Documentation

◆ _aux_sys

template<typename AuxKernelType>
AuxiliarySystem& ComputeNodalAuxBcsThread< AuxKernelType >::_aux_sys
protected

Definition at line 39 of file ComputeNodalAuxBcsThread.h.

◆ _fe_problem

◆ _storage

template<typename AuxKernelType>
const MooseObjectWarehouse<AuxKernelType>& ComputeNodalAuxBcsThread< AuxKernelType >::_storage
protected

Storage object containing active AuxKernel objects.

Definition at line 42 of file ComputeNodalAuxBcsThread.h.

◆ _tid


The documentation for this class was generated from the following files: