38 int sigWriteNow::signal_
46 Foam::Time* Foam::sigWriteNow::runTimePtr_ =
nullptr;
47 struct sigaction
Foam::sigWriteNow::oldAction_;
52 void Foam::sigWriteNow::sigHandler(int)
54 Info<<
"sigWriteNow :"
55 <<
" setting up write at end of the next iteration" <<
nl <<
endl;
56 runTimePtr_->writeOnce();
72 runTimePtr_ = &runTime;
85 if (sigaction(signal_, &oldAction_,
nullptr) < 0)
88 <<
"Cannot reset " << signal_ <<
" trapping"
101 struct sigaction newAction;
102 newAction.sa_handler = sigHandler;
103 newAction.sa_flags = SA_NODEFER;
104 sigemptyset(&newAction.sa_mask);
105 if (sigaction(signal_, &newAction, &oldAction_) < 0)
108 <<
"Cannot set " << signal_ <<
" trapping"
114 Info<<
"sigWriteNow :"
115 <<
" Enabling writing upon signal " << signal_
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.
~sigWriteNow()
Destructor.
bool active() const
Is active?
static void set(const bool verbose)
(re)set signal catcher
sigWriteNow()
Construct null.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
int optimisationSwitch(const char *name, const int defaultValue=0)
Lookup optimisation switch or add default value.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)