makeGraph.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Global
27 makeGraph
28
29Description
30 Write a graph file for a field given the data point locations field,
31 the field of interest and the name of the field to be used for the
32 graph file name.
33
34\*---------------------------------------------------------------------------*/
35
36#include "makeGraph.H"
37#include "volFields.H"
38#include "fvMesh.H"
39#include "graph.H"
41// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
44(
45 const scalarField& x,
46 const volScalarField& vsf,
47 const word& graphFormat
48)
49{
50 makeGraph(x, vsf, vsf.name(), graphFormat);
52
53
55(
56 const scalarField& x,
57 const volScalarField& vsf,
58 const word& name,
59 const word& graphFormat
60)
61{
62 fileName path(vsf.rootPath()/vsf.caseName()/"graphs"/vsf.instance());
63 mkDir(path);
64
66 (
67 x,
68 vsf.primitiveField(),
69 name,
70 path,
71 graphFormat
72 );
74
75
77(
78 const scalarField& x,
79 const scalarField& sf,
80 const word& name,
81 const fileName& path,
82 const word& graphFormat
83)
84{
85 graph
86 (
87 name,
88 "x",
89 name,
90 x,
91 sf
92 ).write(path/name, graphFormat);
93}
94
95
96// ************************************************************************* //
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
const fileName & caseName() const
Return the Time::caseName()
Definition: IOobject.C:518
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:65
const fileName & instance() const noexcept
Read access to instance path component.
Definition: IOobjectI.H:196
const fileName & rootPath() const
Return the Time::rootPath()
Definition: IOobject.C:512
A class for handling file names.
Definition: fileName.H:76
Class to create, store and output qgraph files.
Definition: graph.H:62
void write(Ostream &, const word &format) const
Write graph to stream in given format.
Definition: graph.C:266
A class for handling words, derived from Foam::string.
Definition: word.H:68
makeGraph(y, UMeanXvalues, "Uf", path, gFormat)
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
void makeGraph(const scalarField &x, const volScalarField &vsf, const word &graphFormat)
Definition: makeGraph.C:41
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
mkDir(pdfPath)