https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ComputeThreadedGeneralUserObjectsThread.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
11
17
23
25
26void
28{
29 Threads::spin_mutex::scoped_lock lock(threaded_general_user_objects_mutex);
30
31 std::string what(e.what());
33}
34
35void
37{
38 try
39 {
41 for (auto it = range.begin(); it != range.end(); ++it)
42 {
43 auto & tguo = *it;
44 tguo->execute();
45 }
46 }
47 catch (MooseException & e)
48 {
50 }
51}
52
53void
55 const GeneralUserObjectRange & range) const
56{
57 // TODO: Threaded UOs dont know their thread number so this will print too often
58 if (!_fe_problem.shouldPrintExecution(0) || !range.size())
59 return;
60
61 const auto & console = _fe_problem.console();
62 const auto & execute_on = _fe_problem.getCurrentExecuteOnFlag();
63 console << "[DBG] Executing Threaded General User Object " << (*range.begin())->name() << " on "
64 << execute_on << std::endl;
65}
StoredRange< std::vector< GeneralUserObject * >::iterator, GeneralUserObject * > GeneralUserObjectRange
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...
Thread to compute threaded general user objects.
void printGeneralExecutionInformation(const GeneralUserObjectRange &range) const
Print information about the loop, mostly order of execution of objects.
FEProblemBase & _fe_problem
FEProblem running this thread.
virtual void caughtMooseException(MooseException &)
Called if a MooseException is caught anywhere during the computation.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual void setException(const std::string &message)
Set an exception, which is stored at this point by toggling a member variable in this class,...
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.
Provides a way for users to bail out of the current solve.
virtual const char * what() const
Get out the error message.
const ConsoleStream & console() const
Return console handle.
Definition Problem.h:48