Loading...
Searching...
No Matches
resolutionIndexModel.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) 2022 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::resolutionIndexModels
28
29Description
30 A namespace for various \c resolutionIndex model implementations.
31
32Class
33 Foam::resolutionIndexModel
34
35Description
36 A base class for \c resolutionIndex models.
37
38SourceFiles
39 resolutionIndexModel.C
40 resolutionIndexModelNew.C
41
42\*---------------------------------------------------------------------------*/
43
44#ifndef Foam_resolutionIndexModel_H
45#define Foam_resolutionIndexModel_H
46
47#include "volFields.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
53
54// Forward Declarations
55class fvMesh;
56
57/*---------------------------------------------------------------------------*\
58 Class resolutionIndexModel Declaration
59\*---------------------------------------------------------------------------*/
60
62{
63 // Private Data
64
65 //- Const reference to the mesh
66 const fvMesh& mesh_;
67
68 //- Name of result field
69 word resultName_;
70
71
72protected:
73
74 // Protected Member Functions
75
76 //- Return requested field from the object registry
77 //- or read+register the field to the object registry
78 template<class GeoFieldType>
79 GeoFieldType& getOrReadField(const word& fieldName) const;
80
81 //- Return cell volume field
82 tmp<volScalarField> V() const;
83
84
85public:
86
87 //- Runtime type information
88 TypeName("resolutionIndexModel");
89
90
91 // Declare runtime constructor selection table
92
94 (
95 autoPtr,
98 (
99 const word& name,
100 const fvMesh& mesh,
101 const dictionary& dict
102 ),
103 (name, mesh, dict)
104 );
105
106
107 // Selectors
108
109 //- Return a reference to the selected resolutionIndex model
111 (
112 const word& name,
113 const fvMesh& mesh,
114 const dictionary& dict
115 );
116
117
118 // Constructors
119
120 //- Construct from components
122 (
123 const word& name,
124 const fvMesh& mesh,
125 const dictionary& dict
126 );
127
128 //- No copy construct
130
131 //- No copy assignment
132 void operator=(const resolutionIndexModel&) = delete;
133
134
135 //- Destructor
136 virtual ~resolutionIndexModel() = default;
137
138
139 // Member Functions
140
141 // Access
142
143 //- Return const reference to the mesh
144 const fvMesh& mesh() const noexcept { return mesh_; }
145
146 //- Return const reference to the result name
147 const word& resultName() const noexcept { return resultName_; }
148
149
150 // I-O
151
152 //- Read the function-object dictionary
153 virtual bool read(const dictionary& dict);
154
155 //- Execute the function-object operations
156 virtual bool execute() = 0;
157
158 //- Write the function-object results
159 virtual bool write() = 0;
160};
161
163// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164
165} // End namespace Foam
166
167// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168
169#ifdef NoRepository
171#endif
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#endif
176
177// ************************************************************************* //
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
const fvMesh & mesh() const noexcept
Return const reference to the mesh.
virtual ~resolutionIndexModel()=default
Destructor.
declareRunTimeSelectionTable(autoPtr, resolutionIndexModel, dictionary,(const word &name, const fvMesh &mesh, const dictionary &dict),(name, mesh, dict))
tmp< volScalarField > V() const
Return cell volume field.
resolutionIndexModel(const word &name, const fvMesh &mesh, const dictionary &dict)
Construct from components.
GeoFieldType & getOrReadField(const word &fieldName) const
Return requested field from the object registry or read+register the field to the object registry.
virtual bool execute()=0
Execute the function-object operations.
const word & resultName() const noexcept
Return const reference to the result name.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
void operator=(const resolutionIndexModel &)=delete
No copy assignment.
resolutionIndexModel(const resolutionIndexModel &)=delete
No copy construct.
static autoPtr< resolutionIndexModel > New(const word &name, const fvMesh &mesh, const dictionary &dict)
Return a reference to the selected resolutionIndex model.
TypeName("resolutionIndexModel")
Runtime type information.
virtual bool write()=0
Write the function-object results.
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
const direction noexcept
Definition scalarImpl.H:265
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
#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