www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
ComputeThreadedGeneralUserObjectsThread Class Reference

Thread to compute threaded general user objects. More...

#include <ComputeThreadedGeneralUserObjectsThread.h>

Public Member Functions

 ComputeThreadedGeneralUserObjectsThread (FEProblemBase &fe_problem)
 
 ComputeThreadedGeneralUserObjectsThread (ComputeThreadedGeneralUserObjectsThread &x, Threads::split split)
 
virtual ~ComputeThreadedGeneralUserObjectsThread ()
 
void operator() (const GeneralUserObjectRange &range)
 
void join (const ComputeThreadedGeneralUserObjectsThread &)
 
virtual void caughtMooseException (MooseException &)
 Called if a MooseException is caught anywhere during the computation. More...
 

Protected Attributes

FEProblemBase_fe_problem
 FEProblem running this thread. More...
 

Detailed Description

Thread to compute threaded general user objects.

This works on a range of thread IDs, so that we always compute all user objects for every threaded copy.

Definition at line 35 of file ComputeThreadedGeneralUserObjectsThread.h.

Constructor & Destructor Documentation

◆ ComputeThreadedGeneralUserObjectsThread() [1/2]

ComputeThreadedGeneralUserObjectsThread::ComputeThreadedGeneralUserObjectsThread ( FEProblemBase fe_problem)

Definition at line 12 of file ComputeThreadedGeneralUserObjectsThread.C.

14  : _fe_problem(fe_problem)
15 {
16 }
FEProblemBase & _fe_problem
FEProblem running this thread.

◆ ComputeThreadedGeneralUserObjectsThread() [2/2]

ComputeThreadedGeneralUserObjectsThread::ComputeThreadedGeneralUserObjectsThread ( ComputeThreadedGeneralUserObjectsThread x,
Threads::split  split 
)

Definition at line 18 of file ComputeThreadedGeneralUserObjectsThread.C.

20  : _fe_problem(x._fe_problem)
21 {
22 }
FEProblemBase & _fe_problem
FEProblem running this thread.
static PetscErrorCode Vec x

◆ ~ComputeThreadedGeneralUserObjectsThread()

ComputeThreadedGeneralUserObjectsThread::~ComputeThreadedGeneralUserObjectsThread ( )
virtual

Definition at line 24 of file ComputeThreadedGeneralUserObjectsThread.C.

24 {}

Member Function Documentation

◆ caughtMooseException()

void ComputeThreadedGeneralUserObjectsThread::caughtMooseException ( MooseException e)
virtual

Called if a MooseException is caught anywhere during the computation.

The single input parameter taken is a MooseException object.

Definition at line 27 of file ComputeThreadedGeneralUserObjectsThread.C.

Referenced by operator()().

28 {
29  Threads::spin_mutex::scoped_lock lock(threaded_general_user_objects_mutex);
30 
31  std::string what(e.what());
33 }
virtual const char * what() const
Get out the error message.
FEProblemBase & _fe_problem
FEProblem running this thread.
virtual void setException(const std::string &message)
Set an exception.
static Threads::spin_mutex threaded_general_user_objects_mutex
This mutex is used to protect the creation of the strings used in the propogation of the error messag...

◆ join()

void ComputeThreadedGeneralUserObjectsThread::join ( const ComputeThreadedGeneralUserObjectsThread )
inline

Definition at line 46 of file ComputeThreadedGeneralUserObjectsThread.h.

46 {}

◆ operator()()

void ComputeThreadedGeneralUserObjectsThread::operator() ( const GeneralUserObjectRange range)

Definition at line 36 of file ComputeThreadedGeneralUserObjectsThread.C.

37 {
38  try
39  {
40  for (auto it = range.begin(); it != range.end(); ++it)
41  {
42  auto & tguo = *it;
43  tguo->execute();
44  }
45  }
46  catch (MooseException & e)
47  {
49  }
50 }
virtual void caughtMooseException(MooseException &)
Called if a MooseException is caught anywhere during the computation.
Provides a way for users to bail out of the current solve.

Member Data Documentation

◆ _fe_problem

FEProblemBase& ComputeThreadedGeneralUserObjectsThread::_fe_problem
protected

FEProblem running this thread.

Definition at line 56 of file ComputeThreadedGeneralUserObjectsThread.h.

Referenced by caughtMooseException().


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