ENH: writeFile - enable file creation at a specified time. Fixes #1096

This commit is contained in:
Andrew Heather
2018-11-16 15:20:26 +00:00
parent cab7820fb3
commit 925173d040
2 changed files with 36 additions and 17 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -82,6 +82,9 @@ protected:
//- Flag to identify whether the header has been written
bool writtenHeader_;
//- Start time value
scalar startTime_;
// Protected Member Functions
@ -94,8 +97,18 @@ protected:
//- Return the base directory for the current time value
fileName baseTimeDir() const;
//- Return an autoPtr to a new file for a given time
virtual autoPtr<OFstream> createFile
(
const word& name,
const scalar time
) const;
//- Return an autoPtr to a new file
virtual autoPtr<OFstream> createFile(const word& name) const;
virtual autoPtr<OFstream> createFile
(
const word& name
) const;
//- Reset internal file pointer to new file with new name
virtual void resetFile(const word& name);
@ -142,7 +155,7 @@ public:
//- Destructor
virtual ~writeFile();
virtual ~writeFile() = default;
// Member Functions