writeCellGraph.C
Go to the documentation of this file.
1 #include "writeCellGraph.H"
2 #include "volFields.H"
3 #include "fvMesh.H"
4 #include "graph.H"
5 
6 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
7 
8 namespace Foam
9 {
10 
11 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
12 
13 void writeCellGraph
14 (
15  const volScalarField& vsf,
16  const word& graphFormat
17 )
18 {
19  fileName path(vsf.time().path()/"graphs"/vsf.time().timeName());
20  mkDir(path);
21 
22  graph
23  (
24  vsf.name(),
25  "x",
26  vsf.name(),
27  vsf.mesh().C().internalField().component(vector::X),
28  vsf.internalField()
29  ).write(path/vsf.name(), graphFormat);
30 }
31 
32 
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 
35 } // End namespace Foam
36 
37 // ************************************************************************* //
volFields.H
Foam::graph
Class to create, store and output qgraph files.
Definition: graph.H:58
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::writeCellGraph
void writeCellGraph(const volScalarField &vsf, const word &graphFormat)
Definition: writeCellGraph.C:14
Foam::Vector< scalar >::X
@ X
Definition: Vector.H:89
Foam::GeometricField::internalField
InternalField & internalField()
Return internal field.
Definition: GeometricField.C:724
Foam::graph::write
void write(Ostream &, const word &format) const
Write graph to stream in given format.
Definition: graph.C:221
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::Field::component
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
Definition: Field.C:644
path
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
graph.H
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::mkDir
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Definition: POSIX.C:419
graphFormat
word graphFormat
Definition: createFields.H:34
writeCellGraph.H