1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Singleton caching Foam database and mesh and various. Used in Fv reader
30 to keep track of data inbetween callbacks.
35 \*---------------------------------------------------------------------------*/
37 #ifndef readerDatabase_H
38 #define readerDatabase_H
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 // Forward declaration of classes
57 /*---------------------------------------------------------------------------*\
58 Class readerDatabase Declaration
59 \*---------------------------------------------------------------------------*/
65 //- Names for protected Fieldview keywords. Gets set at construction
67 // Note: Should be static but this gives problem with construction
68 // order since *this is static as well.
69 HashTable<word> fieldviewNames_;
76 //- Cached mesh, guaranteed uptodate with runTime.
77 fvMeshSubset* meshPtr_;
79 //- Empty string or name of current set.
82 //- Cell labels of polyHedra. Uptodate with meshPtr.
85 //- All volScalarFields in all time directories
86 wordList volScalarNames_;
88 //- All volVectorFields ,,
89 wordList volVectorNames_;
92 // Private Member Functions
94 //- Gets cell numbers of all polyHedra
97 //- Disallow default bitwise copy construct
98 readerDatabase(const readerDatabase&);
100 //- Disallow default bitwise assignment
101 void operator=(const readerDatabase&);
108 //- Debug flag. Note: uses envvar instead of controlDict since
109 // *this is static as well. Might be initialized before controlDict
111 const static bool debug_;
129 const Time& runTime() const;
131 const fvMesh& mesh() const;
133 const labelList& polys() const;
135 const wordList& volScalarNames() const;
137 const wordList& volVectorNames() const;
139 //- Get fieldview compatible name.
140 const word& getFvName(const word& foamName) const;
144 //- Create database (if nessecary).
145 // Returns true if new Time created, false if old one reused.
146 // Optional fvMeshSubset using setName.
149 const fileName& rootDir,
150 const fileName& caseName,
154 //- Forcibly load mesh.
157 //- Set time (use this instead of database::setTime), updates
158 // mesh as well and returns mesh update status
159 polyMesh::readUpdateState setTime(const instant&, const label);
161 //- Set volScalarNames, volVectorNames.
162 void setFieldNames(const wordList&, const wordList&);
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 } // End namespace Foam
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 // ************************************************************************* //