geometricZeroField.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-2017 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::geometricZeroField
29 
30 Description
31  A class representing the concept of a GeometricField of 0 used to avoid
32  unnecessary manipulations for objects which are known to be zero 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 Foam_geometricZeroField_H
41 #define Foam_geometricZeroField_H
42 
43 #include "zeroFieldField.H"
44 #include "dimensionSet.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class geometricZeroField Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 :
57  public zero
58 {
59 public:
60 
61  // Public Typedefs
62 
63  typedef zeroField Internal;
64  typedef zeroField Patch;
65  typedef zeroFieldField Boundary;
66  typedef zero cmptType;
67 
68 
69  // Constructors
70 
71  //- Default construct
73 
74 
75  // Member Functions
76 
78  {
79  return dimless;
80  }
81 
83  {
84  return zeroField{};
85  }
86 
88  {
89  return zeroField{};
90  }
91 
93  {
94  return Internal{};
95  }
96 
98  {
99  return zeroField{};
100  }
101 
103  {
104  return Boundary{};
105  }
106 
107  // Same as internalField()
108  Internal v() const noexcept
109  {
110  return Internal{};
111  }
112 
113 
114  // Member Operators
115 
116  scalar operator[](const label) const noexcept
117  {
118  return 0;
119  }
120 
122  {
123  return Internal{};
124  }
125 };
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 } // End namespace Foam
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 // Global Operators
135 
136 #include "geometricZeroFieldI.H"
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
Boundary boundaryField() const noexcept
A class representing the concept of a field of zeroFields used to avoid unnecessary manipulations for...
zeroField field() const noexcept
const dimensionSet dimless
Dimensionless.
const dimensionSet & dimensions() const noexcept
geometricZeroField() noexcept=default
Default construct.
Internal internalField() const noexcept
Internal v() const noexcept
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:105
A class representing the concept of a field of 0 used to avoid unnecessary manipulations for objects ...
Definition: zeroField.H:47
zeroField primitiveField() const noexcept
const direction noexcept
Definition: Scalar.H:258
zeroField oldTime() const noexcept
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:57
scalar operator[](const label) const noexcept
A class representing the concept of a GeometricField of 0 used to avoid unnecessary manipulations for...
Internal operator()() const noexcept
Namespace for OpenFOAM.