1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "jplotSetWriter.H"
33 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
36 Foam::Ostream& Foam::jplotSetWriter<Type>::writeHeader(Ostream& os) const
39 << "# JPlot input file" << nl
41 << "# Generated by sample on " << clock::date().c_str() << nl;
45 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48 Foam::jplotSetWriter<Type>::jplotSetWriter()
54 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
57 Foam::jplotSetWriter<Type>::~jplotSetWriter()
61 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
64 Foam::fileName Foam::jplotSetWriter<Type>::getFileName
66 const coordSet& points,
67 const wordList& valueSetNames
70 return this->getBaseName(points, valueSetNames) + ".dat";
75 void Foam::jplotSetWriter<Type>::write
77 const coordSet& points,
78 const wordList& valueSetNames,
79 const List<const Field<Type>*>& valueSets,
83 os << "# JPlot file" << nl
84 << "# column 1: " << points.name() << nl;
88 os << "# column " << i + 2 << ": " << valueSetNames[i] << nl;
91 // Collect sets into columns
92 List<const List<Type>*> columns(valueSets.size());
96 columns[i] = valueSets[i];
99 writeTable(points, columns, os);
103 // ************************************************************************* //