38 int sigWriteNow::signal_
67 os << sigWriteNow::signal_;
76 Foam::Time* Foam::sigWriteNow::runTimePtr_ =
nullptr;
79 struct sigaction Foam::sigWriteNow::oldAction_;
84 void Foam::sigWriteNow::sigHandler(int)
86 Info<<
"sigWriteNow :" 87 <<
" setting up write at end of the next iteration" <<
nl <<
endl;
88 runTimePtr_->writeOnce();
117 if (sigaction(signal_, &oldAction_,
nullptr) < 0)
120 <<
"Cannot reset " << signal_ <<
" trapping" 133 struct sigaction newAction;
134 newAction.sa_handler = sigHandler;
135 newAction.sa_flags = SA_NODEFER;
136 sigemptyset(&newAction.sa_mask);
137 if (sigaction(signal_, &newAction, &oldAction_) < 0)
140 <<
"Cannot set " << signal_ <<
" trapping" 146 Info<<
"sigWriteNow :" 147 <<
" Enabling writing upon signal " << signal_
virtual void writeData(Foam::Ostream &os) const
Write.
Abstract base class for registered object with I/O. Used in debug symbol registration.
#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.
~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...
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...
static void set(const bool verbose)
(re)set signal catcher
word name(const complex &)
Return a string representation of a complex.
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)