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 22 of file ThreadedNodeLoop.h.

Constructor & Destructor Documentation

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

Definition at line 79 of file ThreadedNodeLoop.h.

80  : _fe_problem(fe_problem)
81 {
82 }
FEProblemBase & _fe_problem
template<typename RangeType , typename IteratorType >
ThreadedNodeLoop< RangeType, IteratorType >::ThreadedNodeLoop ( ThreadedNodeLoop< RangeType, IteratorType > &  x,
Threads::split  split 
)

Definition at line 85 of file ThreadedNodeLoop.h.

88 {
89 }
FEProblemBase & _fe_problem
template<typename RangeType, typename IteratorType>
virtual ThreadedNodeLoop< RangeType, IteratorType >::~ThreadedNodeLoop ( )
inlinevirtual

Definition at line 30 of file ThreadedNodeLoop.h.

30 {};

Member Function Documentation

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 60 of file ThreadedNodeLoop.h.

Referenced by ThreadedNodeLoop< RangeType, IteratorType >::operator()().

61  {
62  std::string what(e.what());
64  };
virtual void setException(const std::string &message)
Set an exception.
virtual const char * what() const
Get out the error message.
FEProblemBase & _fe_problem
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 71 of file ThreadedNodeLoop.h.

Referenced by ThreadedNodeLoop< RangeType, IteratorType >::operator()().

71 { return !_fe_problem.hasException(); }
FEProblemBase & _fe_problem
virtual bool hasException()
Whether or not an exception has occurred.
template<typename RangeType , typename IteratorType>
void ThreadedNodeLoop< RangeType, IteratorType >::onNode ( IteratorType &  node_it)
virtual
template<typename RangeType, typename IteratorType >
void ThreadedNodeLoop< RangeType, IteratorType >::operator() ( const RangeType &  range)

Definition at line 93 of file ThreadedNodeLoop.h.

Referenced by ThreadedNodeLoop< ConstBndNodeRange, ConstBndNodeRange::const_iterator >::~ThreadedNodeLoop().

94 {
95  try
96  {
97  ParallelUniqueId puid;
98  _tid = puid.id;
99 
100  pre();
101 
102  for (IteratorType nd = range.begin(); nd != range.end(); ++nd)
103  {
104  if (!keepGoing())
105  break;
106 
107  onNode(nd);
108 
109  postNode(nd);
110  }
111 
112  post();
113  }
114  catch (MooseException & e)
115  {
117  }
118 }
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.
template<typename RangeType , typename IteratorType >
void ThreadedNodeLoop< RangeType, IteratorType >::post ( )
virtual
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 140 of file ThreadedNodeLoop.h.

Referenced by ThreadedNodeLoop< RangeType, IteratorType >::operator()(), and ThreadedNodeLoop< ConstBndNodeRange, ConstBndNodeRange::const_iterator >::~ThreadedNodeLoop().

141 {
142 }
template<typename RangeType , typename IteratorType >
void ThreadedNodeLoop< RangeType, IteratorType >::pre ( )
virtual

Member Data Documentation

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

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