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 
9 (
10  const volScalarField& vsf,
11  const word& graphFormat
12 )
13 {
14  fileName path(vsf.time().path()/"graphs"/vsf.time().timeName());
15  mkDir(path);
16 
17  graph
18  (
19  vsf.name(),
20  "x",
21  vsf.name(),
22  vsf.mesh().C().primitiveField().component(vector::X),
23  vsf.primitiveField()
24  ).write(path/vsf.name(), graphFormat);
25 }
26 
27 
28 // ************************************************************************* //
volFields.H
Foam::graph
Class to create, store and output qgraph files.
Definition: graph.H:61
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::GeometricField::primitiveField
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
Definition: GeometricFieldI.H:53
Foam::writeCellGraph
void writeCellGraph(const volScalarField &vsf, const word &graphFormat)
Definition: writeCellGraph.C:9
fvMesh.H
Foam::Field::component
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
Definition: Field.C:539
path
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
graph.H
Foam::vtk::write
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Definition: foamVtkOutputTemplates.C:36
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::mkDir
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
Definition: MSwindows.C:507
writeCellGraph.H