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 // ************************************************************************* //
fileName path() const
Return path = rootPath/caseName. Same as TimePaths::path()
Definition: Time.H:503
A class for handling file names.
Definition: fileName.H:72
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
void writeCellGraph(const volScalarField &vsf, const word &graphFormat)
Definition: writeCellGraph.C:9
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:195
Class to create, store and output qgraph files.
Definition: graph.H:53
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
Definition: POSIX.C:614
A class for handling words, derived from Foam::string.
Definition: word.H:63
const Time & time() const noexcept
Return Time associated with the objectRegistry.
Definition: IOobject.C:456
const Mesh & mesh() const noexcept
Return mesh.
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
Definition: Time.C:714
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())