Loading...
Searching...
No Matches
ROMmodel.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) 2023 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Namespace
27 Foam::ROMmodels
28
29Description
30 A namespace for various implementations of
31 reduced-order (ROM) field creation models.
32
33Class
34 Foam::ROMmodel
35
36Description
37 Abstract base class for reduced-order models
38 to handle specific model characteristics.
39
40SourceFiles
41 ROMmodel.C
42 ROMmodelNew.C
43
44\*---------------------------------------------------------------------------*/
45
46#ifndef Foam_ROMmodel_H
47#define Foam_ROMmodel_H
48
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56// Forward Declarations
57class Time;
58class fvMesh;
59class dictionary;
60class instant;
61typedef class List<instant> instantList;
62
63/*---------------------------------------------------------------------------*\
64 Class ROMmodel Declaration
65\*---------------------------------------------------------------------------*/
66
67class ROMmodel
68{
69protected:
70
71 // Protected Data
72
73 //- Reference to the Time
74 // Need non-const access to use setTime
76
77 //- Reference to the fvMesh
78 // Need non-const access to use readFieldsHandler
80
81 //- Const reference to the dictionary
82 const dictionary& dict_;
83
84 //- Const reference to field times
85 const instantList& times_;
87
88public:
89
90 //- Runtime type information
91 TypeName("ROMmodel");
92
93
94 // Declare runtime constructor selection table
95
97 (
98 autoPtr,
101 (
102 Time& runTime,
103 fvMesh& mesh,
105 const instantList& times
106 ),
107 (runTime, mesh, dict, times)
108 );
109
110
111 // Selectors
112
113 //- Return a reference to the selected ROMmodel
115 (
116 Time& runTime,
117 fvMesh& mesh,
118 const dictionary& dict,
119 const instantList& times
120 );
121
122
123 // Constructors
125 //- Construct from components
127 (
128 Time& runTime,
129 fvMesh& mesh,
130 const dictionary& dict,
131 const instantList& times
132 );
133
134 //- No copy construct
135 ROMmodel(const ROMmodel&) = delete;
136
137 //- No copy assignment
138 void operator=(const ROMmodel&) = delete;
139
140
141 //- Destructor
142 virtual ~ROMmodel() = default;
143
144
145 // Member Functions
146
147 //- Read model settings
148 virtual bool read(const dictionary& dict) = 0;
150 //- Create and write fields
151 virtual bool createAndWrite() = 0;
152};
153
155// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156
157} // End namespace Foam
158
159// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161#endif
162
163// ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
virtual bool createAndWrite()=0
Create and write fields.
virtual ~ROMmodel()=default
Destructor.
void operator=(const ROMmodel &)=delete
No copy assignment.
ROMmodel(const ROMmodel &)=delete
No copy construct.
TypeName("ROMmodel")
Runtime type information.
const instantList & times_
Const reference to field times.
Definition ROMmodel.H:91
Time & runTime_
Reference to the Time.
Definition ROMmodel.H:74
declareRunTimeSelectionTable(autoPtr, ROMmodel, dictionary,(Time &runTime, fvMesh &mesh, const dictionary &dict, const instantList &times),(runTime, mesh, dict, times))
ROMmodel(Time &runTime, fvMesh &mesh, const dictionary &dict, const instantList &times)
Construct from components.
const dictionary & dict_
Const reference to the dictionary.
Definition ROMmodel.H:86
static autoPtr< ROMmodel > New(Time &runTime, fvMesh &mesh, const dictionary &dict, const instantList &times)
Return a reference to the selected ROMmodel.
fvMesh & mesh_
Reference to the fvMesh.
Definition ROMmodel.H:81
virtual bool read(const dictionary &dict)=0
Read model settings.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name.
Definition instant.H:56
dynamicFvMesh & mesh
engineTime & runTime
Namespace for OpenFOAM.
List< instant > instantList
List of instants.
Definition instantList.H:41
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68