37 int sigStopAtWriteNow::signal_
55 sigStopAtWriteNow::signal_ =
readLabel(is);
60 os << sigStopAtWriteNow::signal_;
65 "stopAtWriteNowSignal" 73 struct sigaction
Foam::sigStopAtWriteNow::oldAction_;
78 void Foam::sigStopAtWriteNow::sigHandler(int)
81 if (sigaction(signal_, &oldAction_, NULL) < 0)
84 <<
"Cannot reset " << signal_ <<
" trapping" 91 Info<<
"sigStopAtWriteNow :" 92 <<
" setting up write and stop at end of the next iteration" 113 runTimePtr_ = &runTime;
126 if (sigaction(signal_, &oldAction_, NULL) < 0)
129 <<
"Cannot reset " << signal_ <<
" trapping" 143 if (sigWriteNow::signal_ == signal_)
146 <<
"stopAtWriteNowSignal : " << signal_
147 <<
" cannot be the same as the writeNowSignal." 148 <<
" Please change this in the etc/controlDict." 153 struct sigaction newAction;
154 newAction.sa_handler = sigHandler;
155 newAction.sa_flags = SA_NODEFER;
156 sigemptyset(&newAction.sa_mask);
157 if (sigaction(signal_, &newAction, &oldAction_) < 0)
160 <<
"Cannot set " << signal_ <<
" trapping" 166 Info<<
"sigStopAtWriteNow :" 167 <<
" Enabling writing and stopping upon signal " << signal_
Abstract base class for registered object with I/O. Used in debug symbol registration.
virtual void readData(Foam::Istream &is)
Read.
~sigStopAtWriteNow()
Destructor.
errorManipArg< error, int > exit(error &err, const int errNo=1)
set endTime to stop immediately w/ writing
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Ostream & endl(Ostream &os)
Add newline and flush stream.
int optimisationSwitch(const char *name, const int defaultValue=0)
Lookup optimisation switch or add default value.
addstopAtWriteNowSignalToOpt(const char *name)
addstopAtWriteNowSignalToOpt addstopAtWriteNowSignalToOpt_("stopAtWriteNowSignal")
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static void set(const bool verbose)
(re)set signal catcher
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
bool active() const
Is active?
errorManip< error > abort(error &err)
label readLabel(Istream &is)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual ~addstopAtWriteNowSignalToOpt()
word name(const complex &)
Return a string representation of a complex.
sigStopAtWriteNow()
Construct null.
void addOptimisationObject(const char *name, simpleRegIOobject *obj)
Register optimisation switch read/write object.
virtual bool stopAt(const stopAtControls) const
Adjust the current stopAtControl. Note that this value.
virtual void writeData(Foam::Ostream &os) const
Write.