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 -------------------------------------------------------------------------------
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 Typedef
28  Foam::complexField
29 
30 Description
31  Specialisation of Field<T> for complex.
32 
33 SourceFiles
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 
49 namespace Foam
50 {
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
55 
56 // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
57 
58 //- Zip together complex field from components
59 void zip
60 (
61  complexField& result,
62  const UList<scalar>& re,
63  const UList<scalar>& im
64 );
65 
66 //- Unzip complex field into components
67 void 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
89 scalarField Re(const UList<complex>& cf);
90 
91 //- Extract imag component
92 scalarField Im(const UList<complex>& cf);
93 
94 //- Sum real and imag components
96 
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 //- Sum product
101 template<>
102 complex 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 // ************************************************************************* //
void divide(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
dimensionedScalar tanh(const dimensionedScalar &ds)
dimensionedScalar acos(const dimensionedScalar &ds)
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
dimensionedScalar log(const dimensionedScalar &ds)
#define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc)
Field< complex > complexField
Specialisation of Field<T> for complex.
Definition: complexField.H:50
const dimensionedScalar re
Classical electron radius: default SI units: [m].
void zip(FieldField< Field, SphericalTensor< Cmpt >> &result, const FieldField< Field, Cmpt > &ii)
Zip together sphericalTensor field field from components.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensionedScalar pow025(const dimensionedScalar &ds)
complexField ImComplexField(const UList< scalar > &im)
Create complex field from a list of imag (using real == 0)
Definition: complexField.C:125
void subtract(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensionedScalar asin(const dimensionedScalar &ds)
dimensionedScalar pow5(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:98
complex sumProd(const UList< complex > &f1, const UList< complex > &f2)
Sum product.
Definition: complexField.C:184
void unzip(const FieldField< Field, SphericalTensor< Cmpt >> &input, FieldField< Field, Cmpt > &ii)
Unzip sphericalTensor field field into components.
dimensionedScalar acosh(const dimensionedScalar &ds)
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedScalar exp(const dimensionedScalar &ds)
scalarField Im(const UList< complex > &cf)
Extract imag component.
Definition: complexField.C:165
Generic templated field type.
Definition: Field.H:61
dimensionedScalar asinh(const dimensionedScalar &ds)
static Istream & input(Istream &is, IntRange< T > &range)
Definition: IntRanges.C:48
scalarField Re(const UList< complex > &cf)
Extract real component.
Definition: complexField.C:152
dimensionedScalar atanh(const dimensionedScalar &ds)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:99
High performance macro functions for Field<Type> algebra. These expand using either array element acc...
dimensionedScalar sin(const dimensionedScalar &ds)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
scalarField ReImSum(const UList< complex > &cf)
Sum real and imag components.
Definition: complexField.C:139
dimensionedScalar pow3(const dimensionedScalar &ds)
dimensionedScalar sinh(const dimensionedScalar &ds)
dimensionedScalar atan(const dimensionedScalar &ds)
dimensionedScalar pow4(const dimensionedScalar &ds)
dimensionedScalar pow6(const dimensionedScalar &ds)
A complex number, similar to the C++ complex type.
Definition: complex.H:78
complexField ReComplexField(const UList< scalar > &re)
Create complex field from a list of real (using imag == 0)
Definition: complexField.C:111
dimensionedScalar cosh(const dimensionedScalar &ds)
dimensionedScalar tan(const dimensionedScalar &ds)
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
dimensionedScalar log10(const dimensionedScalar &ds)
Namespace for OpenFOAM.