1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 Simple demonstration and test application for the CompactIOList container
30 \*---------------------------------------------------------------------------*/
32 #include "IOstreams.H"
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 int main(int argc, char *argv[])
46 # include "setRootCase.H"
47 # include "createTime.H"
49 IOstream::streamFormat format=IOstream::BINARY;
50 // IOstream::streamFormat format=IOstream::ASCII;
52 const label size = 20000000;
58 // Construct big faceList in old format
74 const face f(identity(4));
81 Info<< "Constructed faceList in = "
82 << runTime.cpuTimeIncrement() << " s" << nl << endl;
89 IOstream::currentVersion,
90 IOstream::UNCOMPRESSED
93 Info<< "Written old format faceList in = "
94 << runTime.cpuTimeIncrement() << " s" << nl << endl;
103 polyMesh::meshSubDir,
111 Info<< "Read old format " << faces3.size() << " faceList in = "
112 << runTime.cpuTimeIncrement() << " s" << nl << endl;
120 // Construct big faceList in new format
121 faceCompactIOList faces2
127 polyMesh::meshSubDir,
136 const face f(identity(4));
143 Info<< "Constructed new format faceList in = "
144 << runTime.cpuTimeIncrement() << " s" << nl << endl;
151 IOstream::currentVersion,
152 IOstream::UNCOMPRESSED
155 Info<< "Written new format faceList in = "
156 << runTime.cpuTimeIncrement() << " s" << nl << endl;
159 faceCompactIOList faces3
165 polyMesh::meshSubDir,
173 Info<< "Read new format " << faces3.size() << " faceList in = "
174 << runTime.cpuTimeIncrement() << " s" << nl << endl;
181 // ************************************************************************* //