Added IOobject::readOption to IOOutputFilter

- allows post-processing functions with an optional dictionary
   (eg, the developer can hard-wire some defaults)
This commit is contained in:
Mark Olesen
2008-07-21 16:40:05 +02:00
parent 4d96b876e4
commit 85c164340e
4 changed files with 42 additions and 38 deletions

View File

@ -44,7 +44,7 @@ int main(int argc, char *argv[])
instantList timeDirs = timeSelector::select0(runTime, args); instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H" # include "createMesh.H"
IOprobes sniff(mesh, "probesDict", true); IOprobes sniff(mesh, "probesDict", IOobject::MUST_READ, true);
forAll(timeDirs, timeI) forAll(timeDirs, timeI)
{ {

View File

@ -28,39 +28,39 @@ Description
Keywords: Keywords:
setFormat: set output format, choice of @param setFormat : set output format, choice of \n
xmgr - xmgr
jplot - jplot
gnuplot - gnuplot
raw - raw
surfaceFormat: surface output format, choice of @param surfaceFormat : surface output format, choice of \n
null : suppress output - null : suppress output
foamFile : separate points, faces and values file - foamFile : separate points, faces and values file
dx : DX scalar or vector format - dx : DX scalar or vector format
vtk : VTK ascii format - vtk : VTK ascii format
raw : x y z value format for use with e.g. gnuplot 'splot'. - raw : x y z value format for use with e.g. gnuplot 'splot'.
stl : ascii stl. Does not contain values! - stl : ascii stl. Does not contain values!
interpolationScheme: interpolation scheme, choice of @param interpolationScheme : interpolation scheme, choice of \n
cell : use cell-centre value; constant over cells (default) - cell : use cell-centre value; constant over cells (default)
cellPoint : use cell-centre and vertex values - cellPoint : use cell-centre and vertex values
cellPointFace : use cell-centre, vertex and face values. - cellPointFace : use cell-centre, vertex and face values. \n
1] vertex values determined from neighbouring cell-centre values -# vertex values determined from neighbouring cell-centre values
2] face values determined using the current face interpolation scheme -# face values determined using the current face interpolation scheme
for the field (linear, limitedLinear, etc.) for the field (linear, limitedLinear, etc.)
fields: list of fields to sample @param fields : list of fields to sample
sets: list of sets to sample, choice of @param sets : list of sets to sample, choice of \n
uniform evenly distributed points on line - uniform evenly distributed points on line
face one point per face intersection - face one point per face intersection
midPoint one point per cell, inbetween two face intersections - midPoint one point per cell, inbetween two face intersections
midPointAndFace combination of face and midPoint - midPointAndFace combination of face and midPoint
curve specified points, not nessecary on line, uses - curve specified points, not nessecary on line, uses
tracking tracking
cloud specified points, uses findCell - cloud specified points, uses findCell
Option axis: how to write point coordinate. Choice of Option axis: how to write point coordinate. Choice of
- x/y/z: x/y/z coordinate only - x/y/z: x/y/z coordinate only
@ -74,11 +74,12 @@ Description
uniform: extra number of sampling points uniform: extra number of sampling points
curve, cloud: list of coordinates curve, cloud: list of coordinates
surfaces: list of surfaces to sample, choice of @param surfaces : list of surfaces to sample, choice of \n
plane : values on plane defined by point, normal. - plane : values on plane defined by point, normal.
patch : values on patch. - patch : values on patch.
Runs in parallel. Notes
Runs in parallel
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -100,8 +101,8 @@ int main(int argc, char *argv[])
instantList timeDirs = timeSelector::select0(runTime, args); instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H" # include "createMesh.H"
IOsampledSets sSets(mesh, "sampleDict", true); IOsampledSets sSets(mesh, "sampleDict", IOobject::MUST_READ, true);
IOsampledSurfaces sSurfaces(mesh, "sampleDict", true); IOsampledSurfaces sSurfs(mesh, "sampleDict", IOobject::MUST_READ, true);
forAll(timeDirs, timeI) forAll(timeDirs, timeI)
{ {
@ -112,10 +113,10 @@ int main(int argc, char *argv[])
polyMesh::readUpdateState state = mesh.readUpdate(); polyMesh::readUpdateState state = mesh.readUpdate();
sSets.readUpdate(state); sSets.readUpdate(state);
sSurfaces.readUpdate(state); sSurfs.readUpdate(state);
sSets.write(); sSets.write();
sSurfaces.write(); sSurfs.write();
Info<< endl; Info<< endl;
} }

View File

@ -34,6 +34,7 @@ Foam::IOOutputFilter<OutputFilter>::IOOutputFilter
( (
const objectRegistry& obr, const objectRegistry& obr,
const fileName& dictName, const fileName& dictName,
const IOobject::readOption rOpt,
const bool readFromFiles const bool readFromFiles
) )
: :
@ -44,7 +45,7 @@ Foam::IOOutputFilter<OutputFilter>::IOOutputFilter
dictName, dictName,
obr.time().system(), obr.time().system(),
obr, obr,
IOobject::MUST_READ, rOpt,
IOobject::NO_WRITE IOobject::NO_WRITE
) )
), ),

View File

@ -70,11 +70,13 @@ public:
// Constructors // Constructors
//- Construct for given objectRegistry and dictionary //- Construct for given objectRegistry and dictionary
// allow the possibility to load fields from files // Allow dictionary to be optional
// Allow the possibility to load fields from files
IOOutputFilter IOOutputFilter
( (
const objectRegistry&, const objectRegistry&,
const fileName& dictName = OutputFilter::typeName() + "Dict", const fileName& dictName = OutputFilter::typeName() + "Dict",
const IOobject::readOption rOpt = IOobject::MUST_READ,
const bool loadFromFile = false const bool loadFromFile = false
); );