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().primitiveField().component(vector::X),
28  vsf.primitiveField()
29  ).write(path/vsf.name(), graphFormat);
30 }
31 
32 
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 
35 } // End namespace Foam
36 
37 // ************************************************************************* //
fileName path() const
Return path.
Definition: Time.H:266
const word & name() const
Return name.
Definition: IOobject.H:297
A class for handling file names.
Definition: fileName.H:69
word graphFormat
Definition: createFields.H:34
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
Generic GeometricField class.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Definition: Time.C:626
Class to create, store and output qgraph files.
Definition: graph.H:58
void write(Ostream &, const label, const dictionary &)
Write with dictionary lookup.
A class for handling words, derived from string.
Definition: word.H:59
const Mesh & mesh() const
Return mesh.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Definition: POSIX.C:289
void writeCellGraph(const volScalarField &vsf, const word &graphFormat)
const Time & time() const
Return time.
Definition: IOobject.C:367
Namespace for OpenFOAM.