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