patchFunction1Base.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) 2020-2021 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
26Class
27 Foam::patchFunction1Base
28
29Description
30 Top level data entry class for use in dictionaries. Provides a mechanism
31 to specify a variable as a certain type, e.g. constant or time varying, and
32 provide functions to return the (interpolated) value, and integral between
33 limits.
34
35 Extends the Function1 class by adding autoMap and rMap functions
36
37SourceFiles
38 patchFunction1Base.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef Foam_patchFunction1Base_H
43#define Foam_patchFunction1Base_H
44
45#include "dictionary.H"
46#include "polyPatch.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53// Forward Declarations
54class objectRegistry;
55class Time;
56
57/*---------------------------------------------------------------------------*\
58 Class patchFunction1Base Declaration
59\*---------------------------------------------------------------------------*/
62:
63 public refCount
64{
65protected:
66
67 // Protected Data
68
69 //- Name of entry
70 const word name_;
71
72 //- Reference to the patch
73 const polyPatch& patch_;
74
75 //- Generate face or point values on patch
76 const bool faceValues_;
77
78
79 // Protected Member Functions
80
81 //- No copy assignment
82 void operator=(const patchFunction1Base&) = delete;
83
84
85public:
86
87 // Constructors
88
89 //- Construct from polyPatch and entry name
91 (
92 const polyPatch& pp,
93 const word& entryName,
94 const bool faceValues = true
95 );
96
97 //- Construct from polyPatch, dictionary and entry name
99 (
100 const polyPatch& pp,
101 const word& entryName,
102 const dictionary& dict,
103 const bool faceValues = true
104 );
105
106 //- Copy construct
107 explicit patchFunction1Base(const patchFunction1Base& rhs);
108
109 //- Copy construct setting patch
110 explicit patchFunction1Base
111 (
112 const patchFunction1Base& rhs,
113 const polyPatch& pp
114 );
115
116
117 //- Destructor
118 virtual ~patchFunction1Base() = default;
119
120
121 // Member Functions
122
123 // Access
124
125 //- The name of the entry
126 const word& name() const noexcept
127 {
128 return name_;
129 }
130
131 //- Reference to the patch
132 const polyPatch& patch() const noexcept
133 {
134 return patch_;
135 }
136
137 //- Generate face or point values on patch?
138 bool faceValues() const noexcept
139 {
140 return faceValues_;
141 }
142
143 //- Number of faces or points on the patch
144 label size() const
145 {
146 return (faceValues_ ? patch_.size() : patch_.nPoints());
147 }
148
149
150 //- Return the associated registry (ie, the mesh)
151 const objectRegistry* whichDb() const;
152
153 //- Return the object registry (ie, the mesh)
154 const objectRegistry& obr() const;
155
156 //- Return false: function not created with time database
161
162 //- Return the time database
163 const Time& time() const;
164
165
166 // Manipulation
167
168 //- Convert time
169 virtual void userTimeToTime(const Time& t);
170};
171
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175} // End namespace Foam
176
177// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178
179#endif
180
181// ************************************************************************* //
label nPoints() const
Number of points supporting patch faces.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Registry of regIOobjects.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
const bool faceValues_
Generate face or point values on patch.
const Time & time() const
Return false: function not created with time database.
const polyPatch & patch_
Reference to the patch.
const polyPatch & patch() const noexcept
Reference to the patch.
const objectRegistry & obr() const
Return the object registry (ie, the mesh)
virtual ~patchFunction1Base()=default
Destructor.
const objectRegistry * whichDb() const
Return the associated registry (ie, the mesh)
const word & name() const noexcept
The name of the entry.
label size() const
Number of faces or points on the patch.
bool faceValues() const noexcept
Generate face or point values on patch?
void operator=(const patchFunction1Base &)=delete
No copy assignment.
virtual void userTimeToTime(const Time &t)
Convert time.
const word name_
Name of entry.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
Reference counter for various OpenFOAM components.
Definition: refCount.H:51
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
const direction noexcept
Definition: Scalar.H:223
dictionary dict