data.H
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-2016 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 Class
28  Foam::data
29 
30 Description
31  Database for solution data, solver performance and other reduced data.
32 
33  fvMesh is derived from data so that all fields have access to the data from
34  the mesh reference they hold.
35 
36 SourceFiles
37  data.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef data_H
42 #define data_H
43 
44 #include "IOdictionary.H"
45 #include "solverPerformance.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class data Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class data
57 :
58  public IOdictionary
59 {
60  // Private data
61 
62  //- Previously used time-index, used for reset between iterations
63  mutable label prevTimeIndex_;
64 
65 
66  // Private Member Functions
67 
68  //- No copy construct
69  data(const data&) = delete;
70 
71  //- No copy assignment
72  void operator=(const data&) = delete;
73 
74 
75 public:
76 
77  //- Debug switch
78  static int debug;
79 
80 
81  // Constructors
82 
83  //- Construct for objectRegistry
84  data(const objectRegistry& obr);
85 
86  //- Construct for objectRegistry and initial contents
87  data(const objectRegistry& obr, const dictionary& dict);
88 
89 
90  // Member Functions
91 
92  //- Return the dictionary of solver performance data which
93  //- includes initial and final residuals for convergence checking
94  const dictionary& solverPerformanceDict() const;
95 
96  //- Add/set the solverPerformance entry for the named field
97  template<class Type>
99  (
100  const word& name,
101  const SolverPerformance<Type>& sp
102  ) const;
103 
104  //- Add/set the solverPerformance entry, using its fieldName
105  template<class Type>
107  (
108  const SolverPerformance<Type>& sp
109  ) const;
110 };
111 
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 } // End namespace Foam
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #ifdef NoRepository
120  #include "dataTemplates.C"
121 #endif
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #endif
126 
127 // ************************************************************************* //
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::data::setSolverPerformance
void setSolverPerformance(const word &name, const SolverPerformance< Type > &sp) const
Add/set the solverPerformance entry for the named field.
Definition: dataTemplates.C:36
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::baseIOdictionary::name
const word & name() const
Definition: baseIOdictionary.C:85
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
dataTemplates.C
Foam::data::solverPerformanceDict
const dictionary & solverPerformanceDict() const
Definition: data.C:78
solverPerformance.H
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:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
IOdictionary.H
Foam::SolverPerformance
SolverPerformance is the class returned by the LduMatrix solver containing performance statistics.
Definition: SolverPerformance.H:52
Foam::data
Database for solution data, solver performance and other reduced data.
Definition: data.H:55