geometricOneField.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) 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::geometricOneField
29 
30 Description
31  A class representing the concept of a GeometricField of 1 used to avoid
32  unnecessary manipulations for objects which are known to be one at
33  compile-time.
34 
35  Used for example as the density argument to a function written for
36  compressible to be used for incompressible flow.
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef geometricOneField_H
41 #define geometricOneField_H
42 
43 #include "oneFieldField.H"
44 #include "dimensionSet.H"
45 #include "scalar.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class geometricOneField Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 :
58  public one
59 {
60 public:
61 
62  // Public Typedefs
63 
64  typedef oneField Internal;
65  typedef oneField Patch;
67  typedef one cmptType;
68 
69 
70  // Constructors
71 
72  //- Default construct
73  geometricOneField() noexcept = default;
74 
75 
76  // Member Functions
77 
78  const dimensionSet& dimensions() const noexcept
79  {
80  return dimless;
81  }
82 
83  oneField field() const noexcept
84  {
85  return oneField{};
86  }
87 
88  oneField oldTime() const noexcept
89  {
90  return oneField{};
91  }
92 
93  Internal internalField() const noexcept
94  {
95  return Internal{};
96  }
97 
98  Internal primitiveField() const noexcept
99  {
100  return Internal{};
101  }
102 
103  Boundary boundaryField() const noexcept
104  {
105  return Boundary{};
106  }
107 
108  // Same as internalField()
109  Internal v() const noexcept
110  {
111  return Internal{};
112  }
113 
114 
115  // Member Operators
116 
117  one operator[](const label) const noexcept
118  {
119  return one{};
120  }
121 
122  Internal operator()() const noexcept
123  {
124  return Internal{};
125  }
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 // Global Operators
136 
137 #include "geometricOneFieldI.H"
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
Foam::geometricOneField::operator()
Internal operator()() const noexcept
Definition: geometricOneField.H:121
Foam::oneFieldField
A class representing the concept of a field of oneFields used to avoid unnecessary manipulations for ...
Definition: oneFieldField.H:53
Foam::geometricOneField::geometricOneField
geometricOneField() noexcept=default
Default construct.
Foam::geometricOneField::oldTime
oneField oldTime() const noexcept
Definition: geometricOneField.H:87
geometricOneFieldI.H
Foam::geometricOneField::Patch
oneField Patch
Definition: geometricOneField.H:64
Foam::geometricOneField
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
Definition: geometricOneField.H:55
Foam::one
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
Definition: one.H:61
Foam::dimensionSet
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:108
Foam::geometricOneField::boundaryField
Boundary boundaryField() const noexcept
Definition: geometricOneField.H:102
Foam::geometricOneField::dimensions
const dimensionSet & dimensions() const noexcept
Definition: geometricOneField.H:77
Foam::geometricOneField::Internal
oneField Internal
Definition: geometricOneField.H:63
Foam::geometricOneField::internalField
Internal internalField() const noexcept
Definition: geometricOneField.H:92
Foam::geometricOneField::primitiveField
Internal primitiveField() const noexcept
Definition: geometricOneField.H:97
Foam::geometricOneField::Boundary
oneFieldField Boundary
Definition: geometricOneField.H:65
dimensionSet.H
Foam::geometricOneField::cmptType
one cmptType
Definition: geometricOneField.H:66
scalar.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::geometricOneField::field
oneField field() const noexcept
Definition: geometricOneField.H:82
Foam::oneField
A class representing the concept of a field of 1 used to avoid unnecessary manipulations for objects ...
Definition: oneField.H:53
Foam::geometricOneField::v
Internal v() const noexcept
Definition: geometricOneField.H:108
oneFieldField.H
Foam::geometricOneField::operator[]
one operator[](const label) const noexcept
Definition: geometricOneField.H:116
Foam::dimless
const dimensionSet dimless
Dimensionless.
Definition: dimensionSets.C:189