38 int sigWriteNow::signal_
67 os << sigWriteNow::signal_;
76 Foam::Time* Foam::sigWriteNow::runTimePtr_ =
nullptr;
77 struct sigaction Foam::sigWriteNow::oldAction_;
82 void Foam::sigWriteNow::sigHandler(int)
84 Info<<
"sigWriteNow :" 85 <<
" setting up write at end of the next iteration" <<
nl <<
endl;
86 runTimePtr_->writeOnce();
115 if (sigaction(signal_, &oldAction_,
nullptr) < 0)
118 <<
"Cannot reset " << signal_ <<
" trapping" 131 struct sigaction newAction;
132 newAction.sa_handler = sigHandler;
133 newAction.sa_flags = SA_NODEFER;
134 sigemptyset(&newAction.sa_mask);
135 if (sigaction(signal_, &newAction, &oldAction_) < 0)
138 <<
"Cannot set " << signal_ <<
" trapping" 144 Info<<
"sigWriteNow :" 145 <<
" 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)