ENH: writeFile - add newFile function

ENH: writeFile - renamed createFile functions
     to newFileAtTime and newFileAtStartTime
This commit is contained in:
Andrew Heather
2022-09-22 14:22:14 +01:00
committed by Mark OLESEN
parent c59b6db3c4
commit f87f0040b8
15 changed files with 99 additions and 31 deletions

View File

@ -206,7 +206,7 @@ void Foam::functionObjects::forceCoeffs::createIntegratedDataFile()
{
if (!coeffFilePtr_.valid())
{
coeffFilePtr_ = createFile("coefficient");
coeffFilePtr_ = newFileAtStartTime("coefficient");
writeIntegratedDataFileHeader("Coefficients", coeffFilePtr_());
}
}

View File

@ -386,13 +386,13 @@ void Foam::functionObjects::forces::createIntegratedDataFiles()
{
if (!forceFilePtr_.valid())
{
forceFilePtr_ = createFile("force");
forceFilePtr_ = newFileAtStartTime("force");
writeIntegratedDataFileHeader("Force", forceFilePtr_());
}
if (!momentFilePtr_.valid())
{
momentFilePtr_ = createFile("moment");
momentFilePtr_ = newFileAtStartTime("moment");
writeIntegratedDataFileHeader("Moment", momentFilePtr_());
}
}

View File

@ -181,7 +181,8 @@ void Foam::functionObjects::propellerInfo::createFiles()
if (writePropellerPerformance_ && !propellerPerformanceFilePtr_)
{
propellerPerformanceFilePtr_ = createFile("propellerPerformance");
propellerPerformanceFilePtr_ =
newFileAtStartTime("propellerPerformance");
auto& os = propellerPerformanceFilePtr_();
writeHeader(os, "Propeller performance");
@ -203,8 +204,9 @@ void Foam::functionObjects::propellerInfo::createFiles()
if (writeWakeFields_)
{
if (!wakeFilePtr_) wakeFilePtr_ = createFile("wake");
if (!axialWakeFilePtr_) axialWakeFilePtr_ = createFile("axialWake");
if (!wakeFilePtr_) wakeFilePtr_ = newFileAtStartTime("wake");
if (!axialWakeFilePtr_) axialWakeFilePtr_ =
newFileAtStartTime("axialWake");
}
}