complexField.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 OpenFOAM Foundation
9 Copyright (C) 2019 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
27Typedef
28 Foam::complexField
29
30Description
31 Specialisation of Field<T> for complex.
32
33SourceFiles
34 complexField.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef complexField_H
39#define complexField_H
40
41#include "complex.H"
42#include "scalarField.H"
43
44#define TEMPLATE
45#include "FieldFunctionsM.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53
55
56// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
57
58//- Zip together complex field from components
59void zip
60(
61 complexField& result,
62 const UList<scalar>& re,
63 const UList<scalar>& im
64);
65
66//- Unzip complex field into components
67void unzip
68(
69 const UList<complex>& input,
70 scalarField& re,
71 scalarField& im
72);
73
74
75//- Zip up two lists of values into a list of complex
77(
78 const UList<scalar>& re,
79 const UList<scalar>& im
80);
81
82//- Create complex field from a list of real (using imag == 0)
84
85//- Create complex field from a list of imag (using real == 0)
87
88//- Extract real component
90
91//- Extract imag component
93
94//- Sum real and imag components
96
97
98// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99
100//- Sum product
101template<>
102complex sumProd(const UList<complex>& f1, const UList<complex>& f2);
103
104
105// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106
109
112
113
114// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115
137
138// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139
140} // End namespace Foam
141
142// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143
144#include "undefFieldFunctionsM.H"
145
146// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147
148#endif
149
150// ************************************************************************* //
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc)
High performance macro functions for Field<Type> algebra. These expand using either array element acc...
Generic templated field type.
Definition: Field.H:82
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:94
A complex number, similar to the C++ complex type.
Definition: complex.H:83
Namespace for OpenFOAM.
dimensionedScalar pow6(const dimensionedScalar &ds)
dimensionedScalar pow5(const dimensionedScalar &ds)
dimensionedScalar asin(const dimensionedScalar &ds)
dimensionedScalar exp(const dimensionedScalar &ds)
scalarField Re(const UList< complex > &cf)
Extract real component.
Definition: complexField.C:159
dimensionedScalar tan(const dimensionedScalar &ds)
dimensionedScalar pow3(const dimensionedScalar &ds)
static Istream & input(Istream &is, IntRange< T > &range)
Definition: IntRanges.C:55
dimensionedScalar cosh(const dimensionedScalar &ds)
void subtract(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensionedScalar sin(const dimensionedScalar &ds)
dimensionedScalar tanh(const dimensionedScalar &ds)
dimensionedScalar sinh(const dimensionedScalar &ds)
complexField ImComplexField(const UList< scalar > &im)
Create complex field from a list of imag (using real == 0)
Definition: complexField.C:132
dimensionedScalar log10(const dimensionedScalar &ds)
Field< complex > complexField
Specialisation of Field<T> for complex.
Definition: complexField.H:54
dimensionedScalar log(const dimensionedScalar &ds)
dimensionedScalar acosh(const dimensionedScalar &ds)
dimensionedScalar sqrt(const dimensionedScalar &ds)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
complex sumProd(const UList< complex > &f1, const UList< complex > &f2)
Sum product.
Definition: complexField.C:191
complexField ReComplexField(const UList< scalar > &re)
Create complex field from a list of real (using imag == 0)
Definition: complexField.C:118
dimensionedScalar pow4(const dimensionedScalar &ds)
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
dimensionedScalar atanh(const dimensionedScalar &ds)
complexField ComplexField(const UList< scalar > &re, const UList< scalar > &im)
Zip up two lists of values into a list of complex.
Definition: complexField.C:105
void unzip(const FieldField< Field, SphericalTensor< Cmpt > > &input, FieldField< Field, Cmpt > &ii)
Unzip sphericalTensor field field into components.
dimensionedScalar atan(const dimensionedScalar &ds)
void divide(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedScalar acos(const dimensionedScalar &ds)
void zip(FieldField< Field, SphericalTensor< Cmpt > > &result, const FieldField< Field, Cmpt > &ii)
Zip together sphericalTensor field field from components.
scalarField Im(const UList< complex > &cf)
Extract imag component.
Definition: complexField.C:172
dimensionedScalar pow025(const dimensionedScalar &ds)
scalarField ReImSum(const UList< complex > &cf)
Sum real and imag components.
Definition: complexField.C:146
dimensionedScalar asinh(const dimensionedScalar &ds)