mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: use IOstreamOption for writeObject() calls.
- reduces the number of parameters that are being passed around and allows future additions into the IOstreamOption with mininal effort.
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -48,8 +49,8 @@ int main(int argc, char *argv[])
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
|
||||
IOstream::streamFormat format=IOstream::BINARY;
|
||||
// IOstream::streamFormat format=IOstream::ASCII;
|
||||
IOstream::streamFormat format = IOstream::BINARY;
|
||||
// IOstream::streamFormat format = IOstream::ASCII;
|
||||
|
||||
const label size = 20000000;
|
||||
|
||||
@ -84,12 +85,9 @@ int main(int argc, char *argv[])
|
||||
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
|
||||
|
||||
|
||||
// Write binary
|
||||
faces2.writeObject
|
||||
(
|
||||
format,
|
||||
IOstream::currentVersion,
|
||||
IOstream::UNCOMPRESSED,
|
||||
IOstreamOption(format),
|
||||
true
|
||||
);
|
||||
|
||||
@ -147,12 +145,9 @@ int main(int argc, char *argv[])
|
||||
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
|
||||
|
||||
|
||||
// Write binary
|
||||
faces2.writeObject
|
||||
(
|
||||
format,
|
||||
IOstream::currentVersion,
|
||||
IOstream::UNCOMPRESSED,
|
||||
IOstreamOption(format),
|
||||
true
|
||||
);
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -643,9 +643,11 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
!runTime.objectRegistry::writeObject
|
||||
(
|
||||
runTime.writeFormat(),
|
||||
IOstream::currentVersion,
|
||||
runTime.writeCompression(),
|
||||
IOstreamOption
|
||||
(
|
||||
runTime.writeFormat(),
|
||||
runTime.writeCompression()
|
||||
),
|
||||
true
|
||||
)
|
||||
)
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -157,12 +157,10 @@ bool writeZones
|
||||
|
||||
Info<< " Writing " << name << endl;
|
||||
|
||||
// Force writing as ascii
|
||||
// Force writing as ASCII
|
||||
writeOk = meshObject.regIOobject::writeObject
|
||||
(
|
||||
IOstream::ASCII,
|
||||
IOstream::currentVersion,
|
||||
compression,
|
||||
IOstreamOption(IOstream::ASCII, compression),
|
||||
true
|
||||
);
|
||||
}
|
||||
@ -471,9 +469,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
parcels.writeObject
|
||||
(
|
||||
runTime.writeFormat(),
|
||||
IOstream::currentVersion,
|
||||
runTime.writeCompression(),
|
||||
IOstreamOption
|
||||
(
|
||||
runTime.writeFormat(),
|
||||
runTime.writeCompression()
|
||||
),
|
||||
parcels.size()
|
||||
);
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -93,14 +93,8 @@ public:
|
||||
virtual void autoMap(const mapPolyMesh&)
|
||||
{}
|
||||
|
||||
//- Switch off writing the objects
|
||||
virtual bool writeObject
|
||||
(
|
||||
IOstream::streamFormat fmt,
|
||||
IOstream::versionNumber ver,
|
||||
IOstream::compressionType cmp,
|
||||
const bool valid
|
||||
) const
|
||||
//- Disable writing objects
|
||||
virtual bool writeObject(IOstreamOption, const bool valid) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -660,9 +660,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "Writing modified " << fieldName << endl;
|
||||
dictList.writeObject
|
||||
(
|
||||
runTime.writeFormat(),
|
||||
IOstream::currentVersion,
|
||||
IOstream::UNCOMPRESSED,
|
||||
IOstreamOption(runTime.writeFormat()),
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2015 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -199,9 +199,7 @@ void createFieldFiles
|
||||
|
||||
fieldOut.regIOobject::writeObject
|
||||
(
|
||||
IOstream::ASCII,
|
||||
IOstream::currentVersion,
|
||||
IOstream::UNCOMPRESSED,
|
||||
IOstreamOption(IOstream::ASCII),
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2007-2019 PCOpt/NTUA
|
||||
Copyright (C) 2013-2019 FOSS GP
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -95,9 +95,7 @@ int main(int argc, char *argv[])
|
||||
// Write modified dictionary
|
||||
optDict.regIOobject::writeObject
|
||||
(
|
||||
IOstream::ASCII,
|
||||
IOstream::currentVersion,
|
||||
IOstream::UNCOMPRESSED,
|
||||
IOstreamOption(IOstream::ASCII),
|
||||
true
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user