1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 Sample field data with a choice of interpolation schemes, sampling options
30 @param setFormat : set output format, choice of \n
36 @param surfaceFormat : surface output format, choice of \n
37 - null : suppress output
38 - foamFile : separate points, faces and values file
39 - dx : DX scalar or vector format
40 - vtk : VTK ascii format
41 - raw : x y z value format for use with e.g. gnuplot 'splot'.
42 - obj : Wavefron stl. Does not contain values!
43 - stl : ascii stl. Does not contain values!
45 @param interpolationScheme : interpolation scheme, choice of \n
46 - cell : use cell-centre value; constant over cells (default)
47 - cellPoint : use cell-centre and vertex values
48 - cellPointFace : use cell-centre, vertex and face values. \n
49 -# vertex values determined from neighbouring cell-centre values
50 -# face values determined using the current face interpolation scheme
51 for the field (linear, limitedLinear, etc.)
53 @param fields : list of fields to sample
55 @param sets : list of sets to sample, choice of \n
56 - uniform evenly distributed points on line
57 - face one point per face intersection
58 - midPoint one point per cell, inbetween two face intersections
59 - midPointAndFace combination of face and midPoint
61 - curve specified points, not nessecary on line, uses
63 - cloud specified points, uses findCell
65 Option axis: how to write point coordinate. Choice of
66 - x/y/z: x/y/z coordinate only
68 (probably does not make sense for anything but raw)
69 - distance: distance from start of sampling line (if uses line)
70 or distance from first specified sampling point
72 Type specific options:
73 uniform, face, midPoint, midPointAndFace : start and end coordinate
74 uniform: extra number of sampling points
75 curve, cloud: list of coordinates
77 @param surfaces : list of surfaces to sample, choice of \n
78 - plane : values on plane defined by point, normal.
79 - patch : values on patch.
84 \*---------------------------------------------------------------------------*/
87 #include "timeSelector.H"
88 #include "IOsampledSets.H"
89 #include "IOsampledSurfaces.H"
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 int main(int argc, char *argv[])
98 timeSelector::addOptions();
99 #include "addRegionOption.H"
100 argList::validOptions.insert("dict", "dictionary name");
102 #include "setRootCase.H"
103 #include "createTime.H"
104 instantList timeDirs = timeSelector::select0(runTime, args);
105 #include "createNamedMesh.H"
107 word sampleDict = "sampleDict";
108 if (args.optionFound("dict"))
110 sampleDict = args.option("dict");
111 Info<< "Reading sample dictionary: " << sampleDict << nl << endl;
116 sampledSets::typeName,
123 IOsampledSurfaces sSurfs
125 sampledSurfaces::typeName,
132 forAll(timeDirs, timeI)
134 runTime.setTime(timeDirs[timeI], timeI);
135 Info<< "Time = " << runTime.timeName() << endl;
137 // Handle geometry/topology changes
138 polyMesh::readUpdateState state = mesh.readUpdate();
140 sSets.readUpdate(state);
141 sSurfs.readUpdate(state);
149 Info<< "End\n" << endl;
155 // ************************************************************************* //