mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: relocate graph writers to meshTools (not reqd by core OpenFOAM lib)
GIT: relocate globalIndex (is independent of mesh) STYLE: include label/scalar Fwd in contiguous.H STYLE: unneed commSchedule include in GeometricField
This commit is contained in:
@ -1,9 +1,14 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/fileFormats/lnInclude \
|
||||||
-I$(LIB_SRC)/surfMesh/lnInclude \
|
-I$(LIB_SRC)/surfMesh/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/sampling/lnInclude \
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
-I$(LIB_SRC)/randomProcesses/lnInclude \
|
-I$(LIB_SRC)/randomProcesses/lnInclude \
|
||||||
-I$(FFTW_INC_DIR)
|
-I$(FFTW_INC_DIR)
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
|
-lfileFormats \
|
||||||
|
-lsurfMesh \
|
||||||
|
-lmeshTools \
|
||||||
-lsampling \
|
-lsampling \
|
||||||
-lrandomProcesses
|
-lrandomProcesses
|
||||||
|
|||||||
@ -1,9 +1,13 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/fileFormats/lnInclude \
|
||||||
|
-I$(LIB_SRC)/surfMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/randomProcesses/lnInclude
|
-I$(LIB_SRC)/randomProcesses/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
-lfileFormats \
|
||||||
|
-lsurfMesh \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lrandomProcesses
|
-lrandomProcesses
|
||||||
|
|||||||
@ -594,7 +594,6 @@ meshes/ProcessorTopology/commSchedule.C
|
|||||||
globalMeshData = $(polyMesh)/globalMeshData
|
globalMeshData = $(polyMesh)/globalMeshData
|
||||||
$(globalMeshData)/globalMeshData.C
|
$(globalMeshData)/globalMeshData.C
|
||||||
$(globalMeshData)/globalPoints.C
|
$(globalMeshData)/globalPoints.C
|
||||||
$(globalMeshData)/globalIndex.C
|
|
||||||
|
|
||||||
$(polyMesh)/syncTools/syncTools.C
|
$(polyMesh)/syncTools/syncTools.C
|
||||||
$(polyMesh)/polyMeshTetDecomposition/polyMeshTetDecomposition.C
|
$(polyMesh)/polyMeshTetDecomposition/polyMeshTetDecomposition.C
|
||||||
@ -803,22 +802,14 @@ $(interpolationWeights)/linearInterpolationWeights/linearInterpolationWeights.C
|
|||||||
$(interpolationWeights)/splineInterpolationWeights/splineInterpolationWeights.C
|
$(interpolationWeights)/splineInterpolationWeights/splineInterpolationWeights.C
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
algorithms/indexedOctree/indexedOctreeName.C
|
algorithms/indexedOctree/indexedOctreeName.C
|
||||||
algorithms/indexedOctree/treeDataCell.C
|
algorithms/indexedOctree/treeDataCell.C
|
||||||
algorithms/indexedOctree/volumeType.C
|
algorithms/indexedOctree/volumeType.C
|
||||||
|
|
||||||
|
|
||||||
algorithms/dynamicIndexedOctree/dynamicIndexedOctreeName.C
|
algorithms/dynamicIndexedOctree/dynamicIndexedOctreeName.C
|
||||||
algorithms/dynamicIndexedOctree/dynamicTreeDataPoint.C
|
algorithms/dynamicIndexedOctree/dynamicTreeDataPoint.C
|
||||||
|
|
||||||
graph/curve/curve.C
|
parallel/globalIndex/globalIndex.C
|
||||||
graph/graph.C
|
|
||||||
|
|
||||||
writers = graph/writers
|
|
||||||
$(writers)/rawGraph/rawGraph.C
|
|
||||||
$(writers)/gnuplotGraph/gnuplotGraph.C
|
|
||||||
$(writers)/xmgrGraph/xmgrGraph.C
|
|
||||||
|
|
||||||
meshes/data/data.C
|
meshes/data/data.C
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,6 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "emptyPolyPatch.H"
|
#include "emptyPolyPatch.H"
|
||||||
#include "commSchedule.H"
|
|
||||||
#include "globalMeshData.H"
|
#include "globalMeshData.H"
|
||||||
#include "cyclicPolyPatch.H"
|
#include "cyclicPolyPatch.H"
|
||||||
|
|
||||||
|
|||||||
@ -101,18 +101,16 @@ public:
|
|||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Order in which comms is scheduled
|
//- Order in which comms is scheduled
|
||||||
const labelList& schedule() const
|
const labelList& schedule() const noexcept
|
||||||
{
|
{
|
||||||
return schedule_;
|
return schedule_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Per processor the order in which communication has been scheduled
|
//- Per processor the order in which communication has been scheduled
|
||||||
const labelListList& procSchedule() const
|
const labelListList& procSchedule() const noexcept
|
||||||
{
|
{
|
||||||
return procSchedule_;
|
return procSchedule_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -59,11 +59,11 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef contiguous_H
|
#ifndef Foam_contiguous_H
|
||||||
#define contiguous_H
|
#define Foam_contiguous_H
|
||||||
|
|
||||||
#include "scalar.H"
|
#include "scalarFwd.H"
|
||||||
#include "label.H"
|
#include "labelFwd.H"
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -147,6 +147,14 @@ $(setWriters)/vtk/foamVtkCoordSetWriter.C
|
|||||||
$(setWriters)/vtk/vtkSetWriterRunTime.C
|
$(setWriters)/vtk/vtkSetWriterRunTime.C
|
||||||
$(setWriters)/xmgrace/xmgraceSetWriterRunTime.C
|
$(setWriters)/xmgrace/xmgraceSetWriterRunTime.C
|
||||||
|
|
||||||
|
graph/curve.C
|
||||||
|
graph/graph.C
|
||||||
|
|
||||||
|
graphWriters = graph/writers
|
||||||
|
$(graphWriters)/raw/rawGraphWriter.C
|
||||||
|
$(graphWriters)/gnuplot/gnuplotGraphWriter.C
|
||||||
|
$(graphWriters)/xmgrace/xmgraceGraphWriter.C
|
||||||
|
|
||||||
|
|
||||||
topoSets = topoSet/topoSets
|
topoSets = topoSet/topoSets
|
||||||
$(topoSets)/cellBitSet.C
|
$(topoSets)/cellBitSet.C
|
||||||
|
|||||||
@ -34,8 +34,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef curve_H
|
#ifndef Foam_curve_H
|
||||||
#define curve_H
|
#define Foam_curve_H
|
||||||
|
|
||||||
#include "string.H"
|
#include "string.H"
|
||||||
#include "primitiveFields.H"
|
#include "primitiveFields.H"
|
||||||
@ -46,8 +46,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
// Forward Declarations
|
||||||
|
|
||||||
class curve;
|
class curve;
|
||||||
Ostream& operator<<(Ostream&, const curve&);
|
Ostream& operator<<(Ostream&, const curve&);
|
||||||
|
|
||||||
@ -60,13 +59,11 @@ class curve
|
|||||||
:
|
:
|
||||||
public scalarField
|
public scalarField
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- The style (line, symbol, etc) of a curve
|
//- The style (line, symbol, etc) of a curve
|
||||||
class curveStyle
|
class curveStyle
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Enumeration definitions
|
//- Enumeration definitions
|
||||||
@ -116,9 +113,10 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// private data
|
// Private Data
|
||||||
|
|
||||||
string name_;
|
string name_;
|
||||||
|
|
||||||
curveStyle style_;
|
curveStyle style_;
|
||||||
|
|
||||||
|
|
||||||
@ -126,9 +124,6 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct as interpolation of an existing curve
|
|
||||||
//curve(const curve&, const label);
|
|
||||||
|
|
||||||
//- Construct from name, style and size
|
//- Construct from name, style and size
|
||||||
curve
|
curve
|
||||||
(
|
(
|
||||||
@ -151,7 +146,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
@ -166,12 +161,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Friend functions
|
|
||||||
|
|
||||||
//- Gradient of the curve
|
|
||||||
//friend curve grad(const curve&);
|
|
||||||
|
|
||||||
|
|
||||||
// Ostream operator
|
// Ostream operator
|
||||||
|
|
||||||
friend Ostream& operator<<(Ostream&, const curve&);
|
friend Ostream& operator<<(Ostream&, const curve&);
|
||||||
@ -29,7 +29,6 @@ License
|
|||||||
#include "graph.H"
|
#include "graph.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "IOmanip.H"
|
#include "IOmanip.H"
|
||||||
#include "Pair.H"
|
|
||||||
#include "OSspecific.H"
|
#include "OSspecific.H"
|
||||||
#include "SubField.H"
|
#include "SubField.H"
|
||||||
|
|
||||||
@ -272,9 +271,9 @@ void Foam::graph::write(Ostream& os, const word& format) const
|
|||||||
|
|
||||||
void Foam::graph::write(const fileName& pName, const word& format) const
|
void Foam::graph::write(const fileName& pName, const word& format) const
|
||||||
{
|
{
|
||||||
autoPtr<writer> graphWriter(writer::New(format));
|
autoPtr<writer> writer(writer::New(format));
|
||||||
|
|
||||||
OFstream graphFile(pName + '.' + graphWriter().ext());
|
OFstream graphFile(pName + '.' + writer().ext());
|
||||||
|
|
||||||
if (graphFile.good())
|
if (graphFile.good())
|
||||||
{
|
{
|
||||||
@ -35,23 +35,21 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef graph_H
|
#ifndef Foam_graph_H
|
||||||
#define graph_H
|
#define Foam_graph_H
|
||||||
|
|
||||||
#include "string.H"
|
#include "string.H"
|
||||||
#include "point.H"
|
#include "point.H"
|
||||||
#include "HashPtrTable.H"
|
|
||||||
#include "curve.H"
|
#include "curve.H"
|
||||||
|
#include "HashPtrTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
// Forward Declaration
|
||||||
|
|
||||||
class graph;
|
class graph;
|
||||||
|
|
||||||
Ostream& operator<<(Ostream&, const graph&);
|
Ostream& operator<<(Ostream&, const graph&);
|
||||||
|
|
||||||
|
|
||||||
@ -63,7 +61,7 @@ class graph
|
|||||||
:
|
:
|
||||||
public HashPtrTable<curve>
|
public HashPtrTable<curve>
|
||||||
{
|
{
|
||||||
// private data
|
// Private Data
|
||||||
|
|
||||||
string title_;
|
string title_;
|
||||||
string xName_;
|
string xName_;
|
||||||
@ -71,13 +69,10 @@ class graph
|
|||||||
|
|
||||||
scalarField x_;
|
scalarField x_;
|
||||||
|
|
||||||
|
|
||||||
struct xy
|
struct xy
|
||||||
{
|
{
|
||||||
scalar x_, y_;
|
scalar x_, y_;
|
||||||
|
|
||||||
xy()
|
|
||||||
{}
|
|
||||||
|
|
||||||
// Friend Operators
|
// Friend Operators
|
||||||
|
|
||||||
@ -143,10 +138,10 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
graph(Istream& is);
|
explicit graph(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
@ -190,7 +185,6 @@ public:
|
|||||||
//- Abstract base class for a graph writer
|
//- Abstract base class for a graph writer
|
||||||
class writer
|
class writer
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void writeXY
|
void writeXY
|
||||||
@ -219,17 +213,13 @@ public:
|
|||||||
// Selectors
|
// Selectors
|
||||||
|
|
||||||
//- Return a reference to the selected writer
|
//- Return a reference to the selected writer
|
||||||
static autoPtr<writer> New
|
static autoPtr<writer> New(const word& writeFormat);
|
||||||
(
|
|
||||||
const word& writeFormat
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
writer()
|
writer() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
@ -238,19 +228,14 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- The fileName extension for this graph format
|
||||||
|
virtual word ext() const = 0;
|
||||||
//- Return the appropriate fileName extension
|
|
||||||
// for this graph format
|
|
||||||
virtual const word& ext() const = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// Write
|
|
||||||
|
|
||||||
//- Write graph in appropriate format
|
//- Write graph in appropriate format
|
||||||
virtual void write(const graph&, Ostream&) const = 0;
|
virtual void write(const graph&, Ostream&) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//- Write out graph data as a simple table
|
//- Write out graph data as a simple table
|
||||||
void writeTable(Ostream&) const;
|
void writeTable(Ostream&) const;
|
||||||
|
|
||||||
@ -272,7 +257,7 @@ public:
|
|||||||
static word wordify(const string& sname);
|
static word wordify(const string& sname);
|
||||||
|
|
||||||
|
|
||||||
// Friend operators
|
// Friend Operators
|
||||||
|
|
||||||
//- Ostream Operator
|
//- Ostream Operator
|
||||||
friend Ostream& operator<<(Ostream&, const graph&);
|
friend Ostream& operator<<(Ostream&, const graph&);
|
||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -26,50 +26,49 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "gnuplotGraph.H"
|
#include "gnuplotGraphWriter.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(gnuplotGraph, 0);
|
typedef graph::writer graphWriter;
|
||||||
const word gnuplotGraph::ext_("gplt");
|
|
||||||
|
|
||||||
typedef graph::writer graphWriter;
|
namespace graphWriters
|
||||||
addToRunTimeSelectionTable(graphWriter, gnuplotGraph, word);
|
{
|
||||||
|
defineTypeName(gnuplotWriter);
|
||||||
|
addToRunTimeSelectionTable(graphWriter, gnuplotWriter, word);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::gnuplotGraph::write(const graph& g, Ostream& os) const
|
void Foam::graphWriters::gnuplotWriter::write
|
||||||
|
(
|
||||||
|
const graph& g,
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
os << "#set term postscript color" << endl
|
os << "set term pngcairo" << nl
|
||||||
<< "set output \"" << word(g.title()) << ".ps\"" << endl
|
<< "set output \"" << word(g.title()) << ".png\"" << nl
|
||||||
<< "set title " << g.title() << " 0,0" << endl << "show title" << endl
|
<< "set title " << g.title() << " 0,0" << nl << "show title" << nl
|
||||||
<< "set xlabel " << g.xName() << " 0,0" << endl << "show xlabel" << endl
|
<< "set xlabel " << g.xName() << " 0,0" << nl << "show xlabel" << nl
|
||||||
<< "set ylabel " << g.yName() << " 0,0" << endl << "show ylabel" << endl
|
<< "set ylabel " << g.yName() << " 0,0" << nl << "show ylabel" << nl;
|
||||||
<< "plot";
|
|
||||||
|
|
||||||
bool firstField = true;
|
|
||||||
|
|
||||||
|
label nplots = 0;
|
||||||
forAllConstIters(g, iter)
|
forAllConstIters(g, iter)
|
||||||
{
|
{
|
||||||
if (!firstField)
|
os << (nplots++ ? ", \\" : "plot \\") << nl;
|
||||||
{
|
|
||||||
os << ',';
|
|
||||||
}
|
|
||||||
firstField = false;
|
|
||||||
|
|
||||||
os << "'-' title " << iter()->name() << " with lines";
|
os << "'-' title " << iter()->name() << " with lines";
|
||||||
}
|
}
|
||||||
os << "; pause -1" << endl;
|
os << "; pause -1" << nl;
|
||||||
|
|
||||||
|
|
||||||
forAllConstIters(g, iter)
|
forAllConstIters(g, iter)
|
||||||
{
|
{
|
||||||
os << endl;
|
os << nl;
|
||||||
writeXY(g.x(), *iter(), os);
|
writeXY(g.x(), *iter(), os);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011 OpenFOAM Foundation
|
Copyright (C) 2011 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -24,18 +25,18 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::gnuplotGraph
|
Foam::graphWriters::gnuplotWriter
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Output in gnuplot (http://www.gnuplot.info) format
|
Output in gnuplot (http://www.gnuplot.info) format
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
gnuplotGraph.C
|
gnuplotGraphWriter.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef gnuplotGraph_H
|
#ifndef Foam_gnuplotGraphWriter_H
|
||||||
#define gnuplotGraph_H
|
#define Foam_gnuplotGraphWriter_H
|
||||||
|
|
||||||
#include "graph.H"
|
#include "graph.H"
|
||||||
|
|
||||||
@ -43,57 +44,42 @@ SourceFiles
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
namespace graphWriters
|
||||||
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class gnuplotGraph Declaration
|
Class gnuplotWriter Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class gnuplotGraph
|
class gnuplotWriter
|
||||||
:
|
:
|
||||||
public graph::writer
|
public graph::writer
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("gnuplot");
|
TypeNameNoDebug("gnuplot");
|
||||||
|
|
||||||
//- FileName extension for this graph format
|
|
||||||
static const word ext_;
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct null
|
|
||||||
gnuplotGraph()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
//- Default construct
|
||||||
|
gnuplotWriter() = default;
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
~gnuplotGraph()
|
~gnuplotWriter() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- The fileName extension for this graph format
|
||||||
|
word ext() const { return "gplt"; }
|
||||||
//- Return the appropriate fileName extension
|
|
||||||
// for this graph format
|
|
||||||
const word& ext() const
|
|
||||||
{
|
|
||||||
return ext_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Write
|
|
||||||
|
|
||||||
|
//- Write
|
||||||
void write(const graph&, Ostream& os) const;
|
void write(const graph&, Ostream& os) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace graphWriters
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -25,24 +26,30 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "rawGraph.H"
|
#include "rawGraphWriter.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(rawGraph, 0);
|
typedef graph::writer graphWriter;
|
||||||
const word rawGraph::ext_("xy");
|
|
||||||
|
|
||||||
typedef graph::writer graphWriter;
|
namespace graphWriters
|
||||||
addToRunTimeSelectionTable(graphWriter, rawGraph, word);
|
{
|
||||||
|
defineTypeName(rawWriter);
|
||||||
|
addToRunTimeSelectionTable(graphWriter, rawWriter, word);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::rawGraph::write(const graph& g, Ostream& os) const
|
void Foam::graphWriters::rawWriter::write
|
||||||
|
(
|
||||||
|
const graph& g,
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
g.writeTable(os);
|
g.writeTable(os);
|
||||||
}
|
}
|
||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011 OpenFOAM Foundation
|
Copyright (C) 2011 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -24,18 +25,18 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::rawGraph
|
Foam::graphWriters::rawWriter
|
||||||
|
|
||||||
Description
|
Description
|
||||||
A raw xy graph output
|
A raw xy graph output
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
rawGraph.C
|
rawGraphWriter.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef rawGraph_H
|
#ifndef Foam_rawGraphWriter_H
|
||||||
#define rawGraph_H
|
#define Foam_rawGraphWriter_H
|
||||||
|
|
||||||
#include "graph.H"
|
#include "graph.H"
|
||||||
|
|
||||||
@ -43,57 +44,42 @@ SourceFiles
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
namespace graphWriters
|
||||||
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class rawGraph Declaration
|
Class rawWriter Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class rawGraph
|
class rawWriter
|
||||||
:
|
:
|
||||||
public graph::writer
|
public graph::writer
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("raw");
|
TypeNameNoDebug("raw");
|
||||||
|
|
||||||
//- FileName extension for this graph format
|
|
||||||
static const word ext_;
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct null
|
|
||||||
rawGraph()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
//- Default construct
|
||||||
|
rawWriter() = default;
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
~rawGraph()
|
~rawWriter() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- The fileName extension for this graph format
|
||||||
|
word ext() const { return "xy"; }
|
||||||
//- Return the appropriate fileName extension
|
|
||||||
// for this graph format
|
|
||||||
const word& ext() const
|
|
||||||
{
|
|
||||||
return ext_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Write
|
|
||||||
|
|
||||||
|
//- Write
|
||||||
void write(const graph&, Ostream& os) const;
|
void write(const graph&, Ostream& os) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace graphWriters
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -26,43 +26,49 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "xmgrGraph.H"
|
#include "xmgraceGraphWriter.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(xmgrGraph, 0);
|
|
||||||
const word xmgrGraph::ext_("agr");
|
|
||||||
|
|
||||||
typedef graph::writer graphWriter;
|
typedef graph::writer graphWriter;
|
||||||
addToRunTimeSelectionTable(graphWriter, xmgrGraph, word);
|
|
||||||
|
namespace graphWriters
|
||||||
|
{
|
||||||
|
defineTypeName(xmgraceWriter);
|
||||||
|
addToRunTimeSelectionTable(graphWriter, xmgraceWriter, word);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::xmgrGraph::write(const graph& g, Ostream& os) const
|
void Foam::graphWriters::xmgraceWriter::write
|
||||||
|
(
|
||||||
|
const graph& g,
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
os << "@title " << g.title() << nl
|
os << "@title " << g.title() << nl
|
||||||
<< "@xaxis label " << g.xName() << nl
|
<< "@xaxis label " << g.xName() << nl
|
||||||
<< "@yaxis label " << g.yName() << endl;
|
<< "@yaxis label " << g.yName() << nl;
|
||||||
|
|
||||||
label fieldi = 0;
|
label nWritten_ = 0;
|
||||||
|
|
||||||
forAllConstIters(g, iter)
|
forAllConstIters(g, iter)
|
||||||
{
|
{
|
||||||
os << "@s" << fieldi << " legend "
|
os << "@s" << nWritten_ << " legend "
|
||||||
<< iter()->name() << nl
|
<< iter()->name() << nl
|
||||||
<< "@target G0.S" << fieldi << nl
|
<< "@target G0.S" << nWritten_ << nl
|
||||||
<< "@type xy" << endl;
|
<< "@type xy" << nl;
|
||||||
|
|
||||||
writeXY(g.x(), *iter(), os);
|
writeXY(g.x(), *iter(), os);
|
||||||
|
|
||||||
os << endl;
|
os << endl;
|
||||||
|
|
||||||
fieldi++;
|
++nWritten_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011 OpenFOAM Foundation
|
Copyright (C) 2011 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -24,19 +25,19 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::xmgrGraph
|
Foam::graphWriters::xmgraceWriter
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Output and \b agr file for \em xmgrace
|
Output and \b agr file for \em xmgrace
|
||||||
(http://plasma-gate.weizmann.ac.il/Grace/)
|
(http://plasma-gate.weizmann.ac.il/Grace/)
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
xmgrGraph.C
|
xmgraceGraphWriter.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef xmgrGraph_H
|
#ifndef Foam_xmgraceGraphWriter_H
|
||||||
#define xmgrGraph_H
|
#define Foam_xmgraceGraphWriter_H
|
||||||
|
|
||||||
#include "graph.H"
|
#include "graph.H"
|
||||||
|
|
||||||
@ -44,57 +45,42 @@ SourceFiles
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
namespace graphWriters
|
||||||
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class xmgrGraph Declaration
|
Class xmgraceWriter Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class xmgrGraph
|
class xmgraceWriter
|
||||||
:
|
:
|
||||||
public graph::writer
|
public graph::writer
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("xmgr");
|
TypeNameNoDebug("xmgr");
|
||||||
|
|
||||||
//- FileName extension for this graph format
|
|
||||||
static const word ext_;
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct null
|
|
||||||
xmgrGraph()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
//- Default construct
|
||||||
|
xmgraceWriter() = default;
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
~xmgrGraph()
|
~xmgraceWriter() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- The fileName extension for this graph format
|
||||||
|
word ext() const { return "agr"; }
|
||||||
//- Return the appropriate fileName extension
|
|
||||||
// for this graph format
|
|
||||||
const word& ext() const
|
|
||||||
{
|
|
||||||
return ext_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Write
|
|
||||||
|
|
||||||
|
//- Write
|
||||||
void write(const graph&, Ostream& os) const;
|
void write(const graph&, Ostream& os) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace graphWriters
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -1,11 +1,15 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/fileFormats/lnInclude \
|
||||||
-I$(LIB_SRC)/surfMesh/lnInclude \
|
-I$(LIB_SRC)/surfMesh/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/sampling/lnInclude \
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
-I$(FFTW_INC_DIR)
|
-I$(FFTW_INC_DIR)
|
||||||
|
|
||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
-lfileFormats \
|
||||||
|
-lmeshTools \
|
||||||
-lsurfMesh \
|
-lsurfMesh \
|
||||||
-lsampling \
|
-lsampling \
|
||||||
-L$(FFTW_LIB_DIR) -lfftw3
|
-L$(FFTW_LIB_DIR) -lfftw3
|
||||||
|
|||||||
Reference in New Issue
Block a user