data.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2015 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "data.H"
30 #include "Time.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
35 
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
39 Foam::data::data(const objectRegistry& obr)
40 :
42  (
43  IOobject
44  (
45  "data",
46  obr.time().system(),
47  obr,
48  IOobject::NO_READ,
49  IOobject::NO_WRITE
50  )
51  ),
52  prevTimeIndex_(0)
53 {
54  set("solverPerformance", dictionary());
55 }
56 
57 
58 Foam::data::data(const objectRegistry& obr, const dictionary& dict)
59 :
61  (
62  IOobject
63  (
64  "data",
65  obr.time().system(),
66  obr,
67  IOobject::NO_READ,
68  IOobject::NO_WRITE
69  ),
70  dict
71  ),
72  prevTimeIndex_(0)
73 {}
74 
75 
76 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
77 
79 {
80  return subDict("solverPerformance");
81 }
82 
83 
84 // ************************************************************************* //
Foam::data::debug
static int debug
Debug switch.
Definition: data.H:77
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:54
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::debug::debugSwitch
int debugSwitch(const char *name, const int deflt=0)
Lookup debug switch or add default value.
Definition: debug.C:225
Foam::dictionary::dictionary
dictionary()
Default construct, a top-level empty dictionary.
Definition: dictionary.C:81
Foam::system
int system(const std::string &command, const bool bg=false)
Execute the specified command via the shell.
Definition: MSwindows.C:1140
Foam::dictionary::set
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
Definition: dictionary.C:847
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::data::solverPerformanceDict
const dictionary & solverPerformanceDict() const
Definition: data.C:78
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Time.H
data.H