writePatchGraph.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "writePatchGraph.H"
27 #include "volFields.H"
28 #include "fvMesh.H"
29 #include "graph.H"
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 
38 void writePatchGraph
39 (
40  const volScalarField& vsf,
41  const label patchLabel,
42  const direction d,
43  const word& graphFormat
44 )
45 {
46  graph
47  (
48  vsf.name(),
49  "position",
50  vsf.name(),
51  vsf.mesh().boundary()[patchLabel].Cf().component(d),
52  vsf.boundaryField()[patchLabel]
53  ).write(vsf.time().timePath()/vsf.name(), graphFormat);
54 }
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 } // End namespace Foam
59 
60 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
const word & name() const
Return name.
Definition: IOobject.H:303
fileName timePath() const
Return current time path.
Definition: Time.H:279
const Boundary & boundaryField() const
Return const-reference to the boundary field.
word graphFormat
Definition: createFields.H:21
uint8_t direction
Definition: direction.H:45
Generic GeometricField class.
Class to create, store and output qgraph files.
Definition: graph.H:58
A class for handling words, derived from string.
Definition: word.H:59
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
const Mesh & mesh() const
Return mesh.
const Time & time() const
Return time.
Definition: IOobject.C:318
void writePatchGraph(const volScalarField &vsf, const label patchLabel, const direction d, const word &graphFormat)
Namespace for OpenFOAM.