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 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::patchFunction1Base
28 
29 Description
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 
37 SourceFiles
38  patchFunction1Base.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef patchFunction1Base_H
43 #define patchFunction1Base_H
44 
45 #include "dictionary.H"
46 #include "polyPatch.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 // Forward Declarations
54 class Time;
55 
56 /*---------------------------------------------------------------------------*\
57  Class patchFunction1Base Declaration
58 \*---------------------------------------------------------------------------*/
59 
61 :
62  public refCount
63 {
64 protected:
65 
66  // Protected Data
67 
68  //- Name of entry
69  const word name_;
70 
71  //- Reference to the patch
72  const polyPatch& patch_;
73 
74  //- Generate face or point values on patch
75  const bool faceValues_;
76 
77 
78  // Protected Member Functions
79 
80  //- No copy assignment
81  void operator=(const patchFunction1Base&) = delete;
82 
83 
84 public:
85 
86  // Constructors
87 
88  //- Construct from polyPatch and entry name
90  (
91  const polyPatch& pp,
92  const word& entryName,
93  const bool faceValues = true
94  );
95 
96  //- Construct from polyPatch, dictionary and entry name
98  (
99  const polyPatch& pp,
100  const word& entryName,
101  const dictionary& dict,
102  const bool faceValues = true
103  );
104 
105  //- Copy construct
106  explicit patchFunction1Base(const patchFunction1Base& rhs);
107 
108  //- Copy construct setting patch
109  explicit patchFunction1Base
110  (
111  const patchFunction1Base& rhs,
112  const polyPatch& pp
113  );
114 
115 
116  //- Destructor
117  virtual ~patchFunction1Base() = default;
118 
119 
120  // Member Functions
121 
122  // Access
123 
124  //- The name of the entry
125  const word& name() const
126  {
127  return name_;
128  }
129 
130  //- Reference to the patch
131  const polyPatch& patch() const
132  {
133  return patch_;
134  }
135 
136  //- Generate face or point values on patch?
137  bool faceValues() const
138  {
139  return faceValues_;
140  }
141 
142  //- Number of faces or points on the patch
143  label size() const
144  {
145  return (faceValues_ ? patch_.size() : patch_.nPoints());
146  }
147 
148 
149  // Manipulation
150 
151  //- Convert time
152  virtual void convertTimeBase(const Time&);
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
Foam::patchFunction1Base::name
const word & name() const
The name of the entry.
Definition: patchFunction1Base.H:124
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::patchFunction1Base::patchFunction1Base
patchFunction1Base(const polyPatch &pp, const word &entryName, const bool faceValues=true)
Construct from polyPatch and entry name.
Definition: patchFunction1Base.C:35
polyPatch.H
Foam::refCount
Reference counter for various OpenFOAM components.
Definition: refCount.H:50
Foam::patchFunction1Base::operator=
void operator=(const patchFunction1Base &)=delete
No copy assignment.
Foam::patchFunction1Base::patch
const polyPatch & patch() const
Reference to the patch.
Definition: patchFunction1Base.H:130
Foam::patchFunction1Base::size
label size() const
Number of faces or points on the patch.
Definition: patchFunction1Base.H:142
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::patchFunction1Base::~patchFunction1Base
virtual ~patchFunction1Base()=default
Destructor.
Foam::patchFunction1Base::faceValues
bool faceValues() const
Generate face or point values on patch?
Definition: patchFunction1Base.H:136
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::PrimitivePatch::nPoints
label nPoints() const
Return number of points supporting patch faces.
Definition: PrimitivePatch.H:316
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::patchFunction1Base::patch_
const polyPatch & patch_
Reference to the patch.
Definition: patchFunction1Base.H:71
Foam::patchFunction1Base::faceValues_
const bool faceValues_
Generate face or point values on patch.
Definition: patchFunction1Base.H:74
Foam::patchFunction1Base::convertTimeBase
virtual void convertTimeBase(const Time &)
Convert time.
Definition: patchFunction1Base.C:84
dictionary.H
Foam::patchFunction1Base
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Definition: patchFunction1Base.H:59
Foam::patchFunction1Base::name_
const word name_
Name of entry.
Definition: patchFunction1Base.H:68