probeLocations.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Application
25  probeLocations
26 
27 Description
28  Probe locations.
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #include "argList.H"
33 #include "timeSelector.H"
34 #include "IOprobes.H"
35 
36 using namespace Foam;
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 int main(int argc, char *argv[])
41 {
43  #include "addRegionOption.H"
44 
45  #include "setRootCase.H"
46  #include "createTime.H"
48  #include "createNamedMesh.H"
49 
50  IOprobes sniff
51  (
53  mesh,
54  word("probesDict"), // force the use of the system directory
56  true
57  );
58 
59  forAll(timeDirs, timeI)
60  {
61  runTime.setTime(timeDirs[timeI], timeI);
62  Info<< "Time = " << runTime.timeName() << endl;
63 
64  // Handle geometry/topology changes
66 
67  if
68  (
69  state == polyMesh::POINTS_MOVED
70  || state == polyMesh::TOPO_CHANGE
71  )
72  {
73  sniff.read();
74  }
75 
76  sniff.write();
77 
78  Info<< endl;
79  }
80 
81  Info<< "End\n" << endl;
82 
83  return 0;
84 }
85 
86 
87 // ************************************************************************* //
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::polyMesh::POINTS_MOVED
@ POINTS_MOVED
Definition: polyMesh.H:91
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::Field::typeName
static const char *const typeName
Definition: Field.H:94
Foam::IOobject::MUST_READ
@ MUST_READ
Definition: IOobject.H:108
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::fvMesh::readUpdate
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
Definition: fvMesh.C:498
IOprobes.H
Foam::Info
messageStream Info
argList.H
Foam::IOOutputFilter
IOdictionary wrapper around OutputFilter to allow them to read from their associated dictionaries.
Definition: IOOutputFilter.H:59
addRegionOption.H
main
int main(int argc, char *argv[])
Definition: postCalc.C:54
Foam::polyMesh::TOPO_CHANGE
@ TOPO_CHANGE
Definition: polyMesh.H:92
createNamedMesh.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::polyMesh::readUpdateState
readUpdateState
Enumeration defining the state of the mesh after a read update.
Definition: polyMesh.H:88
setRootCase.H
timeDirs
static instantList timeDirs
Definition: globalFoam.H:44
Foam::timeSelector::addOptions
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
Definition: timeSelector.C:114
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
timeSelector.H
createTime.H
Foam::timeSelector::select0
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options.
Definition: timeSelector.C:253
args
Foam::argList args(argc, argv)