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