UniformField.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) 2013 OpenFOAM Foundation
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::UniformField
28 
29 Description
30  A class representing the concept of a uniform field which stores only
31  the single value and providing the operator[] to return it.
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef UniformField_H
36 #define UniformField_H
37 
38 #include "label.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class UniformField Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class Type>
50 class UniformField
51 {
52  // Private data
53 
54  Type value_;
55 
56 public:
57 
58  // Constructors
59 
60  //- Construct given value
61  inline UniformField(const Type& value);
62 
63 
64  // Member Operators
65 
66 
67  inline operator Type() const;
68 
69  inline Type operator[](const label) const;
70 
71  inline UniformField field() const;
72 };
73 
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 } // End namespace Foam
78 
79 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80 
81 #include "UniformFieldI.H"
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 #endif
86 
87 // ************************************************************************* //
Foam::UniformField::UniformField
UniformField(const Type &value)
Construct given value.
Definition: UniformFieldI.H:33
Foam::UniformField::operator[]
Type operator[](const label) const
Definition: UniformFieldI.H:47
Foam::UniformField
A class representing the concept of a uniform field which stores only the single value and providing ...
Definition: UniformField.H:49
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
UniformFieldI.H
Foam::UniformField::field
UniformField field() const
Definition: UniformFieldI.H:54
label.H