www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
ThreadedNodeLoop< RangeType, IteratorType > Class Template Reference

#include <ThreadedNodeLoop.h>

Public Member Functions

 ThreadedNodeLoop (FEProblemBase &fe_problem)
 
 ThreadedNodeLoop (ThreadedNodeLoop &x, Threads::split split)
 
virtual ~ThreadedNodeLoop ()
 
void operator() (const RangeType &range)
 
virtual void pre ()
 Called before the node range loop. More...
 
virtual void post ()
 Called after the node range loop. More...
 
virtual void onNode (IteratorType &node_it)
 Called for each node. More...
 
virtual void postNode (IteratorType &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 Attributes

FEProblemBase_fe_problem
 
THREAD_ID _tid
 

Detailed Description

template<typename RangeType, typename IteratorType>
class ThreadedNodeLoop< RangeType, IteratorType >

Definition at line 17 of file ThreadedNodeLoop.h.

Constructor & Destructor Documentation

◆ ThreadedNodeLoop() [1/2]

template<typename RangeType , typename IteratorType >
ThreadedNodeLoop< RangeType, IteratorType >::ThreadedNodeLoop ( FEProblemBase fe_problem)

Definition at line 74 of file ThreadedNodeLoop.h.

75  : _fe_problem(fe_problem)
76 {
77 }
FEProblemBase & _fe_problem

◆ ThreadedNodeLoop() [2/2]

template<typename RangeType , typename IteratorType >
ThreadedNodeLoop< RangeType, IteratorType >::ThreadedNodeLoop ( ThreadedNodeLoop< RangeType, IteratorType > &  x,
Threads::split  split 
)

Definition at line 80 of file ThreadedNodeLoop.h.

82  : _fe_problem(x._fe_problem)
83 {
84 }
static PetscErrorCode Vec x
FEProblemBase & _fe_problem

◆ ~ThreadedNodeLoop()

template<typename RangeType, typename IteratorType>
virtual ThreadedNodeLoop< RangeType, IteratorType >::~ThreadedNodeLoop ( )
inlinevirtual

Definition at line 25 of file ThreadedNodeLoop.h.

25 {};

Member Function Documentation

◆ caughtMooseException()

template<typename RangeType, typename IteratorType>
virtual void ThreadedNodeLoop< RangeType, IteratorType >::caughtMooseException ( MooseException e)
inlinevirtual

Called if a MooseException is caught anywhere during the computation.

The single input parameter taken is a MooseException object.

Definition at line 55 of file ThreadedNodeLoop.h.

56  {
57  std::string what(e.what());
59  };
virtual const char * what() const
Get out the error message.
virtual void setException(const std::string &message)
Set an exception.
FEProblemBase & _fe_problem

◆ keepGoing()

template<typename RangeType, typename IteratorType>
virtual bool ThreadedNodeLoop< RangeType, IteratorType >::keepGoing ( )
inlinevirtual

Whether or not the loop should continue.

Returns
true to keep going, false to stop.

Definition at line 66 of file ThreadedNodeLoop.h.

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

◆ onNode()

template<typename RangeType , typename IteratorType>
void ThreadedNodeLoop< RangeType, IteratorType >::onNode ( IteratorType &  node_it)
virtual

◆ operator()()

template<typename RangeType, typename IteratorType >
void ThreadedNodeLoop< RangeType, IteratorType >::operator() ( const RangeType &  range)

Definition at line 88 of file ThreadedNodeLoop.h.

89 {
90  try
91  {
92  ParallelUniqueId puid;
93  _tid = puid.id;
94 
95  pre();
96 
97  for (IteratorType nd = range.begin(); nd != range.end(); ++nd)
98  {
99  if (!keepGoing())
100  break;
101 
102  onNode(nd);
103 
104  postNode(nd);
105  }
106 
107  post();
108  }
109  catch (MooseException & e)
110  {
112  }
113 }
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.
Provides a way for users to bail out of the current solve.
virtual void pre()
Called before the node range loop.
virtual void post()
Called after the node range loop.
virtual void postNode(IteratorType &node_it)
Called after the node assembly is done (including surface assembling)
virtual void onNode(IteratorType &node_it)
Called for each node.

◆ post()

template<typename RangeType , typename IteratorType >
void ThreadedNodeLoop< RangeType, IteratorType >::post ( )
virtual

Called after the node range loop.

Reimplemented in ComputeNodalAuxVarsThread.

Definition at line 123 of file ThreadedNodeLoop.h.

124 {
125 }

◆ postNode()

template<typename RangeType , typename IteratorType>
void ThreadedNodeLoop< RangeType, IteratorType >::postNode ( IteratorType &  node_it)
virtual

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

Parameters
node- active node

Definition at line 135 of file ThreadedNodeLoop.h.

136 {
137 }

◆ pre()

template<typename RangeType , typename IteratorType >
void ThreadedNodeLoop< RangeType, IteratorType >::pre ( )
virtual

Called before the node range loop.

Reimplemented in ComputeNodalKernelJacobiansThread, ComputeNodalKernelsThread, ComputeNodalKernelBCJacobiansThread, and ComputeNodalKernelBcsThread.

Definition at line 117 of file ThreadedNodeLoop.h.

118 {
119 }

Member Data Documentation

◆ _fe_problem

template<typename RangeType, typename IteratorType>
FEProblemBase& ThreadedNodeLoop< RangeType, IteratorType >::_fe_problem
protected

◆ _tid

template<typename RangeType, typename IteratorType>
THREAD_ID ThreadedNodeLoop< RangeType, IteratorType >::_tid
protected

Definition at line 70 of file ThreadedNodeLoop.h.


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