All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
zeroFieldI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "zeroField.H"
27 
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
30 inline Foam::scalar Foam::zeroField::operator[](const label) const
31 {
32  return scalar(0);
33 }
34 
35 
37 {
38  return zeroField();
39 }
40 
41 
43 {
44  return zeroField();
45 }
46 
47 
49 {
50  return zeroField();
51 }
52 
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 inline const zeroField operator+(const zeroField&, const zeroField&)
62 {
63  return zeroField();
64 }
65 
66 template<class Type>
67 inline const Type& operator+(const Type& t, const zeroField&)
68 {
69  return t;
70 }
71 
72 template<class Type>
73 inline const Type& operator+(const zeroField&, const Type& t)
74 {
75  return t;
76 }
77 
78 inline const zeroField operator-(const zeroField&, const zeroField&)
79 {
80  return zeroField();
81 }
82 
83 template<class Type>
84 inline const Type& operator-(const Type& t, const zeroField&)
85 {
86  return t;
87 }
88 
89 template<class Type>
90 inline Type operator-(const zeroField&, const Type& t)
91 {
92  return -t;
93 }
94 
95 template<class Type>
96 inline zeroField operator*(const Type& t, const zeroField&)
97 {
98  return zeroField();
99 }
100 
101 template<class Type>
102 inline zeroField operator*(const zeroField&, const Type& t)
103 {
104  return zeroField();
105 }
106 
107 template<class Type>
108 inline zeroField operator/(const zeroField&, const Type& t)
109 {
110  return zeroField();
111 }
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 } // End namespace Foam
117 
118 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
zeroField operator()() const
Definition: zeroFieldI.H:42
tmp< fvMatrix< Type > > operator*(const volScalarField::Internal &, const fvMatrix< Type > &)
A class representing the concept of a field of 0 used to avoid unnecessary manipulations for objects ...
Definition: zeroField.H:50
tmp< fvMatrix< Type > > operator+(const fvMatrix< Type > &, const fvMatrix< Type > &)
zeroField field() const
Definition: zeroFieldI.H:36
zeroField()
Construct null.
Definition: zeroField.H:59
zeroField operator-() const
Definition: zeroFieldI.H:48
scalar operator[](const label) const
Definition: zeroFieldI.H:30
Namespace for OpenFOAM.