oneField.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2019-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::oneField
29 
30 Description
31  A class representing the concept of a field of 1 used to avoid unnecessary
32  manipulations for objects which are known to be one at compile-time.
33 
34  Used for example as the density argument to a function written for
35  compressible to be used for incompressible flow.
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef Foam_oneField_H
40 #define Foam_oneField_H
41 
42 #include "one.H"
43 #include "scalarFwd.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class oneField Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class oneField
55 :
56  public one
57 {
58 public:
59 
60  // Public Typedefs
61 
62  typedef oneField FieldType;
63 
64 
65  // Constructors
66 
67  //- Default construct
68  oneField() noexcept = default;
69 
70 
71  // Member Functions
72 
73  //- Method name compatibility with DimensionedField
74  oneField field() const noexcept
75  {
76  return oneField{};
77  }
78 };
79 
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 } // End namespace Foam
84 
85 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86 
87 // Global Operators
88 
89 #include "oneFieldI.H"
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 #endif
94 
95 // ************************************************************************* //
oneField FieldType
Definition: oneField.H:55
oneField field() const noexcept
Method name compatibility with DimensionedField.
Definition: oneField.H:71
const direction noexcept
Definition: Scalar.H:258
Typedefs for float/double/scalar without requiring scalar.H.
A class representing the concept of a field of 1 used to avoid unnecessary manipulations for objects ...
Definition: oneField.H:47
oneField() noexcept=default
Default construct.
Namespace for OpenFOAM.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
Definition: one.H:56