pFlowToVTK now manages when Ctrl+C is used by user
This commit is contained in:
parent
63bd9c9993
commit
edb02ecfc7
|
@ -17,6 +17,7 @@ Licence:
|
||||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
-----------------------------------------------------------------------------*/
|
-----------------------------------------------------------------------------*/
|
||||||
|
#include <csignal>
|
||||||
|
|
||||||
#include "vocabs.hpp"
|
#include "vocabs.hpp"
|
||||||
#include "systemControl.hpp"
|
#include "systemControl.hpp"
|
||||||
|
@ -31,9 +32,23 @@ Licence:
|
||||||
//#include "readControlDict.hpp"
|
//#include "readControlDict.hpp"
|
||||||
|
|
||||||
bool bindaryOutput__;
|
bool bindaryOutput__;
|
||||||
|
static pFlow::uniquePtr<pFlow::PFtoVTK::fileSeries> timeSeriesPtr=nullptr;
|
||||||
|
|
||||||
|
void signal_handler(int signal)
|
||||||
|
{
|
||||||
|
if(signal == SIGINT)
|
||||||
|
{
|
||||||
|
pFlow::output<<"\nPressing Ctrl+C ....\n";
|
||||||
|
timeSeriesPtr.reset(nullptr);
|
||||||
|
fatalExit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv )
|
int main(int argc, char** argv )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
std::signal(SIGINT, signal_handler);
|
||||||
|
|
||||||
pFlow::word outFolder = (pFlow::CWD()/pFlow::word("VTK")).wordPath();
|
pFlow::word outFolder = (pFlow::CWD()/pFlow::word("VTK")).wordPath();
|
||||||
|
|
||||||
pFlow::commandLine cmds(
|
pFlow::commandLine cmds(
|
||||||
|
@ -127,7 +142,8 @@ int main(int argc, char** argv )
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
pFlow::PFtoVTK::fileSeries timeSeries{pFlow::fileSystem(outFolder)};
|
timeSeriesPtr = pFlow::makeUnique<pFlow::PFtoVTK::fileSeries>(pFlow::fileSystem(outFolder));
|
||||||
|
auto& timeSeries = timeSeriesPtr();
|
||||||
pFlow::word fileName;
|
pFlow::word fileName;
|
||||||
pFlow::wordList geomFileNames;
|
pFlow::wordList geomFileNames;
|
||||||
pFlow::wordList surfNames;
|
pFlow::wordList surfNames;
|
||||||
|
|
Loading…
Reference in New Issue