From 7cf90b039e0de55baeed3aeeb3db9c6cf4c5d3fc Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 21 Nov 2008 21:46:06 +0100 Subject: [PATCH] sampling: use new runtime macros and avoid typedefs for each writer/instance --- .../preProcessing/mapFields/MapVolFields.H | 1 - src/sampling/Make/files | 28 ++++--- .../gnuplot/{gnuplot.C => gnuplotSetWriter.C} | 11 ++- .../gnuplot/{gnuplot.H => gnuplotSetWriter.H} | 18 ++--- ...lotWriters.C => gnuplotSetWriterRunTime.C} | 5 +- .../writers/gnuplot/gnuplotWriters.H | 51 ------------ .../jplot/{jplot.C => jplotSetWriter.C} | 20 +++-- .../jplot/{jplot.H => jplotSetWriter.H} | 18 ++--- .../jplotSetWriterRunTime.C} | 5 +- .../sampledSet/writers/jplot/jplotWriters.H | 51 ------------ .../writers/raw/{raw.C => rawSetWriter.C} | 11 ++- .../writers/raw/{raw.H => rawSetWriter.H} | 18 ++--- .../rawSetWriterRunTime.C} | 5 +- .../sampledSet/writers/raw/rawWriters.H | 51 ------------ .../sampledSet/writers/{writer => }/writer.C | 0 .../sampledSet/writers/{writer => }/writer.H | 43 ---------- .../sampledSet/writers/writer/writers.C | 55 ------------- .../sampledSet/writers/writer/writers.H | 50 ------------ src/sampling/sampledSet/writers/writers.C | 50 ++++++++++++ src/sampling/sampledSet/writers/writers.H | 80 +++++++++++++++++++ .../sampledSet/writers/xmgr/xmgrWriters.H | 54 ------------- .../xmgr.C => xmgrace/xmgraceSetWriter.C} | 12 ++- .../xmgr.H => xmgrace/xmgraceSetWriter.H} | 18 ++--- .../xmgraceSetWriterRunTime.C} | 5 +- .../writers/dx/{dx.C => dxSurfaceWriter.C} | 36 ++++----- .../writers/dx/{dx.H => dxSurfaceWriter.H} | 18 ++--- .../{dxWriters.C => dxSurfaceWriterRunTime.C} | 5 +- .../sampledSurface/writers/dx/dxWriters.H | 63 --------------- .../{foamFile.C => foamFileSurfaceWriter.C} | 32 +++----- .../{foamFile.H => foamFileSurfaceWriter.H} | 18 ++--- .../foamFile/foamFileSurfaceWriterRunTime.C | 44 ++++++++++ .../writers/foamFile/foamFileWriters.H | 63 --------------- .../null/{null.C => nullSurfaceWriter.C} | 8 +- .../null/{null.H => nullSurfaceWriter.H} | 18 ++--- .../writers/null/nullSurfaceWriterRunTime.C | 44 ++++++++++ .../sampledSurface/writers/null/nullWriters.H | 63 --------------- .../writers/raw/rawSurfaceWriter.C | 9 +-- ...aceWriters.C => rawSurfaceWriterRunTime.C} | 3 +- .../writers/raw/rawSurfaceWriters.H | 63 --------------- .../writers/stl/{stl.C => stlSurfaceWriter.C} | 14 ++-- .../writers/stl/{stl.H => stlSurfaceWriter.H} | 18 ++--- .../stlSurfaceWriterRunTime.C} | 5 +- .../sampledSurface/writers/stl/stlWriters.C | 43 ---------- .../sampledSurface/writers/stl/stlWriters.H | 63 --------------- .../sampledSurface/writers/surfaceWriter.H | 35 -------- .../sampledSurface/writers/surfaceWriters.C | 22 ++--- .../sampledSurface/writers/surfaceWriters.H | 38 ++++++--- .../writers/vtk/{vtk.C => vtkSurfaceWriter.C} | 73 ++++++++--------- .../writers/vtk/{vtk.H => vtkSurfaceWriter.H} | 18 ++--- .../vtkSurfaceWriterRunTime.C} | 5 +- .../sampledSurface/writers/vtk/vtkWriters.C | 43 ---------- .../sampledSurface/writers/vtk/vtkWriters.H | 63 --------------- 52 files changed, 479 insertions(+), 1108 deletions(-) rename src/sampling/sampledSet/writers/gnuplot/{gnuplot.C => gnuplotSetWriter.C} (91%) rename src/sampling/sampledSet/writers/gnuplot/{gnuplot.H => gnuplotSetWriter.H} (89%) rename src/sampling/sampledSet/writers/gnuplot/{gnuplotWriters.C => gnuplotSetWriterRunTime.C} (94%) delete mode 100644 src/sampling/sampledSet/writers/gnuplot/gnuplotWriters.H rename src/sampling/sampledSet/writers/jplot/{jplot.C => jplotSetWriter.C} (87%) rename src/sampling/sampledSet/writers/jplot/{jplot.H => jplotSetWriter.H} (90%) rename src/sampling/sampledSet/writers/{xmgr/xmgrWriters.C => jplot/jplotSetWriterRunTime.C} (94%) delete mode 100644 src/sampling/sampledSet/writers/jplot/jplotWriters.H rename src/sampling/sampledSet/writers/raw/{raw.C => rawSetWriter.C} (91%) rename src/sampling/sampledSet/writers/raw/{raw.H => rawSetWriter.H} (90%) rename src/sampling/sampledSet/writers/{jplot/jplotWriters.C => raw/rawSetWriterRunTime.C} (94%) delete mode 100644 src/sampling/sampledSet/writers/raw/rawWriters.H rename src/sampling/sampledSet/writers/{writer => }/writer.C (100%) rename src/sampling/sampledSet/writers/{writer => }/writer.H (69%) delete mode 100644 src/sampling/sampledSet/writers/writer/writers.C delete mode 100644 src/sampling/sampledSet/writers/writer/writers.H create mode 100644 src/sampling/sampledSet/writers/writers.C create mode 100644 src/sampling/sampledSet/writers/writers.H delete mode 100644 src/sampling/sampledSet/writers/xmgr/xmgrWriters.H rename src/sampling/sampledSet/writers/{xmgr/xmgr.C => xmgrace/xmgraceSetWriter.C} (91%) rename src/sampling/sampledSet/writers/{xmgr/xmgr.H => xmgrace/xmgraceSetWriter.H} (89%) rename src/sampling/sampledSet/writers/{raw/rawWriters.C => xmgrace/xmgraceSetWriterRunTime.C} (94%) rename src/sampling/sampledSurface/writers/dx/{dx.C => dxSurfaceWriter.C} (90%) rename src/sampling/sampledSurface/writers/dx/{dx.H => dxSurfaceWriter.H} (92%) rename src/sampling/sampledSurface/writers/dx/{dxWriters.C => dxSurfaceWriterRunTime.C} (94%) delete mode 100644 src/sampling/sampledSurface/writers/dx/dxWriters.H rename src/sampling/sampledSurface/writers/foamFile/{foamFile.C => foamFileSurfaceWriter.C} (78%) rename src/sampling/sampledSurface/writers/foamFile/{foamFile.H => foamFileSurfaceWriter.H} (88%) create mode 100644 src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriterRunTime.C delete mode 100644 src/sampling/sampledSurface/writers/foamFile/foamFileWriters.H rename src/sampling/sampledSurface/writers/null/{null.C => nullSurfaceWriter.C} (92%) rename src/sampling/sampledSurface/writers/null/{null.H => nullSurfaceWriter.H} (89%) create mode 100644 src/sampling/sampledSurface/writers/null/nullSurfaceWriterRunTime.C delete mode 100644 src/sampling/sampledSurface/writers/null/nullWriters.H rename src/sampling/sampledSurface/writers/raw/{rawSurfaceWriters.C => rawSurfaceWriterRunTime.C} (96%) delete mode 100644 src/sampling/sampledSurface/writers/raw/rawSurfaceWriters.H rename src/sampling/sampledSurface/writers/stl/{stl.C => stlSurfaceWriter.C} (89%) rename src/sampling/sampledSurface/writers/stl/{stl.H => stlSurfaceWriter.H} (90%) rename src/sampling/sampledSurface/writers/{foamFile/foamFileWriters.C => stl/stlSurfaceWriterRunTime.C} (94%) delete mode 100644 src/sampling/sampledSurface/writers/stl/stlWriters.C delete mode 100644 src/sampling/sampledSurface/writers/stl/stlWriters.H rename src/sampling/sampledSurface/writers/vtk/{vtk.C => vtkSurfaceWriter.C} (85%) rename src/sampling/sampledSurface/writers/vtk/{vtk.H => vtkSurfaceWriter.H} (92%) rename src/sampling/sampledSurface/writers/{null/nullWriters.C => vtk/vtkSurfaceWriterRunTime.C} (94%) delete mode 100644 src/sampling/sampledSurface/writers/vtk/vtkWriters.C delete mode 100644 src/sampling/sampledSurface/writers/vtk/vtkWriters.H diff --git a/applications/utilities/preProcessing/mapFields/MapVolFields.H b/applications/utilities/preProcessing/mapFields/MapVolFields.H index d72ae2948d..affbbb68f0 100644 --- a/applications/utilities/preProcessing/mapFields/MapVolFields.H +++ b/applications/utilities/preProcessing/mapFields/MapVolFields.H @@ -29,7 +29,6 @@ License #include "GeometricField.H" #include "meshToMesh.H" -#include "cuttingPlane.H" #include "IOobjectList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/Make/files b/src/sampling/Make/files index 991057a157..c20d4aa7a6 100644 --- a/src/sampling/Make/files +++ b/src/sampling/Make/files @@ -12,11 +12,13 @@ sampledSet/midPointAndFace/midPointAndFaceSet.C sampledSet/sampledSets/sampledSets.C sampledSet/sampledSetsFunctionObject/sampledSetsFunctionObject.C -sampledSet/writers/writer/writers.C -sampledSet/writers/raw/rawWriters.C -sampledSet/writers/xmgr/xmgrWriters.C -sampledSet/writers/gnuplot/gnuplotWriters.C -sampledSet/writers/jplot/jplotWriters.C +setWriters = sampledSet/writers + +$(setWriters)/writers.C +$(setWriters)/gnuplot/gnuplotSetWriterRunTime.C +$(setWriters)/jplot/jplotSetWriterRunTime.C +$(setWriters)/raw/rawSetWriterRunTime.C +$(setWriters)/xmgrace/xmgraceSetWriterRunTime.C cuttingPlane/cuttingPlane.C @@ -31,13 +33,15 @@ sampledSurface/sampledSurface/sampledSurface.C sampledSurface/sampledSurfaces/sampledSurfaces.C sampledSurface/sampledSurfacesFunctionObject/sampledSurfacesFunctionObject.C -sampledSurface/writers/surfaceWriters.C -sampledSurface/writers/foamFile/foamFileWriters.C -sampledSurface/writers/dx/dxWriters.C -sampledSurface/writers/raw/rawSurfaceWriters.C -sampledSurface/writers/vtk/vtkWriters.C -sampledSurface/writers/stl/stlWriters.C -sampledSurface/writers/null/nullWriters.C +surfWriters = sampledSurface/writers + +$(surfWriters)/surfaceWriters.C +$(surfWriters)/dx/dxSurfaceWriterRunTime.C +$(surfWriters)/foamFile/foamFileSurfaceWriterRunTime.C +$(surfWriters)/null/nullSurfaceWriterRunTime.C +$(surfWriters)/raw/rawSurfaceWriterRunTime.C +$(surfWriters)/stl/stlSurfaceWriterRunTime.C +$(surfWriters)/vtk/vtkSurfaceWriterRunTime.C graphField/writePatchGraph.C graphField/writeCellGraph.C diff --git a/src/sampling/sampledSet/writers/gnuplot/gnuplot.C b/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.C similarity index 91% rename from src/sampling/sampledSet/writers/gnuplot/gnuplot.C rename to src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.C index e394de1d3a..07976741bc 100644 --- a/src/sampling/sampledSet/writers/gnuplot/gnuplot.C +++ b/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "gnuplot.H" +#include "gnuplotSetWriter.H" #include "clock.H" #include "coordSet.H" #include "fileName.H" @@ -34,9 +34,8 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components template -Foam::gnuplot::gnuplot() +Foam::gnuplotSetWriter::gnuplotSetWriter() : writer() {} @@ -44,14 +43,14 @@ Foam::gnuplot::gnuplot() // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template -Foam::gnuplot::~gnuplot() +Foam::gnuplotSetWriter::~gnuplotSetWriter() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -Foam::fileName Foam::gnuplot::getFileName +Foam::fileName Foam::gnuplotSetWriter::getFileName ( const coordSet& points, const wordList& valueSetNames @@ -62,7 +61,7 @@ Foam::fileName Foam::gnuplot::getFileName template -void Foam::gnuplot::write +void Foam::gnuplotSetWriter::write ( const coordSet& points, const wordList& valueSetNames, diff --git a/src/sampling/sampledSet/writers/gnuplot/gnuplot.H b/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.H similarity index 89% rename from src/sampling/sampledSet/writers/gnuplot/gnuplot.H rename to src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.H index d531ac4aeb..07022266ad 100644 --- a/src/sampling/sampledSet/writers/gnuplot/gnuplot.H +++ b/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.H @@ -23,17 +23,17 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::gnuplot + Foam::gnuplotSetWriter Description SourceFiles - gnuplot.C + gnuplotSetWriter.C \*---------------------------------------------------------------------------*/ -#ifndef gnuplot_H -#define gnuplot_H +#ifndef gnuplotSetWriter_H +#define gnuplotSetWriter_H #include "writer.H" @@ -43,11 +43,11 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class gnuplot Declaration + Class gnuplotSetWriter Declaration \*---------------------------------------------------------------------------*/ template -class gnuplot +class gnuplotSetWriter : public writer { @@ -61,11 +61,11 @@ public: // Constructors //- Construct null - gnuplot(); + gnuplotSetWriter(); //- Destructor - virtual ~gnuplot(); + virtual ~gnuplotSetWriter(); // Member Functions @@ -93,7 +93,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "gnuplot.C" +# include "gnuplotSetWriter.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSet/writers/gnuplot/gnuplotWriters.C b/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriterRunTime.C similarity index 94% rename from src/sampling/sampledSet/writers/gnuplot/gnuplotWriters.C rename to src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriterRunTime.C index 7abc5c8fd0..f8855ea657 100644 --- a/src/sampling/sampledSet/writers/gnuplot/gnuplotWriters.C +++ b/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriterRunTime.C @@ -24,14 +24,15 @@ License \*---------------------------------------------------------------------------*/ -#include "gnuplotWriters.H" +#include "gnuplotSetWriter.H" +#include "writers.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeWriters(gnuplot) + makeSetWriters(gnuplotSetWriter) } // ************************************************************************* // diff --git a/src/sampling/sampledSet/writers/gnuplot/gnuplotWriters.H b/src/sampling/sampledSet/writers/gnuplot/gnuplotWriters.H deleted file mode 100644 index 6f125366f2..0000000000 --- a/src/sampling/sampledSet/writers/gnuplot/gnuplotWriters.H +++ /dev/null @@ -1,51 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -InClass - Foam::gnuplotWriters - -SourceFiles - gnuplotWriters.C - -\*---------------------------------------------------------------------------*/ - -#ifndef gnuplotWriters_H -#define gnuplotWriters_H - -#include "gnuplot.H" -#include "writers.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeWritersTypedefs(gnuplot) -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/sampling/sampledSet/writers/jplot/jplot.C b/src/sampling/sampledSet/writers/jplot/jplotSetWriter.C similarity index 87% rename from src/sampling/sampledSet/writers/jplot/jplot.C rename to src/sampling/sampledSet/writers/jplot/jplotSetWriter.C index 31775302fb..cc9ada6352 100644 --- a/src/sampling/sampledSet/writers/jplot/jplot.C +++ b/src/sampling/sampledSet/writers/jplot/jplotSetWriter.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "jplot.H" +#include "jplotSetWriter.H" #include "clock.H" #include "coordSet.H" #include "fileName.H" @@ -34,21 +34,19 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template -Foam::Ostream& Foam::jplot::writeHeader(Ostream& os) const +Foam::Ostream& Foam::jplotSetWriter::writeHeader(Ostream& os) const { return os - << "# JPlot input file" << endl - << "#" << endl - << endl + << "# JPlot input file" << nl + << "#" << nl << nl << "# Generated by sample on " << clock::date().c_str() << endl; } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components template -Foam::jplot::jplot() +Foam::jplotSetWriter::jplotSetWriter() : writer() {} @@ -57,14 +55,14 @@ Foam::jplot::jplot() // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template -Foam::jplot::~jplot() +Foam::jplotSetWriter::~jplotSetWriter() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -Foam::fileName Foam::jplot::getFileName +Foam::fileName Foam::jplotSetWriter::getFileName ( const coordSet& points, const wordList& valueSetNames @@ -75,7 +73,7 @@ Foam::fileName Foam::jplot::getFileName template -void Foam::jplot::write +void Foam::jplotSetWriter::write ( const coordSet& points, const wordList& valueSetNames, @@ -83,7 +81,7 @@ void Foam::jplot::write Ostream& os ) const { - os << "# JPlot file" << endl + os << "# JPlot file" << nl << "# column 1: " << points.name() << endl; forAll(valueSets, i) diff --git a/src/sampling/sampledSet/writers/jplot/jplot.H b/src/sampling/sampledSet/writers/jplot/jplotSetWriter.H similarity index 90% rename from src/sampling/sampledSet/writers/jplot/jplot.H rename to src/sampling/sampledSet/writers/jplot/jplotSetWriter.H index 45a39ebe16..c6df63dc3a 100644 --- a/src/sampling/sampledSet/writers/jplot/jplot.H +++ b/src/sampling/sampledSet/writers/jplot/jplotSetWriter.H @@ -23,15 +23,15 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::jplot + Foam::jplotSetWriter SourceFiles - jplot.C + jplotSetWriter.C \*---------------------------------------------------------------------------*/ -#ifndef jplot_H -#define jplot_H +#ifndef jplotSetWriter_H +#define jplotSetWriter_H #include "writer.H" #include "vector.H" @@ -42,11 +42,11 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class jplot Declaration + Class jplotSetWriter Declaration \*---------------------------------------------------------------------------*/ template -class jplot +class jplotSetWriter : public writer { @@ -65,11 +65,11 @@ public: // Constructors //- Construct null - jplot(); + jplotSetWriter(); //- Destructor - virtual ~jplot(); + virtual ~jplotSetWriter(); // Member Functions @@ -97,7 +97,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "jplot.C" +# include "jplotSetWriter.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSet/writers/xmgr/xmgrWriters.C b/src/sampling/sampledSet/writers/jplot/jplotSetWriterRunTime.C similarity index 94% rename from src/sampling/sampledSet/writers/xmgr/xmgrWriters.C rename to src/sampling/sampledSet/writers/jplot/jplotSetWriterRunTime.C index 90828ad64f..c5a6fe6a02 100644 --- a/src/sampling/sampledSet/writers/xmgr/xmgrWriters.C +++ b/src/sampling/sampledSet/writers/jplot/jplotSetWriterRunTime.C @@ -24,14 +24,15 @@ License \*---------------------------------------------------------------------------*/ -#include "xmgrWriters.H" +#include "jplotSetWriter.H" +#include "writers.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeWriters(xmgr) + makeSetWriters(jplotSetWriter) } // ************************************************************************* // diff --git a/src/sampling/sampledSet/writers/jplot/jplotWriters.H b/src/sampling/sampledSet/writers/jplot/jplotWriters.H deleted file mode 100644 index 21b0121ec0..0000000000 --- a/src/sampling/sampledSet/writers/jplot/jplotWriters.H +++ /dev/null @@ -1,51 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -InClass - Foam::jplotWriters - -SourceFiles - jplotWriters.C - -\*---------------------------------------------------------------------------*/ - -#ifndef jplotWriters_H -#define jplotWriters_H - -#include "jplot.H" -#include "writers.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeWritersTypedefs(jplot) -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/sampling/sampledSet/writers/raw/raw.C b/src/sampling/sampledSet/writers/raw/rawSetWriter.C similarity index 91% rename from src/sampling/sampledSet/writers/raw/raw.C rename to src/sampling/sampledSet/writers/raw/rawSetWriter.C index 021e50c5c9..d8e6f060ed 100644 --- a/src/sampling/sampledSet/writers/raw/raw.C +++ b/src/sampling/sampledSet/writers/raw/rawSetWriter.C @@ -24,16 +24,15 @@ License \*---------------------------------------------------------------------------*/ -#include "raw.H" +#include "rawSetWriter.H" #include "coordSet.H" #include "fileName.H" #include "OFstream.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components template -Foam::raw::raw() +Foam::rawSetWriter::rawSetWriter() : writer() {} @@ -42,14 +41,14 @@ Foam::raw::raw() // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template -Foam::raw::~raw() +Foam::rawSetWriter::~rawSetWriter() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -Foam::fileName Foam::raw::getFileName +Foam::fileName Foam::rawSetWriter::getFileName ( const coordSet& points, const wordList& valueSetNames @@ -60,7 +59,7 @@ Foam::fileName Foam::raw::getFileName template -void Foam::raw::write +void Foam::rawSetWriter::write ( const coordSet& points, const wordList& valueSetNames, diff --git a/src/sampling/sampledSet/writers/raw/raw.H b/src/sampling/sampledSet/writers/raw/rawSetWriter.H similarity index 90% rename from src/sampling/sampledSet/writers/raw/raw.H rename to src/sampling/sampledSet/writers/raw/rawSetWriter.H index 1f4b856f66..961c5a5c7a 100644 --- a/src/sampling/sampledSet/writers/raw/raw.H +++ b/src/sampling/sampledSet/writers/raw/rawSetWriter.H @@ -23,17 +23,17 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::raw + Foam::rawSetWriter Description SourceFiles - raw.C + rawSetWriter.C \*---------------------------------------------------------------------------*/ -#ifndef raw_H -#define raw_H +#ifndef rawSetWriter_H +#define rawSetWriter_H #include "writer.H" @@ -43,11 +43,11 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class raw Declaration + Class rawSetWriter Declaration \*---------------------------------------------------------------------------*/ template -class raw +class rawSetWriter : public writer { @@ -61,11 +61,11 @@ public: // Constructors //- Construct null - raw(); + rawSetWriter(); //- Destructor - virtual ~raw(); + virtual ~rawSetWriter(); // Member Functions @@ -93,7 +93,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "raw.C" +# include "rawSetWriter.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSet/writers/jplot/jplotWriters.C b/src/sampling/sampledSet/writers/raw/rawSetWriterRunTime.C similarity index 94% rename from src/sampling/sampledSet/writers/jplot/jplotWriters.C rename to src/sampling/sampledSet/writers/raw/rawSetWriterRunTime.C index b117178971..d3ac5e272b 100644 --- a/src/sampling/sampledSet/writers/jplot/jplotWriters.C +++ b/src/sampling/sampledSet/writers/raw/rawSetWriterRunTime.C @@ -24,14 +24,15 @@ License \*---------------------------------------------------------------------------*/ -#include "jplotWriters.H" +#include "rawSetWriter.H" +#include "writers.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeWriters(jplot) + makeSetWriters(rawSetWriter) } // ************************************************************************* // diff --git a/src/sampling/sampledSet/writers/raw/rawWriters.H b/src/sampling/sampledSet/writers/raw/rawWriters.H deleted file mode 100644 index 020b750fe2..0000000000 --- a/src/sampling/sampledSet/writers/raw/rawWriters.H +++ /dev/null @@ -1,51 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -InClass - Foam::rawWriters - -SourceFiles - rawWriters.C - -\*---------------------------------------------------------------------------*/ - -#ifndef rawWriters_H -#define rawWriters_H - -#include "raw.H" -#include "writers.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeWritersTypedefs(raw) -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/sampling/sampledSet/writers/writer/writer.C b/src/sampling/sampledSet/writers/writer.C similarity index 100% rename from src/sampling/sampledSet/writers/writer/writer.C rename to src/sampling/sampledSet/writers/writer.C diff --git a/src/sampling/sampledSet/writers/writer/writer.H b/src/sampling/sampledSet/writers/writer.H similarity index 69% rename from src/sampling/sampledSet/writers/writer/writer.H rename to src/sampling/sampledSet/writers/writer.H index 73fe2fd10f..901575fde7 100644 --- a/src/sampling/sampledSet/writers/writer/writer.H +++ b/src/sampling/sampledSet/writers/writer.H @@ -205,49 +205,6 @@ public: # include "writer.C" #endif -// Only used internally -#define makeTypeWritersTypeName(type) \ - \ -defineNamedTemplateTypeNameAndDebug(type, 0); - -// Used externally sometimes -#define makeWritersTypeName(typeWriter) \ - \ -makeTypeWritersTypeName(typeWriter##ScalarWriter); \ -makeTypeWritersTypeName(typeWriter##VectorWriter); \ -makeTypeWritersTypeName(typeWriter##SphericalTensorWriter); \ -makeTypeWritersTypeName(typeWriter##SymmTensorWriter); \ -makeTypeWritersTypeName(typeWriter##TensorWriter); - -// Define type info for single template instantiation (e.g. vector) -#define makeWriterTypes(WriterType, type) \ - \ -defineNamedTemplateTypeNameAndDebug(type, 0); \ - \ -addToRunTimeSelectionTable \ -( \ - WriterType, type, word \ -); - - -// Define type info info for scalar, vector etc. instantiations -#define makeWriters(typeWriter) \ - \ -makeWriterTypes(writerScalarWriter, typeWriter##ScalarWriter); \ -makeWriterTypes(writerVectorWriter, typeWriter##VectorWriter); \ -makeWriterTypes(writerSphericalTensorWriter, typeWriter##SphericalTensorWriter);\ -makeWriterTypes(writerSymmTensorWriter, typeWriter##SymmTensorWriter); \ -makeWriterTypes(writerTensorWriter, typeWriter##TensorWriter); - - -#define makeWritersTypedefs(typeWriter) \ - \ -typedef typeWriter typeWriter##ScalarWriter; \ -typedef typeWriter typeWriter##VectorWriter; \ -typedef typeWriter typeWriter##SphericalTensorWriter; \ -typedef typeWriter typeWriter##SymmTensorWriter; \ -typedef typeWriter typeWriter##TensorWriter; - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSet/writers/writer/writers.C b/src/sampling/sampledSet/writers/writer/writers.C deleted file mode 100644 index 8aaa5c4127..0000000000 --- a/src/sampling/sampledSet/writers/writer/writers.C +++ /dev/null @@ -1,55 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "writers.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineNamedTemplateTypeNameAndDebug(writerScalarWriter, 0); -defineTemplateRunTimeSelectionTable(writerScalarWriter, word); - -defineNamedTemplateTypeNameAndDebug(writerVectorWriter, 0); -defineTemplateRunTimeSelectionTable(writerVectorWriter, word); - -defineNamedTemplateTypeNameAndDebug(writerSphericalTensorWriter, 0); -defineTemplateRunTimeSelectionTable(writerSphericalTensorWriter, word); - -defineNamedTemplateTypeNameAndDebug(writerSymmTensorWriter, 0); -defineTemplateRunTimeSelectionTable(writerSymmTensorWriter, word); - -defineNamedTemplateTypeNameAndDebug(writerTensorWriter, 0); -defineTemplateRunTimeSelectionTable(writerTensorWriter, word); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/sampling/sampledSet/writers/writer/writers.H b/src/sampling/sampledSet/writers/writer/writers.H deleted file mode 100644 index ba46c5880a..0000000000 --- a/src/sampling/sampledSet/writers/writer/writers.H +++ /dev/null @@ -1,50 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -InClass - Foam::rawWriters - -SourceFiles - writers.C - -\*---------------------------------------------------------------------------*/ - -#ifndef writers_H -#define writers_H - -#include "writer.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeWritersTypedefs(writer) -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/sampling/sampledSet/writers/writers.C b/src/sampling/sampledSet/writers/writers.C new file mode 100644 index 0000000000..7e624292a3 --- /dev/null +++ b/src/sampling/sampledSet/writers/writers.C @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "writers.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +#define defineSetWriterType(dataType) \ + defineNamedTemplateTypeNameAndDebug(writer, 0); \ + defineTemplatedRunTimeSelectionTable(writer, word, dataType); + +defineSetWriterType(scalar); +defineSetWriterType(vector); +defineSetWriterType(sphericalTensor); +defineSetWriterType(symmTensor); +defineSetWriterType(tensor); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/sampling/sampledSet/writers/writers.H b/src/sampling/sampledSet/writers/writers.H new file mode 100644 index 0000000000..080fb4f013 --- /dev/null +++ b/src/sampling/sampledSet/writers/writers.H @@ -0,0 +1,80 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +InClass + Foam::writer + +SourceFiles + writers.C + +\*---------------------------------------------------------------------------*/ + +#ifndef writers_H +#define writers_H + +#include "writer.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Only used internally +#define makeTypeSetWritersTypeName(typeWriter, dataType) \ + \ + defineNamedTemplateTypeNameAndDebug(typeWriter, 0); + +// Sometimes used externally +#define makeSetWritersTypeName(typeWriter) \ + \ + makeTypeSetWritersTypeName(typeWriter, scalar); \ + makeTypeSetWritersTypeName(typeWriter, vector); \ + makeTypeSetWritersTypeName(typeWriter, sphericalTensor); \ + makeTypeSetWritersTypeName(typeWriter, symmTensor); \ + makeTypeSetWritersTypeName(typeWriter, tensor); + +// Define type info for single dataType template instantiation (eg, vector) +#define makeSetWriterType(typeWriter, dataType) \ + \ + defineNamedTemplateTypeNameAndDebug(typeWriter, 0); \ + addTemplatedToRunTimeSelectionTable \ + ( \ + writer, typeWriter, dataType, word \ + ); + + +// Define type info for scalar, vector etc. instantiations +#define makeSetWriters(typeWriter) \ + \ + makeSetWriterType(typeWriter, scalar); \ + makeSetWriterType(typeWriter, vector); \ + makeSetWriterType(typeWriter, sphericalTensor); \ + makeSetWriterType(typeWriter, symmTensor); \ + makeSetWriterType(typeWriter, tensor); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/sampling/sampledSet/writers/xmgr/xmgrWriters.H b/src/sampling/sampledSet/writers/xmgr/xmgrWriters.H deleted file mode 100644 index b1b554409a..0000000000 --- a/src/sampling/sampledSet/writers/xmgr/xmgrWriters.H +++ /dev/null @@ -1,54 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -InClass - Foam::xmgrWriters - -Description - -SourceFiles - xmgrWriters.C - - -\*---------------------------------------------------------------------------*/ - -#ifndef xmgrWriters_H -#define xmgrWriters_H - -#include "xmgr.H" -#include "writers.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeWritersTypedefs(xmgr) -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/sampling/sampledSet/writers/xmgr/xmgr.C b/src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.C similarity index 91% rename from src/sampling/sampledSet/writers/xmgr/xmgr.C rename to src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.C index d8385a07de..cecc5f238c 100644 --- a/src/sampling/sampledSet/writers/xmgr/xmgr.C +++ b/src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "xmgr.H" +#include "xmgraceSetWriter.H" #include "coordSet.H" #include "fileName.H" #include "OFstream.H" @@ -32,9 +32,8 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components template -Foam::xmgr::xmgr() +Foam::xmgraceSetWriter::xmgraceSetWriter() : writer() {} @@ -43,14 +42,14 @@ Foam::xmgr::xmgr() // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template -Foam::xmgr::~xmgr() +Foam::xmgraceSetWriter::~xmgraceSetWriter() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -Foam::fileName Foam::xmgr::getFileName +Foam::fileName Foam::xmgraceSetWriter::getFileName ( const coordSet& points, const wordList& valueSetNames @@ -61,7 +60,7 @@ Foam::fileName Foam::xmgr::getFileName template -void Foam::xmgr::write +void Foam::xmgraceSetWriter::write ( const coordSet& points, const wordList& valueSetNames, @@ -85,5 +84,4 @@ void Foam::xmgr::write } } - // ************************************************************************* // diff --git a/src/sampling/sampledSet/writers/xmgr/xmgr.H b/src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.H similarity index 89% rename from src/sampling/sampledSet/writers/xmgr/xmgr.H rename to src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.H index 4478730fd8..c96438e91d 100644 --- a/src/sampling/sampledSet/writers/xmgr/xmgr.H +++ b/src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.H @@ -23,17 +23,17 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::xmgr + Foam::xmgraceSetWriter Description SourceFiles - xmgr.C + xmgraceSetWriter.C \*---------------------------------------------------------------------------*/ -#ifndef xmgr_H -#define xmgr_H +#ifndef xmgraceSetWriter_H +#define xmgraceSetWriter_H #include "writer.H" @@ -43,11 +43,11 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class xmgr Declaration + Class xmgraceSetWriter Declaration \*---------------------------------------------------------------------------*/ template -class xmgr +class xmgraceSetWriter : public writer { @@ -61,11 +61,11 @@ public: // Constructors //- Construct null - xmgr(); + xmgraceSetWriter(); //- Destructor - virtual ~xmgr(); + virtual ~xmgraceSetWriter(); // Member Functions @@ -93,7 +93,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "xmgr.C" +# include "xmgraceSetWriter.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSet/writers/raw/rawWriters.C b/src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriterRunTime.C similarity index 94% rename from src/sampling/sampledSet/writers/raw/rawWriters.C rename to src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriterRunTime.C index 0b3a28898c..d4049cf2bf 100644 --- a/src/sampling/sampledSet/writers/raw/rawWriters.C +++ b/src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriterRunTime.C @@ -24,14 +24,15 @@ License \*---------------------------------------------------------------------------*/ -#include "rawWriters.H" +#include "xmgraceSetWriter.H" +#include "writers.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeWriters(raw) + makeSetWriters(xmgraceSetWriter) } // ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/dx/dx.C b/src/sampling/sampledSurface/writers/dx/dxSurfaceWriter.C similarity index 90% rename from src/sampling/sampledSurface/writers/dx/dx.C rename to src/sampling/sampledSurface/writers/dx/dxSurfaceWriter.C index deb80de894..45506e1797 100644 --- a/src/sampling/sampledSurface/writers/dx/dx.C +++ b/src/sampling/sampledSurface/writers/dx/dxSurfaceWriter.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "dx.H" +#include "dxSurfaceWriter.H" #include "fileName.H" #include "OFstream.H" #include "faceList.H" @@ -33,7 +33,7 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template -void Foam::dx::writeDXGeometry +void Foam::dxSurfaceWriter::writeDXGeometry ( const pointField& points, const faceList& faces, @@ -84,7 +84,7 @@ void Foam::dx::writeDXGeometry // Write scalarField in DX format template -void Foam::dx::writeDXData +void Foam::dxSurfaceWriter::writeDXData ( const pointField& points, const scalarField& values, @@ -116,7 +116,7 @@ void Foam::dx::writeDXData // Write vectorField in DX format template -void Foam::dx::writeDXData +void Foam::dxSurfaceWriter::writeDXData ( const pointField& points, const vectorField& values, @@ -150,7 +150,7 @@ void Foam::dx::writeDXData // Write sphericalTensorField in DX format template -void Foam::dx::writeDXData +void Foam::dxSurfaceWriter::writeDXData ( const pointField& points, const sphericalTensorField& values, @@ -182,7 +182,7 @@ void Foam::dx::writeDXData // Write symmTensorField in DX format template -void Foam::dx::writeDXData +void Foam::dxSurfaceWriter::writeDXData ( const pointField& points, const symmTensorField& values, @@ -219,7 +219,7 @@ void Foam::dx::writeDXData // Write tensorField in DX format template -void Foam::dx::writeDXData +void Foam::dxSurfaceWriter::writeDXData ( const pointField& points, const tensorField& values, @@ -256,7 +256,7 @@ void Foam::dx::writeDXData // Write trailer in DX format template -void Foam::dx::writeDXTrailer(Ostream& os) const +void Foam::dxSurfaceWriter::writeDXTrailer(Ostream& os) const { os << "# the field, with three components: \"positions\"," << " \"connections\", and \"data\"" << nl @@ -272,7 +272,7 @@ void Foam::dx::writeDXTrailer(Ostream& os) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -Foam::dx::dx() +Foam::dxSurfaceWriter::dxSurfaceWriter() : surfaceWriter() {} @@ -281,14 +281,14 @@ Foam::dx::dx() // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template -Foam::dx::~dx() +Foam::dxSurfaceWriter::~dxSurfaceWriter() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::dx::write +void Foam::dxSurfaceWriter::write ( const fileName& samplePath, const fileName& timeDir, @@ -307,22 +307,22 @@ void Foam::dx::write mkDir(surfaceDir); } - fileName planeFName(surfaceDir/fieldName + '_' + surfaceName + ".dx"); + fileName fName(surfaceDir/fieldName + '_' + surfaceName + ".dx"); if (verbose) { - Info<< "Writing field " << fieldName << " to " << planeFName << endl; + Info<< "Writing field " << fieldName << " to " << fName << endl; } - OFstream dxFile(planeFName); + OFstream os(fName); - writeDXGeometry(points, faces, dxFile); + writeDXGeometry(points, faces, os); - writeDXData(points, values, dxFile); + writeDXData(points, values, os); - writeDXTrailer(dxFile); + writeDXTrailer(os); - dxFile << "end" << nl; + os << "end" << nl; } diff --git a/src/sampling/sampledSurface/writers/dx/dx.H b/src/sampling/sampledSurface/writers/dx/dxSurfaceWriter.H similarity index 92% rename from src/sampling/sampledSurface/writers/dx/dx.H rename to src/sampling/sampledSurface/writers/dx/dxSurfaceWriter.H index cccf64e3cf..1096d59b36 100644 --- a/src/sampling/sampledSurface/writers/dx/dx.H +++ b/src/sampling/sampledSurface/writers/dx/dxSurfaceWriter.H @@ -23,17 +23,17 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::dx + Foam::dxSurfaceWriter Description SourceFiles - dx.C + dxSurfaceWriter.C \*---------------------------------------------------------------------------*/ -#ifndef dx_H -#define dx_H +#ifndef dxSurfaceWriter_H +#define dxSurfaceWriter_H #include "surfaceWriter.H" @@ -43,11 +43,11 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class dx Declaration + Class dxSurfaceWriter Declaration \*---------------------------------------------------------------------------*/ template -class dx +class dxSurfaceWriter : public surfaceWriter { @@ -107,12 +107,12 @@ public: // Constructors //- Construct null - dx(); + dxSurfaceWriter(); // Destructor - virtual ~dx(); + virtual ~dxSurfaceWriter(); // Member Functions @@ -141,7 +141,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "dx.C" +# include "dxSurfaceWriter.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/writers/dx/dxWriters.C b/src/sampling/sampledSurface/writers/dx/dxSurfaceWriterRunTime.C similarity index 94% rename from src/sampling/sampledSurface/writers/dx/dxWriters.C rename to src/sampling/sampledSurface/writers/dx/dxSurfaceWriterRunTime.C index 1cac2b8d78..2201282834 100644 --- a/src/sampling/sampledSurface/writers/dx/dxWriters.C +++ b/src/sampling/sampledSurface/writers/dx/dxSurfaceWriterRunTime.C @@ -24,7 +24,8 @@ License \*---------------------------------------------------------------------------*/ -#include "dxWriters.H" +#include "dxSurfaceWriter.H" +#include "surfaceWriters.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -34,7 +35,7 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -makeSurfaceWriters(dx); +makeSurfaceWriters(dxSurfaceWriter); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/writers/dx/dxWriters.H b/src/sampling/sampledSurface/writers/dx/dxWriters.H deleted file mode 100644 index 0700b647b4..0000000000 --- a/src/sampling/sampledSurface/writers/dx/dxWriters.H +++ /dev/null @@ -1,63 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -InClass - Foam::dxWriters - -Description - -SourceFiles - dxWriters.C - -\*---------------------------------------------------------------------------*/ - -#ifndef dxWriters_H -#define dxWriters_H - -#include "dx.H" -#include "surfaceWriters.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -typedef dx dxScalarWriter; -typedef dx dxVectorWriter; -typedef dx dxSphericalTensorWriter; -typedef dx dxSymmTensorWriter; -typedef dx dxTensorWriter; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/foamFile/foamFile.C b/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriter.C similarity index 78% rename from src/sampling/sampledSurface/writers/foamFile/foamFile.C rename to src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriter.C index 334c490c43..4180dcd963 100644 --- a/src/sampling/sampledSurface/writers/foamFile/foamFile.C +++ b/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriter.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "foamFile.H" +#include "foamFileSurfaceWriter.H" #include "fileName.H" #include "OFstream.H" #include "faceList.H" @@ -33,7 +33,7 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -Foam::foamFile::foamFile() +Foam::foamFileSurfaceWriter::foamFileSurfaceWriter() : surfaceWriter() {} @@ -42,14 +42,14 @@ Foam::foamFile::foamFile() // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template -Foam::foamFile::~foamFile() +Foam::foamFileSurfaceWriter::~foamFileSurfaceWriter() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::foamFile::write +void Foam::foamFileSurfaceWriter::write ( const fileName& samplePath, const fileName& timeDir, @@ -61,42 +61,36 @@ void Foam::foamFile::write const bool verbose ) const { - fileName planeFName(samplePath/timeDir/surfaceName); + fileName surfaceDir(samplePath/timeDir/surfaceName); - if (!exists(planeFName)) + if (!exists(surfaceDir)) { - mkDir(planeFName); + mkDir(surfaceDir); } if (verbose) { - Info<< "Writing field " << fieldName << " to " << planeFName << endl; + Info<< "Writing field " << fieldName << " to " << surfaceDir << endl; } // Points - OFstream pointsFile(planeFName/"points"); - - pointsFile << points; + OFstream(surfaceDir/"points")() << points; // Faces - OFstream facesFile(planeFName/"faces"); - - facesFile << faces; + OFstream(surfaceDir/"faces")() << faces; // Values to separate directory (e.g. "scalarField/p") fileName foamName(pTraits::typeName); - - fileName valuesDir(planeFName / (foamName + Field::typeName)); + fileName valuesDir(surfaceDir / (foamName + Field::typeName)); if (!exists(valuesDir)) { mkDir(valuesDir); } - OFstream valuesFile(valuesDir/fieldName); - - valuesFile << values; + // values + OFstream(valuesDir/fieldName)() << values; } diff --git a/src/sampling/sampledSurface/writers/foamFile/foamFile.H b/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriter.H similarity index 88% rename from src/sampling/sampledSurface/writers/foamFile/foamFile.H rename to src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriter.H index fcd5fe4f8a..1fbee34b51 100644 --- a/src/sampling/sampledSurface/writers/foamFile/foamFile.H +++ b/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriter.H @@ -23,18 +23,18 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::foamFile + Foam::foamFileSurfaceWriter Description A surfaceWriter for foamFiles SourceFiles - foamFile.C + foamFileSurfaceWriter.C \*---------------------------------------------------------------------------*/ -#ifndef foamFile_H -#define foamFile_H +#ifndef foamFileSurfaceWriter_H +#define foamFileSurfaceWriter_H #include "surfaceWriter.H" @@ -44,11 +44,11 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class foamFile Declaration + Class foamFileSurfaceWriter Declaration \*---------------------------------------------------------------------------*/ template -class foamFile +class foamFileSurfaceWriter : public surfaceWriter { @@ -62,12 +62,12 @@ public: // Constructors //- Construct null - foamFile(); + foamFileSurfaceWriter(); // Destructor - virtual ~foamFile(); + virtual ~foamFileSurfaceWriter(); // Member Functions @@ -96,7 +96,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "foamFile.C" +# include "foamFileSurfaceWriter.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriterRunTime.C b/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriterRunTime.C new file mode 100644 index 0000000000..6d669446f7 --- /dev/null +++ b/src/sampling/sampledSurface/writers/foamFile/foamFileSurfaceWriterRunTime.C @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "foamFileSurfaceWriter.H" +#include "surfaceWriters.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makeSurfaceWriters(foamFileSurfaceWriter); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/foamFile/foamFileWriters.H b/src/sampling/sampledSurface/writers/foamFile/foamFileWriters.H deleted file mode 100644 index ff963568fb..0000000000 --- a/src/sampling/sampledSurface/writers/foamFile/foamFileWriters.H +++ /dev/null @@ -1,63 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -InClass - Foam::foamFileWriters - -Description - -SourceFiles - foamFileWriters.C - -\*---------------------------------------------------------------------------*/ - -#ifndef foamFileWriters_H -#define foamFileWriters_H - -#include "foamFile.H" -#include "surfaceWriters.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -typedef foamFile foamFileScalarWriter; -typedef foamFile foamFileVectorWriter; -typedef foamFile foamFileSphericalTensorWriter; -typedef foamFile foamFileSymmTensorWriter; -typedef foamFile foamFileTensorWriter; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/null/null.C b/src/sampling/sampledSurface/writers/null/nullSurfaceWriter.C similarity index 92% rename from src/sampling/sampledSurface/writers/null/null.C rename to src/sampling/sampledSurface/writers/null/nullSurfaceWriter.C index 979109a00b..b4efa9bd38 100644 --- a/src/sampling/sampledSurface/writers/null/null.C +++ b/src/sampling/sampledSurface/writers/null/nullSurfaceWriter.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "null.H" +#include "nullSurfaceWriter.H" #include "fileName.H" #include "OFstream.H" #include "faceList.H" @@ -35,7 +35,7 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -Foam::null::null() +Foam::nullSurfaceWriter::nullSurfaceWriter() : surfaceWriter() {} @@ -44,14 +44,14 @@ Foam::null::null() // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template -Foam::null::~null() +Foam::nullSurfaceWriter::~nullSurfaceWriter() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::null::write +void Foam::nullSurfaceWriter::write ( const fileName& samplePath, const fileName& timeDir, diff --git a/src/sampling/sampledSurface/writers/null/null.H b/src/sampling/sampledSurface/writers/null/nullSurfaceWriter.H similarity index 89% rename from src/sampling/sampledSurface/writers/null/null.H rename to src/sampling/sampledSurface/writers/null/nullSurfaceWriter.H index baf84f218c..a94c57d537 100644 --- a/src/sampling/sampledSurface/writers/null/null.H +++ b/src/sampling/sampledSurface/writers/null/nullSurfaceWriter.H @@ -23,17 +23,17 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::null + Foam::nullSurfaceWriter Description SourceFiles - null.C + nullSurfaceWriter.C \*---------------------------------------------------------------------------*/ -#ifndef null_H -#define null_H +#ifndef nullSurfaceWriter_H +#define nullSurfaceWriter_H #include "surfaceWriter.H" @@ -43,11 +43,11 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class null Declaration + Class nullSurfaceWriter Declaration \*---------------------------------------------------------------------------*/ template -class null +class nullSurfaceWriter : public surfaceWriter { @@ -61,12 +61,12 @@ public: // Constructors //- Construct null - null(); + nullSurfaceWriter(); // Destructor - virtual ~null(); + virtual ~nullSurfaceWriter(); // Member Functions @@ -95,7 +95,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "null.C" +# include "nullSurfaceWriter.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/writers/null/nullSurfaceWriterRunTime.C b/src/sampling/sampledSurface/writers/null/nullSurfaceWriterRunTime.C new file mode 100644 index 0000000000..4e779fcefd --- /dev/null +++ b/src/sampling/sampledSurface/writers/null/nullSurfaceWriterRunTime.C @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "nullSurfaceWriter.H" +#include "surfaceWriters.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makeSurfaceWriters(nullSurfaceWriter); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/null/nullWriters.H b/src/sampling/sampledSurface/writers/null/nullWriters.H deleted file mode 100644 index 3cb81e1a01..0000000000 --- a/src/sampling/sampledSurface/writers/null/nullWriters.H +++ /dev/null @@ -1,63 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -InClass - Foam::nullWriters - -Description - -SourceFiles - nullWriters.C - -\*---------------------------------------------------------------------------*/ - -#ifndef nullWriters_H -#define nullWriters_H - -#include "null.H" -#include "surfaceWriters.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -typedef null nullScalarWriter; -typedef null nullVectorWriter; -typedef null nullSphericalTensorWriter; -typedef null nullSymmTensorWriter; -typedef null nullTensorWriter; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/raw/rawSurfaceWriter.C b/src/sampling/sampledSurface/writers/raw/rawSurfaceWriter.C index 2f281c20df..f25249b1b0 100644 --- a/src/sampling/sampledSurface/writers/raw/rawSurfaceWriter.C +++ b/src/sampling/sampledSurface/writers/raw/rawSurfaceWriter.C @@ -347,16 +347,15 @@ void Foam::rawSurfaceWriter::write mkDir(surfaceDir); } - fileName planeFName(surfaceDir/fieldName + '_' + surfaceName + ".raw"); + fileName fName(surfaceDir/fieldName + '_' + surfaceName + ".raw"); if (verbose) { - Info<< "Writing field " << fieldName << " to " << planeFName << endl; + Info<< "Writing field " << fieldName << " to " << fName << endl; } - OFstream rawFile(planeFName); - - writeData(fieldName, points, faces, values, rawFile); + OFstream os(fName); + writeData(fieldName, points, faces, values, os); } diff --git a/src/sampling/sampledSurface/writers/raw/rawSurfaceWriters.C b/src/sampling/sampledSurface/writers/raw/rawSurfaceWriterRunTime.C similarity index 96% rename from src/sampling/sampledSurface/writers/raw/rawSurfaceWriters.C rename to src/sampling/sampledSurface/writers/raw/rawSurfaceWriterRunTime.C index cd147b3193..ee1168266c 100644 --- a/src/sampling/sampledSurface/writers/raw/rawSurfaceWriters.C +++ b/src/sampling/sampledSurface/writers/raw/rawSurfaceWriterRunTime.C @@ -24,7 +24,8 @@ License \*---------------------------------------------------------------------------*/ -#include "rawSurfaceWriters.H" +#include "rawSurfaceWriter.H" +#include "surfaceWriters.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/writers/raw/rawSurfaceWriters.H b/src/sampling/sampledSurface/writers/raw/rawSurfaceWriters.H deleted file mode 100644 index b96bc71dfd..0000000000 --- a/src/sampling/sampledSurface/writers/raw/rawSurfaceWriters.H +++ /dev/null @@ -1,63 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -InClass - Foam::rawSurfaceWriters - -Description - -SourceFiles - rawSurfaceWriters.C - -\*---------------------------------------------------------------------------*/ - -#ifndef rawSurfaceWriters_H -#define rawSurfaceWriters_H - -#include "rawSurfaceWriter.H" -#include "surfaceWriters.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -typedef rawSurfaceWriter rawSurfaceWriterScalarWriter; -typedef rawSurfaceWriter rawSurfaceWriterVectorWriter; -typedef rawSurfaceWriter rawSurfaceWriterSphericalTensorWriter; -typedef rawSurfaceWriter rawSurfaceWriterSymmTensorWriter; -typedef rawSurfaceWriter rawSurfaceWriterTensorWriter; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/stl/stl.C b/src/sampling/sampledSurface/writers/stl/stlSurfaceWriter.C similarity index 89% rename from src/sampling/sampledSurface/writers/stl/stl.C rename to src/sampling/sampledSurface/writers/stl/stlSurfaceWriter.C index 82c36b3df0..f5c42c02f1 100644 --- a/src/sampling/sampledSurface/writers/stl/stl.C +++ b/src/sampling/sampledSurface/writers/stl/stlSurfaceWriter.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "stl.H" +#include "stlSurfaceWriter.H" #include "fileName.H" #include "OFstream.H" #include "faceList.H" @@ -34,7 +34,7 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -Foam::stl::stl() +Foam::stlSurfaceWriter::stlSurfaceWriter() : surfaceWriter() {} @@ -43,14 +43,14 @@ Foam::stl::stl() // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template -Foam::stl::~stl() +Foam::stlSurfaceWriter::~stlSurfaceWriter() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::stl::write +void Foam::stlSurfaceWriter::write ( const fileName& samplePath, const fileName& timeDir, @@ -69,11 +69,11 @@ void Foam::stl::write mkDir(surfaceDir); } - fileName planeFName(surfaceDir/fieldName + '_' + surfaceName + ".stl"); + fileName fName(surfaceDir/fieldName + '_' + surfaceName + ".stl"); if (verbose) { - Info<< "Writing field " << fieldName << " to " << planeFName << endl; + Info<< "Writing field " << fieldName << " to " << fName << endl; } // Convert faces to triangles. @@ -108,7 +108,7 @@ void Foam::stl::write ) ), points - ).write(planeFName); + ).write(fName); } diff --git a/src/sampling/sampledSurface/writers/stl/stl.H b/src/sampling/sampledSurface/writers/stl/stlSurfaceWriter.H similarity index 90% rename from src/sampling/sampledSurface/writers/stl/stl.H rename to src/sampling/sampledSurface/writers/stl/stlSurfaceWriter.H index 6941ab8c1b..5e1c2e5ffb 100644 --- a/src/sampling/sampledSurface/writers/stl/stl.H +++ b/src/sampling/sampledSurface/writers/stl/stlSurfaceWriter.H @@ -23,17 +23,17 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::stl + Foam::stlSurfaceWriter Description SourceFiles - stl.C + stlSurfaceWriter.C \*---------------------------------------------------------------------------*/ -#ifndef stl_H -#define stl_H +#ifndef stlSurfaceWriter_H +#define stlSurfaceWriter_H #include "surfaceWriter.H" @@ -43,11 +43,11 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class stl Declaration + Class stlSurfaceWriter Declaration \*---------------------------------------------------------------------------*/ template -class stl +class stlSurfaceWriter : public surfaceWriter { @@ -61,12 +61,12 @@ public: // Constructors //- Construct null - stl(); + stlSurfaceWriter(); // Destructor - virtual ~stl(); + virtual ~stlSurfaceWriter(); // Member Functions @@ -95,7 +95,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "stl.C" +# include "stlSurfaceWriter.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/writers/foamFile/foamFileWriters.C b/src/sampling/sampledSurface/writers/stl/stlSurfaceWriterRunTime.C similarity index 94% rename from src/sampling/sampledSurface/writers/foamFile/foamFileWriters.C rename to src/sampling/sampledSurface/writers/stl/stlSurfaceWriterRunTime.C index 6db5497d37..a748733ecf 100644 --- a/src/sampling/sampledSurface/writers/foamFile/foamFileWriters.C +++ b/src/sampling/sampledSurface/writers/stl/stlSurfaceWriterRunTime.C @@ -24,7 +24,8 @@ License \*---------------------------------------------------------------------------*/ -#include "foamFileWriters.H" +#include "stlSurfaceWriter.H" +#include "surfaceWriters.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -34,7 +35,7 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -makeSurfaceWriters(foamFile); +makeSurfaceWriters(stlSurfaceWriter); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/writers/stl/stlWriters.C b/src/sampling/sampledSurface/writers/stl/stlWriters.C deleted file mode 100644 index c0b923e758..0000000000 --- a/src/sampling/sampledSurface/writers/stl/stlWriters.C +++ /dev/null @@ -1,43 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "stlWriters.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makeSurfaceWriters(stl); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/stl/stlWriters.H b/src/sampling/sampledSurface/writers/stl/stlWriters.H deleted file mode 100644 index b47d3d82c3..0000000000 --- a/src/sampling/sampledSurface/writers/stl/stlWriters.H +++ /dev/null @@ -1,63 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -InClass - Foam::stlWriters - -Description - -SourceFiles - stlWriters.C - -\*---------------------------------------------------------------------------*/ - -#ifndef stlWriters_H -#define stlWriters_H - -#include "stl.H" -#include "surfaceWriters.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -typedef stl stlScalarWriter; -typedef stl stlVectorWriter; -typedef stl stlSphericalTensorWriter; -typedef stl stlSymmTensorWriter; -typedef stl stlTensorWriter; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/surfaceWriter.H b/src/sampling/sampledSurface/writers/surfaceWriter.H index 4fd01fad39..3a894c6dd1 100644 --- a/src/sampling/sampledSurface/writers/surfaceWriter.H +++ b/src/sampling/sampledSurface/writers/surfaceWriter.H @@ -117,41 +117,6 @@ public: # include "surfaceWriter.C" #endif -// Only used internally -#define makeTypeSurfaceWritersTypeName(type) \ - \ -defineNamedTemplateTypeNameAndDebug(type, 0); - -// Used externally sometimes -#define makeSurfaceWritersTypeName(typeWriter) \ - \ -makeTypeSurfaceWritersTypeName(typeWriter##ScalarWriter); \ -makeTypeSurfaceWritersTypeName(typeWriter##VectorWriter); \ -makeTypeSurfaceWritersTypeName(typeWriter##SphericalTensorWriter); \ -makeTypeSurfaceWritersTypeName(typeWriter##SymmTensorWriter); \ -makeTypeSurfaceWritersTypeName(typeWriter##TensorWriter); - -// Define type info for single template instantiation (e.g. vector) -#define makeSurfaceWriterTypes(WriterType, type) \ - \ -defineNamedTemplateTypeNameAndDebug(type, 0); \ - \ -addToRunTimeSelectionTable \ -( \ - WriterType, type, word \ -); - - -// Define type info info for scalar, vector etc. instantiations -#define makeSurfaceWriters(typeWriter) \ - \ -makeSurfaceWriterTypes(scalarWriter, typeWriter##ScalarWriter); \ -makeSurfaceWriterTypes(vectorWriter, typeWriter##VectorWriter); \ -makeSurfaceWriterTypes(sphericalTensorWriter, typeWriter##SphericalTensorWriter);\ -makeSurfaceWriterTypes(symmTensorWriter, typeWriter##SymmTensorWriter); \ -makeSurfaceWriterTypes(tensorWriter, typeWriter##TensorWriter); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/sampling/sampledSurface/writers/surfaceWriters.C b/src/sampling/sampledSurface/writers/surfaceWriters.C index e0d9487eb3..76781c6e39 100644 --- a/src/sampling/sampledSurface/writers/surfaceWriters.C +++ b/src/sampling/sampledSurface/writers/surfaceWriters.C @@ -32,21 +32,15 @@ namespace Foam { // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +#define defineSurfaceWriterType(dataType) \ + defineNamedTemplateTypeNameAndDebug(surfaceWriter, 0); \ + defineTemplatedRunTimeSelectionTable(surfaceWriter, word, dataType); -defineNamedTemplateTypeNameAndDebug(scalarWriter, 0); -defineTemplateRunTimeSelectionTable(scalarWriter, word); - -defineNamedTemplateTypeNameAndDebug(vectorWriter, 0); -defineTemplateRunTimeSelectionTable(vectorWriter, word); - -defineNamedTemplateTypeNameAndDebug(sphericalTensorWriter, 0); -defineTemplateRunTimeSelectionTable(sphericalTensorWriter, word); - -defineNamedTemplateTypeNameAndDebug(symmTensorWriter, 0); -defineTemplateRunTimeSelectionTable(symmTensorWriter, word); - -defineNamedTemplateTypeNameAndDebug(tensorWriter, 0); -defineTemplateRunTimeSelectionTable(tensorWriter, word); +defineSurfaceWriterType(scalar); +defineSurfaceWriterType(vector); +defineSurfaceWriterType(sphericalTensor); +defineSurfaceWriterType(symmTensor); +defineSurfaceWriterType(tensor); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/writers/surfaceWriters.H b/src/sampling/sampledSurface/writers/surfaceWriters.H index 969fa845d5..b4bb226a76 100644 --- a/src/sampling/sampledSurface/writers/surfaceWriters.H +++ b/src/sampling/sampledSurface/writers/surfaceWriters.H @@ -36,21 +36,39 @@ Description #include "fieldTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Only used internally +#define makeTypeSurfaceWritersTypeName(typeWriter, dataType) \ + \ + defineNamedTemplateTypeNameAndDebug(typeWriter, 0); -namespace Foam -{ +// Sometimes used externally +#define makeSurfaceWritersTypeName(typeWriter) \ + \ + makeTypeSurfaceWritersTypeName(typeWriter, scalar); \ + makeTypeSurfaceWritersTypeName(typeWriter, vector); \ + makeTypeSurfaceWritersTypeName(typeWriter, sphericalTensor); \ + makeTypeSurfaceWritersTypeName(typeWriter, symmTensor); \ + makeTypeSurfaceWritersTypeName(typeWriter, tensor); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Define type info for single dataType template instantiation (eg, vector) +#define makeSurfaceWriterType(typeWriter, dataType) \ + \ + defineNamedTemplateTypeNameAndDebug(typeWriter, 0); \ + addTemplatedToRunTimeSelectionTable \ + ( \ + surfaceWriter, typeWriter, dataType, word \ + ); -typedef surfaceWriter scalarWriter; -typedef surfaceWriter vectorWriter; -typedef surfaceWriter sphericalTensorWriter; -typedef surfaceWriter symmTensorWriter; -typedef surfaceWriter tensorWriter; -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Define type info for scalar, vector etc. instantiations +#define makeSurfaceWriters(typeWriter) \ + \ + makeSurfaceWriterType(typeWriter, scalar); \ + makeSurfaceWriterType(typeWriter, vector); \ + makeSurfaceWriterType(typeWriter, sphericalTensor); \ + makeSurfaceWriterType(typeWriter, symmTensor); \ + makeSurfaceWriterType(typeWriter, tensor); -} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/writers/vtk/vtk.C b/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.C similarity index 85% rename from src/sampling/sampledSurface/writers/vtk/vtk.C rename to src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.C index b334be4ed4..b7f27b3710 100644 --- a/src/sampling/sampledSurface/writers/vtk/vtk.C +++ b/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "vtk.H" +#include "vtkSurfaceWriter.H" #include "fileName.H" #include "OFstream.H" #include "faceList.H" @@ -33,7 +33,7 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template -void Foam::vtk::writeGeometry +void Foam::vtkSurfaceWriter::writeGeometry ( const pointField& points, const faceList& faces, @@ -48,37 +48,33 @@ void Foam::vtk::writeGeometry << "ASCII" << nl << "DATASET POLYDATA" << nl; + // Write vertex coords os << "POINTS " << points.size() << " float" << nl; - forAll(points, pointI) { const point& pt = points[pointI]; - - os << float(pt.x()) << ' ' << float(pt.y()) << ' ' << float(pt.z()) - << nl; + os << float(pt.x()) << ' ' + << float(pt.y()) << ' ' + << float(pt.z()) << nl; } os << endl; - // Write triangles - - label nFaceVerts = 0; - + // Write faces + label nNodes = 0; forAll(faces, faceI) { - const face& f = faces[faceI]; - - nFaceVerts += f.size() + 1; + nNodes += faces[faceI].size(); } - os << "POLYGONS " << faces.size() << ' ' << nFaceVerts << nl; + os << "POLYGONS " << faces.size() << ' ' + << faces.size() + nNodes << nl; forAll(faces, faceI) { const face& f = faces[faceI]; os << f.size(); - forAll(f, fp) { os << ' ' << f[fp]; @@ -90,7 +86,7 @@ void Foam::vtk::writeGeometry // Write scalarField in vtk format template -void Foam::vtk::writeData +void Foam::vtkSurfaceWriter::writeData ( const fileName& fieldName, const pointField& points, @@ -116,16 +112,18 @@ void Foam::vtk::writeData forAll(values, elemI) { + if (elemI) + { + if (elemI % 10) + { + os << ' '; + } + else + { + os << nl; + } + } os << float(values[elemI]); - - if (elemI > 0 && (elemI%10) == 0) - { - os << nl; - } - else - { - os << ' '; - } } os << nl; } @@ -133,7 +131,7 @@ void Foam::vtk::writeData // Write vectorField in vtk format template -void Foam::vtk::writeData +void Foam::vtkSurfaceWriter::writeData ( const fileName& fieldName, const pointField& points, @@ -168,7 +166,7 @@ void Foam::vtk::writeData // Write sphericalTensorField in vtk format template -void Foam::vtk::writeData +void Foam::vtkSurfaceWriter::writeData ( const fileName& fieldName, const pointField& points, @@ -204,7 +202,7 @@ void Foam::vtk::writeData // Write symmTensorField in vtk format template -void Foam::vtk::writeData +void Foam::vtkSurfaceWriter::writeData ( const fileName& fieldName, const pointField& points, @@ -241,7 +239,7 @@ void Foam::vtk::writeData // Write tensorField in vtk format template -void Foam::vtk::writeData +void Foam::vtkSurfaceWriter::writeData ( const fileName& fieldName, const pointField& points, @@ -281,7 +279,7 @@ void Foam::vtk::writeData // Construct from components template -Foam::vtk::vtk() +Foam::vtkSurfaceWriter::vtkSurfaceWriter() : surfaceWriter() {} @@ -290,14 +288,14 @@ Foam::vtk::vtk() // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template -Foam::vtk::~vtk() +Foam::vtkSurfaceWriter::~vtkSurfaceWriter() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::vtk::write +void Foam::vtkSurfaceWriter::write ( const fileName& samplePath, const fileName& timeDir, @@ -316,18 +314,17 @@ void Foam::vtk::write mkDir(surfaceDir); } - fileName planeFName(surfaceDir/fieldName + '_' + surfaceName + ".vtk"); + fileName fName(surfaceDir/fieldName + '_' + surfaceName + ".vtk"); if (verbose) { - Info<< "Writing field " << fieldName << " to " << planeFName << endl; + Info<< "Writing field " << fieldName << " to " << fName << endl; } - OFstream vtkFile(planeFName); + OFstream os(fName); - writeGeometry(points, faces, vtkFile); - - writeData(fieldName, points, values, vtkFile); + writeGeometry(points, faces, os); + writeData(fieldName, points, values, os); } diff --git a/src/sampling/sampledSurface/writers/vtk/vtk.H b/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.H similarity index 92% rename from src/sampling/sampledSurface/writers/vtk/vtk.H rename to src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.H index 5e8655ebeb..167241d19a 100644 --- a/src/sampling/sampledSurface/writers/vtk/vtk.H +++ b/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.H @@ -23,17 +23,17 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::vtk + Foam::vtkSurfaceWriter Description SourceFiles - vtk.C + vtkSurfaceWriter.C \*---------------------------------------------------------------------------*/ -#ifndef vtk_H -#define vtk_H +#ifndef vtkSurfaceWriter_H +#define vtkSurfaceWriter_H #include "surfaceWriter.H" @@ -43,11 +43,11 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class vtk Declaration + Class vtkSurfaceWriter Declaration \*---------------------------------------------------------------------------*/ template -class vtk +class vtkSurfaceWriter : public surfaceWriter { @@ -110,12 +110,12 @@ public: // Constructors //- Construct null - vtk(); + vtkSurfaceWriter(); // Destructor - virtual ~vtk(); + virtual ~vtkSurfaceWriter(); // Member Functions @@ -144,7 +144,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "vtk.C" +# include "vtkSurfaceWriter.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/writers/null/nullWriters.C b/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriterRunTime.C similarity index 94% rename from src/sampling/sampledSurface/writers/null/nullWriters.C rename to src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriterRunTime.C index 159d23e597..0cc5cf4ce4 100644 --- a/src/sampling/sampledSurface/writers/null/nullWriters.C +++ b/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriterRunTime.C @@ -24,7 +24,8 @@ License \*---------------------------------------------------------------------------*/ -#include "nullWriters.H" +#include "vtkSurfaceWriter.H" +#include "surfaceWriters.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -34,7 +35,7 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -makeSurfaceWriters(null); +makeSurfaceWriters(vtkSurfaceWriter); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/writers/vtk/vtkWriters.C b/src/sampling/sampledSurface/writers/vtk/vtkWriters.C deleted file mode 100644 index bd1ed10045..0000000000 --- a/src/sampling/sampledSurface/writers/vtk/vtkWriters.C +++ /dev/null @@ -1,43 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "vtkWriters.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makeSurfaceWriters(vtk); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/sampling/sampledSurface/writers/vtk/vtkWriters.H b/src/sampling/sampledSurface/writers/vtk/vtkWriters.H deleted file mode 100644 index 421098e857..0000000000 --- a/src/sampling/sampledSurface/writers/vtk/vtkWriters.H +++ /dev/null @@ -1,63 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -InClass - Foam::vtkWriters - -Description - -SourceFiles - vtkWriters.C - -\*---------------------------------------------------------------------------*/ - -#ifndef vtkWriters_H -#define vtkWriters_H - -#include "vtk.H" -#include "surfaceWriters.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -typedef vtk vtkScalarWriter; -typedef vtk vtkVectorWriter; -typedef vtk vtkSphericalTensorWriter; -typedef vtk vtkSymmTensorWriter; -typedef vtk vtkTensorWriter; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* //