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/>.
25 Foam::ensightAsciiStream
32 \*---------------------------------------------------------------------------*/
34 #ifndef ensightAsciiStream_H
35 #define ensightAsciiStream_H
37 #include "ensightStream.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 /*---------------------------------------------------------------------------*\
46 Class ensightAsciiStream Declaration
47 \*---------------------------------------------------------------------------*/
49 class ensightAsciiStream
55 //- Description of data_
59 // Private Member Functions
61 //- Disallow default bitwise copy construct
62 ensightAsciiStream(const ensightAsciiStream&);
64 //- Disallow default bitwise assignment
65 void operator=(const ensightAsciiStream&);
72 //- Construct from components
73 ensightAsciiStream(const fileName& f, const Time& runTime)
79 runTime.writeFormat(),
80 runTime.writeVersion(),
81 IOstream::UNCOMPRESSED
85 str_.setf(ios_base::scientific, ios_base::floatfield);
91 virtual ~ensightAsciiStream()
97 virtual bool ascii() const
102 virtual void write(const char* c)
107 virtual void write(const int v)
109 str_ << setw(10) << v << nl;
112 virtual void write(const scalarField& sf)
116 if (mag(sf[i]) >= scalar(floatScalarVSMALL))
118 str_ << setw(12) << sf[i] << nl;
122 str_ << setw(12) << scalar(0) << nl;
127 virtual void write(const List<int>& sf)
131 str_ << setw(10) << sf[i];
136 virtual void writePartHeader(const label partI)
139 << setw(10) << partI << nl;
148 // IOstream Operators
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 } // End namespace Foam
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 // ************************************************************************* //