FreeFOAM The Cross-Platform CFD Toolkit
scalarFieldField.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 | Copyright (C) 1991-2010 OpenCFD Ltd.
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 InClass
25  Foam::scalarFieldField
26 
27 Description
28  Specialisation of FieldField<T> for scalar.
29 
30 SourceFiles
31  scalarFieldField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef scalarFieldField_H
36 #define scalarFieldField_H
37 
38 #include <OpenFOAM/FieldField.H>
39 #include <OpenFOAM/scalar.H>
40 
41 #define TEMPLATE template<template<class> class Field>
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 template<template<class> class Field>
52 void stabilise
53 (
54  FieldField<Field, scalar>& Res,
55  const FieldField<Field, scalar>& sf,
56  const scalar s
57 );
58 
59 template<template<class> class Field>
60 tmp<FieldField<Field, scalar> > stabilise
61 (
62  const FieldField<Field, scalar>&,
63  const scalar s
64 );
65 
66 template<template<class> class Field>
67 tmp<FieldField<Field, scalar> > stabilise
68 (
69  const tmp<FieldField<Field, scalar> >&,
70  const scalar s
71 );
72 
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 BINARY_TYPE_OPERATOR(scalar, scalar, scalar, +, add)
77 BINARY_TYPE_OPERATOR(scalar, scalar, scalar, -, subtract)
78 
79 BINARY_OPERATOR(scalar, scalar, scalar, *, multiply)
80 BINARY_OPERATOR(scalar, scalar, scalar, /, divide)
81 
82 BINARY_TYPE_OPERATOR_SF(scalar, scalar, scalar, /, divide)
83 
84 BINARY_FUNCTION(scalar, scalar, scalar, pow)
85 BINARY_TYPE_FUNCTION(scalar, scalar, scalar, pow)
86 
87 BINARY_FUNCTION(scalar, scalar, scalar, atan2)
88 BINARY_TYPE_FUNCTION(scalar, scalar, scalar, atan2)
89 
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 UNARY_FUNCTION(scalar, scalar, pow3)
94 UNARY_FUNCTION(scalar, scalar, pow4)
95 UNARY_FUNCTION(scalar, scalar, pow5)
96 UNARY_FUNCTION(scalar, scalar, pow6)
97 UNARY_FUNCTION(scalar, scalar, sqrt)
98 UNARY_FUNCTION(scalar, scalar, sign)
99 UNARY_FUNCTION(scalar, scalar, pos)
100 UNARY_FUNCTION(scalar, scalar, neg)
101 UNARY_FUNCTION(scalar, scalar, exp)
102 UNARY_FUNCTION(scalar, scalar, log)
103 UNARY_FUNCTION(scalar, scalar, log10)
104 UNARY_FUNCTION(scalar, scalar, sin)
105 UNARY_FUNCTION(scalar, scalar, cos)
106 UNARY_FUNCTION(scalar, scalar, tan)
107 UNARY_FUNCTION(scalar, scalar, asin)
108 UNARY_FUNCTION(scalar, scalar, acos)
109 UNARY_FUNCTION(scalar, scalar, atan)
110 UNARY_FUNCTION(scalar, scalar, sinh)
111 UNARY_FUNCTION(scalar, scalar, cosh)
112 UNARY_FUNCTION(scalar, scalar, tanh)
113 UNARY_FUNCTION(scalar, scalar, asinh)
114 UNARY_FUNCTION(scalar, scalar, acosh)
115 UNARY_FUNCTION(scalar, scalar, atanh)
116 UNARY_FUNCTION(scalar, scalar, erf)
117 UNARY_FUNCTION(scalar, scalar, erfc)
118 UNARY_FUNCTION(scalar, scalar, lgamma)
119 UNARY_FUNCTION(scalar, scalar, j0)
120 UNARY_FUNCTION(scalar, scalar, j1)
121 UNARY_FUNCTION(scalar, scalar, y0)
122 UNARY_FUNCTION(scalar, scalar, y1)
123 
124 
125 #define BesselFunc(func) \
126 void func \
127 ( \
128  FieldField<Field, scalar>& Res, \
129  const int n, \
130  const FieldField<Field, scalar>& sf \
131 ); \
132 tmp<scalarField> func(const int n, const FieldField<Field, scalar>&); \
133 tmp<scalarField> func(const int n, const tmp<FieldField<Field, scalar> >&);
134 
135 BesselFunc(jn)
136 BesselFunc(yn)
137 
138 #undef BesselFunc
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
148 
149 #ifdef NoRepository
150 # include <OpenFOAM/scalarFieldField.C>
151 #endif
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************ vim: set sw=4 sts=4 et: ************************ //