1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Singleton caching Foam database and mesh and various. Used in Fv reader
29 to keep track of data inbetween callbacks.
34 \*---------------------------------------------------------------------------*/
36 #ifndef readerDatabase_H
37 #define readerDatabase_H
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 // Forward declaration of classes
56 /*---------------------------------------------------------------------------*\
57 Class readerDatabase Declaration
58 \*---------------------------------------------------------------------------*/
64 //- Names for protected Fieldview keywords. Gets set at construction
66 // Note: Should be static but this gives problem with construction
67 // order since *this is static as well.
68 HashTable<word> fieldviewNames_;
75 //- Cached mesh, guaranteed uptodate with runTime.
76 fvMeshSubset* meshPtr_;
78 //- Empty string or name of current set.
81 //- Cell labels of polyHedra. Uptodate with meshPtr.
84 //- All volScalarFields in all time directories
85 wordList volScalarNames_;
87 //- All volVectorFields ,,
88 wordList volVectorNames_;
91 // Private Member Functions
93 //- Gets cell numbers of all polyHedra
96 //- Disallow default bitwise copy construct
97 readerDatabase(const readerDatabase&);
99 //- Disallow default bitwise assignment
100 void operator=(const readerDatabase&);
107 //- Debug flag. Note: uses envvar instead of controlDict since
108 // *this is static as well. Might be initialized before controlDict
110 const static bool debug_;
128 const Time& runTime() const;
130 const fvMesh& mesh() const;
132 const labelList& polys() const;
134 const wordList& volScalarNames() const;
136 const wordList& volVectorNames() const;
138 //- Get fieldview compatible name.
139 const word& getFvName(const word& foamName) const;
143 //- Create database (if nessecary).
144 // Returns true if new Time created, false if old one reused.
145 // Optional fvMeshSubset using setName.
148 const fileName& rootDir,
149 const fileName& caseName,
153 //- Forcibly load mesh.
156 //- Set time (use this instead of database::setTime), updates
157 // mesh as well and returns mesh update status
158 polyMesh::readUpdateState setTime(const instant&, const label);
160 //- Set volScalarNames, volVectorNames.
161 void setFieldNames(const wordList&, const wordList&);
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 // ************************************************************************* //