37 int sigWriteNow::signal_
60 os << sigWriteNow::signal_;
71 struct sigaction
Foam::sigWriteNow::oldAction_;
76 void Foam::sigWriteNow::sigHandler(int)
78 Info<<
"sigWriteNow :" 79 <<
" setting up write at end of the next iteration" <<
nl <<
endl;
96 runTimePtr_ = &runTime;
109 if (sigaction(signal_, &oldAction_, NULL) < 0)
112 <<
"Cannot reset " << signal_ <<
" trapping" 125 struct sigaction newAction;
126 newAction.sa_handler = sigHandler;
127 newAction.sa_flags = SA_NODEFER;
128 sigemptyset(&newAction.sa_mask);
129 if (sigaction(signal_, &newAction, &oldAction_) < 0)
132 <<
"Cannot set " << signal_ <<
" trapping" 138 Info<<
"sigWriteNow :" 139 <<
" Enabling writing upon signal " << signal_
Abstract base class for registered object with I/O. Used in debug symbol registration.
bool active() const
Is active?
#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)...
virtual void writeData(Foam::Ostream &os) const
Write.
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.
~sigWriteNow()
Destructor.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
errorManip< error > abort(error &err)
label readLabel(Istream &is)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
static void set(const bool verbose)
(re)set signal catcher
word name(const complex &)
Return a string representation of a complex.
void writeOnce()
Write the objects once (one shot) and continue the run.
virtual ~addwriteNowSignalToOpt()
addwriteNowSignalToOpt addwriteNowSignalToOpt_("writeNowSignal")
void addOptimisationObject(const char *name, simpleRegIOobject *obj)
Register optimisation switch read/write object.
sigWriteNow()
Construct null.
virtual void readData(Foam::Istream &is)
Read.
addwriteNowSignalToOpt(const char *name)