Commit 99eea2d5 authored by Mark Olesen's avatar Mark Olesen
Browse files

sampling: use new runtime macros and avoid typedefs for each writer/instance

parent 750cd8c6
......@@ -29,7 +29,6 @@ License
#include "GeometricField.H"
#include "meshToMesh.H"
#include "cuttingPlane.H"
#include "IOobjectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -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
......
......@@ -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<class Type>
Foam::gnuplot<Type>::gnuplot()
Foam::gnuplotSetWriter<Type>::gnuplotSetWriter()
:
writer<Type>()
{}
......@@ -44,14 +43,14 @@ Foam::gnuplot<Type>::gnuplot()
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::gnuplot<Type>::~gnuplot()
Foam::gnuplotSetWriter<Type>::~gnuplotSetWriter()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::fileName Foam::gnuplot<Type>::getFileName
Foam::fileName Foam::gnuplotSetWriter<Type>::getFileName
(
const coordSet& points,
const wordList& valueSetNames
......@@ -62,7 +61,7 @@ Foam::fileName Foam::gnuplot<Type>::getFileName
template<class Type>
void Foam::gnuplot<Type>::write
void Foam::gnuplotSetWriter<Type>::write
(
const coordSet& points,
const wordList& valueSetNames,
......
......@@ -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 Type>
class gnuplot
class gnuplotSetWriter
:
public writer<Type>
{
......@@ -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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -24,14 +24,15 @@ License
\*---------------------------------------------------------------------------*/
#include "gnuplotWriters.H"
#include "gnuplotSetWriter.H"
#include "writers.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeWriters(gnuplot)
makeSetWriters(gnuplotSetWriter)
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
// ************************************************************************* //
......@@ -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<class Type>
Foam::Ostream& Foam::jplot<Type>::writeHeader(Ostream& os) const
Foam::Ostream& Foam::jplotSetWriter<Type>::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<class Type>
Foam::jplot<Type>::jplot()
Foam::jplotSetWriter<Type>::jplotSetWriter()
:
writer<Type>()
{}
......@@ -57,14 +55,14 @@ Foam::jplot<Type>::jplot()
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::jplot<Type>::~jplot()
Foam::jplotSetWriter<Type>::~jplotSetWriter()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::fileName Foam::jplot<Type>::getFileName
Foam::fileName Foam::jplotSetWriter<Type>::getFileName
(
const coordSet& points,
const wordList& valueSetNames
......@@ -75,7 +73,7 @@ Foam::fileName Foam::jplot<Type>::getFileName
template<class Type>
void Foam::jplot<Type>::write
void Foam::jplotSetWriter<Type>::write
(
const coordSet& points,
const wordList& valueSetNames,
......@@ -83,7 +81,7 @@ void Foam::jplot<Type>::write
Ostream& os
) const
{
os << "# JPlot file" << endl
os << "# JPlot file" << nl
<< "# column 1: " << points.name() << endl;
forAll(valueSets, i)
......
......@@ -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 Type>
class jplot
class jplotSetWriter
:
public writer<Type>
{
......@@ -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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -24,14 +24,15 @@ License
\*---------------------------------------------------------------------------*/
#include "xmgrWriters.H"
#include "jplotSetWriter.H"
#include "writers.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeWriters(xmgr)
makeSetWriters(jplotSetWriter)
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
// ************************************************************************* //
......@@ -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<class Type>
Foam::raw<Type>::raw()
Foam::rawSetWriter<Type>::rawSetWriter()
:
writer<Type>()
{}
......@@ -42,14 +41,14 @@ Foam::raw<Type>::raw()
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::raw<Type>::~raw()
Foam::rawSetWriter<Type>::~rawSetWriter()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::fileName Foam::raw<Type>::getFileName
Foam::fileName Foam::rawSetWriter<Type>::getFileName
(
const coordSet& points,
const wordList& valueSetNames
......@@ -60,7 +59,7 @@ Foam::fileName Foam::raw<Type>::getFileName
template<class Type>
void Foam::raw<Type>::write
void Foam::rawSetWriter<Type>::write
(
const coordSet& points,
const wordList& valueSetNames,
......
......@@ -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 Type>
class raw
class rawSetWriter
:
public writer<Type>
{
......@@ -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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -24,14 +24,15 @@ License
\*---------------------------------------------------------------------------*/
#include "jplotWriters.H"
#include "rawSetWriter.H"
#include "writers.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeWriters(jplot)
makeSetWriters(rawSetWriter)
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
// ************************************************************************* //
......@@ -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); \