diff --git a/applications/utilities/postProcessing/noise/Make/options b/applications/utilities/postProcessing/noise/Make/options index 92f606cf1a..193f0c352f 100644 --- a/applications/utilities/postProcessing/noise/Make/options +++ b/applications/utilities/postProcessing/noise/Make/options @@ -1,9 +1,14 @@ EXE_INC = \ + -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/randomProcesses/lnInclude \ -I$(FFTW_INC_DIR) EXE_LIBS = \ + -lfileFormats \ + -lsurfMesh \ + -lmeshTools \ -lsampling \ -lrandomProcesses diff --git a/applications/utilities/preProcessing/boxTurb/Make/options b/applications/utilities/preProcessing/boxTurb/Make/options index 497e272a3a..f4610f5d07 100644 --- a/applications/utilities/preProcessing/boxTurb/Make/options +++ b/applications/utilities/preProcessing/boxTurb/Make/options @@ -1,9 +1,13 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude \ + -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/randomProcesses/lnInclude EXE_LIBS = \ -lfiniteVolume \ + -lfileFormats \ + -lsurfMesh \ -lmeshTools \ -lrandomProcesses diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 8b851be4fb..ebb4506194 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -594,7 +594,6 @@ meshes/ProcessorTopology/commSchedule.C globalMeshData = $(polyMesh)/globalMeshData $(globalMeshData)/globalMeshData.C $(globalMeshData)/globalPoints.C -$(globalMeshData)/globalIndex.C $(polyMesh)/syncTools/syncTools.C $(polyMesh)/polyMeshTetDecomposition/polyMeshTetDecomposition.C @@ -803,22 +802,14 @@ $(interpolationWeights)/linearInterpolationWeights/linearInterpolationWeights.C $(interpolationWeights)/splineInterpolationWeights/splineInterpolationWeights.C - algorithms/indexedOctree/indexedOctreeName.C algorithms/indexedOctree/treeDataCell.C algorithms/indexedOctree/volumeType.C - algorithms/dynamicIndexedOctree/dynamicIndexedOctreeName.C algorithms/dynamicIndexedOctree/dynamicTreeDataPoint.C -graph/curve/curve.C -graph/graph.C - -writers = graph/writers -$(writers)/rawGraph/rawGraph.C -$(writers)/gnuplotGraph/gnuplotGraph.C -$(writers)/xmgrGraph/xmgrGraph.C +parallel/globalIndex/globalIndex.C meshes/data/data.C diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C index 8f2a7f014e..06b3d473d4 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C @@ -27,7 +27,6 @@ License \*---------------------------------------------------------------------------*/ #include "emptyPolyPatch.H" -#include "commSchedule.H" #include "globalMeshData.H" #include "cyclicPolyPatch.H" diff --git a/src/OpenFOAM/global/unitConversion/unitConversion.H b/src/OpenFOAM/global/constants/unitConversion.H similarity index 100% rename from src/OpenFOAM/global/unitConversion/unitConversion.H rename to src/OpenFOAM/global/constants/unitConversion.H diff --git a/src/OpenFOAM/meshes/ProcessorTopology/commSchedule.H b/src/OpenFOAM/meshes/ProcessorTopology/commSchedule.H index df5ff486d6..7c5c50f6d9 100644 --- a/src/OpenFOAM/meshes/ProcessorTopology/commSchedule.H +++ b/src/OpenFOAM/meshes/ProcessorTopology/commSchedule.H @@ -101,18 +101,16 @@ public: // Member Functions //- Order in which comms is scheduled - const labelList& schedule() const + const labelList& schedule() const noexcept { return schedule_; } //- Per processor the order in which communication has been scheduled - const labelListList& procSchedule() const + const labelListList& procSchedule() const noexcept { return procSchedule_; } - - }; diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.C b/src/OpenFOAM/parallel/globalIndex/globalIndex.C similarity index 100% rename from src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.C rename to src/OpenFOAM/parallel/globalIndex/globalIndex.C diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H b/src/OpenFOAM/parallel/globalIndex/globalIndex.H similarity index 100% rename from src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H rename to src/OpenFOAM/parallel/globalIndex/globalIndex.H diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H b/src/OpenFOAM/parallel/globalIndex/globalIndexI.H similarity index 100% rename from src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H rename to src/OpenFOAM/parallel/globalIndex/globalIndexI.H diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexTemplates.C b/src/OpenFOAM/parallel/globalIndex/globalIndexTemplates.C similarity index 100% rename from src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexTemplates.C rename to src/OpenFOAM/parallel/globalIndex/globalIndexTemplates.C diff --git a/src/OpenFOAM/primitives/contiguous/contiguous.H b/src/OpenFOAM/primitives/contiguous/contiguous.H index f43a8dcc7b..b42493436a 100644 --- a/src/OpenFOAM/primitives/contiguous/contiguous.H +++ b/src/OpenFOAM/primitives/contiguous/contiguous.H @@ -59,11 +59,11 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef contiguous_H -#define contiguous_H +#ifndef Foam_contiguous_H +#define Foam_contiguous_H -#include "scalar.H" -#include "label.H" +#include "scalarFwd.H" +#include "labelFwd.H" #include // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/meshTools/Make/files b/src/meshTools/Make/files index 4309290e20..af715350b7 100644 --- a/src/meshTools/Make/files +++ b/src/meshTools/Make/files @@ -147,6 +147,14 @@ $(setWriters)/vtk/foamVtkCoordSetWriter.C $(setWriters)/vtk/vtkSetWriterRunTime.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)/cellBitSet.C diff --git a/src/OpenFOAM/graph/curve/curve.C b/src/meshTools/graph/curve.C similarity index 100% rename from src/OpenFOAM/graph/curve/curve.C rename to src/meshTools/graph/curve.C diff --git a/src/OpenFOAM/graph/curve/curve.H b/src/meshTools/graph/curve.H similarity index 91% rename from src/OpenFOAM/graph/curve/curve.H rename to src/meshTools/graph/curve.H index a088833a9b..6d8940a24b 100644 --- a/src/OpenFOAM/graph/curve/curve.H +++ b/src/meshTools/graph/curve.H @@ -34,8 +34,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef curve_H -#define curve_H +#ifndef Foam_curve_H +#define Foam_curve_H #include "string.H" #include "primitiveFields.H" @@ -46,8 +46,7 @@ SourceFiles namespace Foam { -// Forward declaration of friend functions and operators - +// Forward Declarations class curve; Ostream& operator<<(Ostream&, const curve&); @@ -60,13 +59,11 @@ class curve : public scalarField { - public: //- The style (line, symbol, etc) of a curve class curveStyle { - public: //- Enumeration definitions @@ -116,9 +113,10 @@ public: private: - // private data + // Private Data string name_; + curveStyle style_; @@ -126,9 +124,6 @@ public: // Constructors - //- Construct as interpolation of an existing curve - //curve(const curve&, const label); - //- Construct from name, style and size curve ( @@ -151,7 +146,7 @@ public: } - // Member functions + // Member Functions // Access @@ -166,12 +161,6 @@ public: } - // Friend functions - - //- Gradient of the curve - //friend curve grad(const curve&); - - // Ostream operator friend Ostream& operator<<(Ostream&, const curve&); diff --git a/src/OpenFOAM/graph/curve/curveTools.C b/src/meshTools/graph/curveTools.C similarity index 100% rename from src/OpenFOAM/graph/curve/curveTools.C rename to src/meshTools/graph/curveTools.C diff --git a/src/OpenFOAM/graph/curve/curveTools.H b/src/meshTools/graph/curveTools.H similarity index 100% rename from src/OpenFOAM/graph/curve/curveTools.H rename to src/meshTools/graph/curveTools.H diff --git a/src/OpenFOAM/graph/graph.C b/src/meshTools/graph/graph.C similarity index 97% rename from src/OpenFOAM/graph/graph.C rename to src/meshTools/graph/graph.C index eaa4a7b1cd..8a8f7fc0e6 100644 --- a/src/OpenFOAM/graph/graph.C +++ b/src/meshTools/graph/graph.C @@ -29,7 +29,6 @@ License #include "graph.H" #include "OFstream.H" #include "IOmanip.H" -#include "Pair.H" #include "OSspecific.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 { - autoPtr graphWriter(writer::New(format)); + autoPtr writer(writer::New(format)); - OFstream graphFile(pName + '.' + graphWriter().ext()); + OFstream graphFile(pName + '.' + writer().ext()); if (graphFile.good()) { diff --git a/src/OpenFOAM/graph/graph.H b/src/meshTools/graph/graph.H similarity index 88% rename from src/OpenFOAM/graph/graph.H rename to src/meshTools/graph/graph.H index 2f816fd12a..839fbe1923 100644 --- a/src/OpenFOAM/graph/graph.H +++ b/src/meshTools/graph/graph.H @@ -35,23 +35,21 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef graph_H -#define graph_H +#ifndef Foam_graph_H +#define Foam_graph_H #include "string.H" #include "point.H" -#include "HashPtrTable.H" #include "curve.H" +#include "HashPtrTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -// Forward declaration of friend functions and operators - +// Forward Declaration class graph; - Ostream& operator<<(Ostream&, const graph&); @@ -63,7 +61,7 @@ class graph : public HashPtrTable { - // private data + // Private Data string title_; string xName_; @@ -71,13 +69,10 @@ class graph scalarField x_; - struct xy { scalar x_, y_; - xy() - {} // Friend Operators @@ -143,10 +138,10 @@ public: ); //- Construct from Istream - graph(Istream& is); + explicit graph(Istream& is); - // Member functions + // Member Functions // Access @@ -190,7 +185,6 @@ public: //- Abstract base class for a graph writer class writer { - protected: void writeXY @@ -219,17 +213,13 @@ public: // Selectors //- Return a reference to the selected writer - static autoPtr New - ( - const word& writeFormat - ); + static autoPtr New(const word& writeFormat); // Constructors - //- Construct null - writer() - {} + //- Default construct + writer() = default; //- Destructor @@ -238,19 +228,14 @@ public: // 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 - virtual void write(const graph&, Ostream&) const = 0; + //- Write graph in appropriate format + virtual void write(const graph&, Ostream&) const = 0; }; + //- Write out graph data as a simple table void writeTable(Ostream&) const; @@ -272,7 +257,7 @@ public: static word wordify(const string& sname); - // Friend operators + // Friend Operators //- Ostream Operator friend Ostream& operator<<(Ostream&, const graph&); diff --git a/src/OpenFOAM/graph/writers/gnuplotGraph/gnuplotGraph.C b/src/meshTools/graph/writers/gnuplot/gnuplotGraphWriter.C similarity index 66% rename from src/OpenFOAM/graph/writers/gnuplotGraph/gnuplotGraph.C rename to src/meshTools/graph/writers/gnuplot/gnuplotGraphWriter.C index 67fe2d97bf..0957e6956f 100644 --- a/src/OpenFOAM/graph/writers/gnuplotGraph/gnuplotGraph.C +++ b/src/meshTools/graph/writers/gnuplot/gnuplotGraphWriter.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2012 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,50 +26,49 @@ License \*---------------------------------------------------------------------------*/ -#include "gnuplotGraph.H" +#include "gnuplotGraphWriter.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(gnuplotGraph, 0); - const word gnuplotGraph::ext_("gplt"); +typedef graph::writer graphWriter; - typedef graph::writer graphWriter; - addToRunTimeSelectionTable(graphWriter, gnuplotGraph, word); +namespace graphWriters +{ + defineTypeName(gnuplotWriter); + addToRunTimeSelectionTable(graphWriter, gnuplotWriter, word); +} } // * * * * * * * * * * * * * * * 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 - << "set output \"" << word(g.title()) << ".ps\"" << endl - << "set title " << g.title() << " 0,0" << endl << "show title" << endl - << "set xlabel " << g.xName() << " 0,0" << endl << "show xlabel" << endl - << "set ylabel " << g.yName() << " 0,0" << endl << "show ylabel" << endl - << "plot"; - - bool firstField = true; + os << "set term pngcairo" << nl + << "set output \"" << word(g.title()) << ".png\"" << nl + << "set title " << g.title() << " 0,0" << nl << "show title" << nl + << "set xlabel " << g.xName() << " 0,0" << nl << "show xlabel" << nl + << "set ylabel " << g.yName() << " 0,0" << nl << "show ylabel" << nl; + label nplots = 0; forAllConstIters(g, iter) { - if (!firstField) - { - os << ','; - } - firstField = false; - + os << (nplots++ ? ", \\" : "plot \\") << nl; os << "'-' title " << iter()->name() << " with lines"; } - os << "; pause -1" << endl; + os << "; pause -1" << nl; forAllConstIters(g, iter) { - os << endl; + os << nl; writeXY(g.x(), *iter(), os); } } diff --git a/src/OpenFOAM/graph/writers/gnuplotGraph/gnuplotGraph.H b/src/meshTools/graph/writers/gnuplot/gnuplotGraphWriter.H similarity index 75% rename from src/OpenFOAM/graph/writers/gnuplotGraph/gnuplotGraph.H rename to src/meshTools/graph/writers/gnuplot/gnuplotGraphWriter.H index b77e72fb66..169fd3f116 100644 --- a/src/OpenFOAM/graph/writers/gnuplotGraph/gnuplotGraph.H +++ b/src/meshTools/graph/writers/gnuplot/gnuplotGraphWriter.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,18 +25,18 @@ License along with OpenFOAM. If not, see . Class - Foam::gnuplotGraph + Foam::graphWriters::gnuplotWriter Description Output in gnuplot (http://www.gnuplot.info) format SourceFiles - gnuplotGraph.C + gnuplotGraphWriter.C \*---------------------------------------------------------------------------*/ -#ifndef gnuplotGraph_H -#define gnuplotGraph_H +#ifndef Foam_gnuplotGraphWriter_H +#define Foam_gnuplotGraphWriter_H #include "graph.H" @@ -43,57 +44,42 @@ SourceFiles namespace Foam { +namespace graphWriters +{ /*---------------------------------------------------------------------------*\ - Class gnuplotGraph Declaration + Class gnuplotWriter Declaration \*---------------------------------------------------------------------------*/ -class gnuplotGraph +class gnuplotWriter : public graph::writer { - public: //- Runtime type information - TypeName("gnuplot"); - - //- FileName extension for this graph format - static const word ext_; - - - // Constructors - - //- Construct null - gnuplotGraph() - {} + TypeNameNoDebug("gnuplot"); + //- Default construct + gnuplotWriter() = default; //- Destructor - ~gnuplotGraph() - {} + ~gnuplotWriter() = default; // 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 - - void write(const graph&, Ostream& os) const; + //- Write + void write(const graph&, Ostream& os) const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace graphWriters } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/graph/writers/rawGraph/rawGraph.C b/src/meshTools/graph/writers/raw/rawGraphWriter.C similarity index 83% rename from src/OpenFOAM/graph/writers/rawGraph/rawGraph.C rename to src/meshTools/graph/writers/raw/rawGraphWriter.C index f2dbf0251f..2113681e64 100644 --- a/src/OpenFOAM/graph/writers/rawGraph/rawGraph.C +++ b/src/meshTools/graph/writers/raw/rawGraphWriter.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2012 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,24 +26,30 @@ License \*---------------------------------------------------------------------------*/ -#include "rawGraph.H" +#include "rawGraphWriter.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(rawGraph, 0); - const word rawGraph::ext_("xy"); +typedef graph::writer graphWriter; - typedef graph::writer graphWriter; - addToRunTimeSelectionTable(graphWriter, rawGraph, word); +namespace graphWriters +{ + defineTypeName(rawWriter); + addToRunTimeSelectionTable(graphWriter, rawWriter, word); +} } // * * * * * * * * * * * * * * * 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); } diff --git a/src/OpenFOAM/graph/writers/rawGraph/rawGraph.H b/src/meshTools/graph/writers/raw/rawGraphWriter.H similarity index 76% rename from src/OpenFOAM/graph/writers/rawGraph/rawGraph.H rename to src/meshTools/graph/writers/raw/rawGraphWriter.H index db549e1ac5..7616823328 100644 --- a/src/OpenFOAM/graph/writers/rawGraph/rawGraph.H +++ b/src/meshTools/graph/writers/raw/rawGraphWriter.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,18 +25,18 @@ License along with OpenFOAM. If not, see . Class - Foam::rawGraph + Foam::graphWriters::rawWriter Description A raw xy graph output SourceFiles - rawGraph.C + rawGraphWriter.C \*---------------------------------------------------------------------------*/ -#ifndef rawGraph_H -#define rawGraph_H +#ifndef Foam_rawGraphWriter_H +#define Foam_rawGraphWriter_H #include "graph.H" @@ -43,57 +44,42 @@ SourceFiles namespace Foam { +namespace graphWriters +{ /*---------------------------------------------------------------------------*\ - Class rawGraph Declaration + Class rawWriter Declaration \*---------------------------------------------------------------------------*/ -class rawGraph +class rawWriter : public graph::writer { - public: //- Runtime type information - TypeName("raw"); - - //- FileName extension for this graph format - static const word ext_; - - - // Constructors - - //- Construct null - rawGraph() - {} + TypeNameNoDebug("raw"); + //- Default construct + rawWriter() = default; //- Destructor - ~rawGraph() - {} + ~rawWriter() = default; // 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 - - void write(const graph&, Ostream& os) const; + //- Write + void write(const graph&, Ostream& os) const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace graphWriters } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/graph/writers/xmgrGraph/xmgrGraph.C b/src/meshTools/graph/writers/xmgrace/xmgraceGraphWriter.C similarity index 76% rename from src/OpenFOAM/graph/writers/xmgrGraph/xmgrGraph.C rename to src/meshTools/graph/writers/xmgrace/xmgraceGraphWriter.C index f7cdeb07b2..be23b05dde 100644 --- a/src/OpenFOAM/graph/writers/xmgrGraph/xmgrGraph.C +++ b/src/meshTools/graph/writers/xmgrace/xmgraceGraphWriter.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,43 +26,49 @@ License \*---------------------------------------------------------------------------*/ -#include "xmgrGraph.H" +#include "xmgraceGraphWriter.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(xmgrGraph, 0); - const word xmgrGraph::ext_("agr"); - typedef graph::writer graphWriter; - addToRunTimeSelectionTable(graphWriter, xmgrGraph, word); +typedef graph::writer graphWriter; + +namespace graphWriters +{ + defineTypeName(xmgraceWriter); + addToRunTimeSelectionTable(graphWriter, xmgraceWriter, word); +} } // * * * * * * * * * * * * * * * 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 << "@xaxis label " << g.xName() << nl - << "@yaxis label " << g.yName() << endl; + << "@yaxis label " << g.yName() << nl; - label fieldi = 0; + label nWritten_ = 0; forAllConstIters(g, iter) { - os << "@s" << fieldi << " legend " + os << "@s" << nWritten_ << " legend " << iter()->name() << nl - << "@target G0.S" << fieldi << nl - << "@type xy" << endl; + << "@target G0.S" << nWritten_ << nl + << "@type xy" << nl; writeXY(g.x(), *iter(), os); - os << endl; - fieldi++; + ++nWritten_; } } diff --git a/src/OpenFOAM/graph/writers/xmgrGraph/xmgrGraph.H b/src/meshTools/graph/writers/xmgrace/xmgraceGraphWriter.H similarity index 76% rename from src/OpenFOAM/graph/writers/xmgrGraph/xmgrGraph.H rename to src/meshTools/graph/writers/xmgrace/xmgraceGraphWriter.H index ef02fecbf3..8083a41186 100644 --- a/src/OpenFOAM/graph/writers/xmgrGraph/xmgrGraph.H +++ b/src/meshTools/graph/writers/xmgrace/xmgraceGraphWriter.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,19 +25,19 @@ License along with OpenFOAM. If not, see . Class - Foam::xmgrGraph + Foam::graphWriters::xmgraceWriter Description Output and \b agr file for \em xmgrace (http://plasma-gate.weizmann.ac.il/Grace/) SourceFiles - xmgrGraph.C + xmgraceGraphWriter.C \*---------------------------------------------------------------------------*/ -#ifndef xmgrGraph_H -#define xmgrGraph_H +#ifndef Foam_xmgraceGraphWriter_H +#define Foam_xmgraceGraphWriter_H #include "graph.H" @@ -44,57 +45,42 @@ SourceFiles namespace Foam { +namespace graphWriters +{ /*---------------------------------------------------------------------------*\ - Class xmgrGraph Declaration + Class xmgraceWriter Declaration \*---------------------------------------------------------------------------*/ -class xmgrGraph +class xmgraceWriter : public graph::writer { - public: //- Runtime type information - TypeName("xmgr"); - - //- FileName extension for this graph format - static const word ext_; - - - // Constructors - - //- Construct null - xmgrGraph() - {} + TypeNameNoDebug("xmgr"); + //- Default construct + xmgraceWriter() = default; //- Destructor - ~xmgrGraph() - {} + ~xmgraceWriter() = default; // 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 - - void write(const graph&, Ostream& os) const; + //- Write + void write(const graph&, Ostream& os) const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace graphWriters } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/randomProcesses/Make/options b/src/randomProcesses/Make/options index 8455e1fba2..ef979d32e4 100644 --- a/src/randomProcesses/Make/options +++ b/src/randomProcesses/Make/options @@ -1,11 +1,15 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(FFTW_INC_DIR) LIB_LIBS = \ -lfiniteVolume \ + -lfileFormats \ + -lmeshTools \ -lsurfMesh \ -lsampling \ -L$(FFTW_LIB_DIR) -lfftw3