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

This commit is contained in:
Mark Olesen 2008-11-21 21:46:06 +01:00
parent bad35371b8
commit 7cf90b039e
52 changed files with 479 additions and 1108 deletions

View File

@ -29,7 +29,6 @@ License
#include "GeometricField.H"
#include "meshToMesh.H"
#include "cuttingPlane.H"
#include "IOobjectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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

View File

@ -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,

View File

@ -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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -24,14 +24,15 @@ License
\*---------------------------------------------------------------------------*/
#include "gnuplotWriters.H"
#include "gnuplotSetWriter.H"
#include "writers.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeWriters(gnuplot)
makeSetWriters(gnuplotSetWriter)
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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)

View File

@ -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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -24,14 +24,15 @@ License
\*---------------------------------------------------------------------------*/
#include "xmgrWriters.H"
#include "jplotSetWriter.H"
#include "writers.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeWriters(xmgr)
makeSetWriters(jplotSetWriter)
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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,

View File

@ -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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -24,14 +24,15 @@ License
\*---------------------------------------------------------------------------*/
#include "jplotWriters.H"
#include "rawSetWriter.H"
#include "writers.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeWriters(jplot)
makeSetWriters(rawSetWriter)
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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<scalar> typeWriter##ScalarWriter; \
typedef typeWriter<vector> typeWriter##VectorWriter; \
typedef typeWriter<sphericalTensor> typeWriter##SphericalTensorWriter; \
typedef typeWriter<symmTensor> typeWriter##SymmTensorWriter; \
typedef typeWriter<tensor> typeWriter##TensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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<dataType >, 0); \
defineTemplatedRunTimeSelectionTable(writer, word, dataType);
defineSetWriterType(scalar);
defineSetWriterType(vector);
defineSetWriterType(sphericalTensor);
defineSetWriterType(symmTensor);
defineSetWriterType(tensor);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -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<dataType >, 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<dataType >, 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
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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<class Type>
Foam::xmgr<Type>::xmgr()
Foam::xmgraceSetWriter<Type>::xmgraceSetWriter()
:
writer<Type>()
{}
@ -43,14 +42,14 @@ Foam::xmgr<Type>::xmgr()
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::xmgr<Type>::~xmgr()
Foam::xmgraceSetWriter<Type>::~xmgraceSetWriter()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::fileName Foam::xmgr<Type>::getFileName
Foam::fileName Foam::xmgraceSetWriter<Type>::getFileName
(
const coordSet& points,
const wordList& valueSetNames
@ -61,7 +60,7 @@ Foam::fileName Foam::xmgr<Type>::getFileName
template<class Type>
void Foam::xmgr<Type>::write
void Foam::xmgraceSetWriter<Type>::write
(
const coordSet& points,
const wordList& valueSetNames,
@ -85,5 +84,4 @@ void Foam::xmgr<Type>::write
}
}
// ************************************************************************* //

View File

@ -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 Type>
class xmgr
class xmgraceSetWriter
:
public writer<Type>
{
@ -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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -24,14 +24,15 @@ License
\*---------------------------------------------------------------------------*/
#include "rawWriters.H"
#include "xmgraceSetWriter.H"
#include "writers.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeWriters(raw)
makeSetWriters(xmgraceSetWriter)
}
// ************************************************************************* //

View File

@ -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<class Type>
void Foam::dx<Type>::writeDXGeometry
void Foam::dxSurfaceWriter<Type>::writeDXGeometry
(
const pointField& points,
const faceList& faces,
@ -84,7 +84,7 @@ void Foam::dx<Type>::writeDXGeometry
// Write scalarField in DX format
template<class Type>
void Foam::dx<Type>::writeDXData
void Foam::dxSurfaceWriter<Type>::writeDXData
(
const pointField& points,
const scalarField& values,
@ -116,7 +116,7 @@ void Foam::dx<Type>::writeDXData
// Write vectorField in DX format
template<class Type>
void Foam::dx<Type>::writeDXData
void Foam::dxSurfaceWriter<Type>::writeDXData
(
const pointField& points,
const vectorField& values,
@ -150,7 +150,7 @@ void Foam::dx<Type>::writeDXData
// Write sphericalTensorField in DX format
template<class Type>
void Foam::dx<Type>::writeDXData
void Foam::dxSurfaceWriter<Type>::writeDXData
(
const pointField& points,
const sphericalTensorField& values,
@ -182,7 +182,7 @@ void Foam::dx<Type>::writeDXData
// Write symmTensorField in DX format
template<class Type>
void Foam::dx<Type>::writeDXData
void Foam::dxSurfaceWriter<Type>::writeDXData
(
const pointField& points,
const symmTensorField& values,
@ -219,7 +219,7 @@ void Foam::dx<Type>::writeDXData
// Write tensorField in DX format
template<class Type>
void Foam::dx<Type>::writeDXData
void Foam::dxSurfaceWriter<Type>::writeDXData
(
const pointField& points,
const tensorField& values,
@ -256,7 +256,7 @@ void Foam::dx<Type>::writeDXData
// Write trailer in DX format
template<class Type>
void Foam::dx<Type>::writeDXTrailer(Ostream& os) const
void Foam::dxSurfaceWriter<Type>::writeDXTrailer(Ostream& os) const
{
os << "# the field, with three components: \"positions\","
<< " \"connections\", and \"data\"" << nl
@ -272,7 +272,7 @@ void Foam::dx<Type>::writeDXTrailer(Ostream& os) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::dx<Type>::dx()
Foam::dxSurfaceWriter<Type>::dxSurfaceWriter()
:
surfaceWriter<Type>()
{}
@ -281,14 +281,14 @@ Foam::dx<Type>::dx()
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::dx<Type>::~dx()
Foam::dxSurfaceWriter<Type>::~dxSurfaceWriter()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::dx<Type>::write
void Foam::dxSurfaceWriter<Type>::write
(
const fileName& samplePath,
const fileName& timeDir,
@ -307,22 +307,22 @@ void Foam::dx<Type>::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;
}

View File

@ -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 Type>
class dx
class dxSurfaceWriter
:
public surfaceWriter<Type>
{
@ -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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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<scalar> dxScalarWriter;
typedef dx<vector> dxVectorWriter;
typedef dx<sphericalTensor> dxSphericalTensorWriter;
typedef dx<symmTensor> dxSymmTensorWriter;
typedef dx<tensor> dxTensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -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<class Type>
Foam::foamFile<Type>::foamFile()
Foam::foamFileSurfaceWriter<Type>::foamFileSurfaceWriter()
:
surfaceWriter<Type>()
{}
@ -42,14 +42,14 @@ Foam::foamFile<Type>::foamFile()
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::foamFile<Type>::~foamFile()
Foam::foamFileSurfaceWriter<Type>::~foamFileSurfaceWriter()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::foamFile<Type>::write
void Foam::foamFileSurfaceWriter<Type>::write
(
const fileName& samplePath,
const fileName& timeDir,
@ -61,42 +61,36 @@ void Foam::foamFile<Type>::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<Type>::typeName);
fileName valuesDir(planeFName / (foamName + Field<Type>::typeName));
fileName valuesDir(surfaceDir / (foamName + Field<Type>::typeName));
if (!exists(valuesDir))
{
mkDir(valuesDir);
}
OFstream valuesFile(valuesDir/fieldName);
valuesFile << values;
// values
OFstream(valuesDir/fieldName)() << values;
}

View File

@ -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 Type>
class foamFile
class foamFileSurfaceWriter
:
public surfaceWriter<Type>
{
@ -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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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
// ************************************************************************* //

View File

@ -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<scalar> foamFileScalarWriter;
typedef foamFile<vector> foamFileVectorWriter;
typedef foamFile<sphericalTensor> foamFileSphericalTensorWriter;
typedef foamFile<symmTensor> foamFileSymmTensorWriter;
typedef foamFile<tensor> foamFileTensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -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<class Type>
Foam::null<Type>::null()
Foam::nullSurfaceWriter<Type>::nullSurfaceWriter()
:
surfaceWriter<Type>()
{}
@ -44,14 +44,14 @@ Foam::null<Type>::null()
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::null<Type>::~null()
Foam::nullSurfaceWriter<Type>::~nullSurfaceWriter()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::null<Type>::write
void Foam::nullSurfaceWriter<Type>::write
(
const fileName& samplePath,
const fileName& timeDir,

View File

@ -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 Type>
class null
class nullSurfaceWriter
:
public surfaceWriter<Type>
{
@ -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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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
// ************************************************************************* //

View File

@ -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<scalar> nullScalarWriter;
typedef null<vector> nullVectorWriter;
typedef null<sphericalTensor> nullSphericalTensorWriter;
typedef null<symmTensor> nullSymmTensorWriter;
typedef null<tensor> nullTensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -347,16 +347,15 @@ void Foam::rawSurfaceWriter<Type>::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);
}

View File

@ -24,7 +24,8 @@ License
\*---------------------------------------------------------------------------*/
#include "rawSurfaceWriters.H"
#include "rawSurfaceWriter.H"
#include "surfaceWriters.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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<scalar> rawSurfaceWriterScalarWriter;
typedef rawSurfaceWriter<vector> rawSurfaceWriterVectorWriter;
typedef rawSurfaceWriter<sphericalTensor> rawSurfaceWriterSphericalTensorWriter;
typedef rawSurfaceWriter<symmTensor> rawSurfaceWriterSymmTensorWriter;
typedef rawSurfaceWriter<tensor> rawSurfaceWriterTensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -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<class Type>
Foam::stl<Type>::stl()
Foam::stlSurfaceWriter<Type>::stlSurfaceWriter()
:
surfaceWriter<Type>()
{}
@ -43,14 +43,14 @@ Foam::stl<Type>::stl()
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::stl<Type>::~stl()
Foam::stlSurfaceWriter<Type>::~stlSurfaceWriter()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::stl<Type>::write
void Foam::stlSurfaceWriter<Type>::write
(
const fileName& samplePath,
const fileName& timeDir,
@ -69,11 +69,11 @@ void Foam::stl<Type>::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<Type>::write
)
),
points
).write(planeFName);
).write(fName);
}

View File

@ -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 Type>
class stl
class stlSurfaceWriter
:
public surfaceWriter<Type>
{
@ -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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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
// ************************************************************************* //

View File

@ -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<scalar> stlScalarWriter;
typedef stl<vector> stlVectorWriter;
typedef stl<sphericalTensor> stlSphericalTensorWriter;
typedef stl<symmTensor> stlSymmTensorWriter;
typedef stl<tensor> stlTensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -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

View File

@ -32,21 +32,15 @@ namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define defineSurfaceWriterType(dataType) \
defineNamedTemplateTypeNameAndDebug(surfaceWriter<dataType >, 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);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -36,21 +36,39 @@ Description
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Only used internally
#define makeTypeSurfaceWritersTypeName(typeWriter, dataType) \
\
defineNamedTemplateTypeNameAndDebug(typeWriter<dataType >, 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<dataType >, 0); \
addTemplatedToRunTimeSelectionTable \
( \
surfaceWriter, typeWriter, dataType, word \
);
typedef surfaceWriter<scalar> scalarWriter;
typedef surfaceWriter<vector> vectorWriter;
typedef surfaceWriter<sphericalTensor> sphericalTensorWriter;
typedef surfaceWriter<symmTensor> symmTensorWriter;
typedef surfaceWriter<tensor> 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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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<class Type>
void Foam::vtk<Type>::writeGeometry
void Foam::vtkSurfaceWriter<Type>::writeGeometry
(
const pointField& points,
const faceList& faces,
@ -48,37 +48,33 @@ void Foam::vtk<Type>::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<Type>::writeGeometry
// Write scalarField in vtk format
template<class Type>
void Foam::vtk<Type>::writeData
void Foam::vtkSurfaceWriter<Type>::writeData
(
const fileName& fieldName,
const pointField& points,
@ -116,16 +112,18 @@ void Foam::vtk<Type>::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<Type>::writeData
// Write vectorField in vtk format
template<class Type>
void Foam::vtk<Type>::writeData
void Foam::vtkSurfaceWriter<Type>::writeData
(
const fileName& fieldName,
const pointField& points,
@ -168,7 +166,7 @@ void Foam::vtk<Type>::writeData
// Write sphericalTensorField in vtk format
template<class Type>
void Foam::vtk<Type>::writeData
void Foam::vtkSurfaceWriter<Type>::writeData
(
const fileName& fieldName,
const pointField& points,
@ -204,7 +202,7 @@ void Foam::vtk<Type>::writeData
// Write symmTensorField in vtk format
template<class Type>
void Foam::vtk<Type>::writeData
void Foam::vtkSurfaceWriter<Type>::writeData
(
const fileName& fieldName,
const pointField& points,
@ -241,7 +239,7 @@ void Foam::vtk<Type>::writeData
// Write tensorField in vtk format
template<class Type>
void Foam::vtk<Type>::writeData
void Foam::vtkSurfaceWriter<Type>::writeData
(
const fileName& fieldName,
const pointField& points,
@ -281,7 +279,7 @@ void Foam::vtk<Type>::writeData
// Construct from components
template<class Type>
Foam::vtk<Type>::vtk()
Foam::vtkSurfaceWriter<Type>::vtkSurfaceWriter()
:
surfaceWriter<Type>()
{}
@ -290,14 +288,14 @@ Foam::vtk<Type>::vtk()
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::vtk<Type>::~vtk()
Foam::vtkSurfaceWriter<Type>::~vtkSurfaceWriter()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::vtk<Type>::write
void Foam::vtkSurfaceWriter<Type>::write
(
const fileName& samplePath,
const fileName& timeDir,
@ -316,18 +314,17 @@ void Foam::vtk<Type>::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);
}

View File

@ -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 Type>
class vtk
class vtkSurfaceWriter
:
public surfaceWriter<Type>
{
@ -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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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
// ************************************************************************* //

View File

@ -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<scalar> vtkScalarWriter;
typedef vtk<vector> vtkVectorWriter;
typedef vtk<sphericalTensor> vtkSphericalTensorWriter;
typedef vtk<symmTensor> vtkSymmTensorWriter;
typedef vtk<tensor> vtkTensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //