complexVectorField.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-2023 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::complexVectorField
29 
30 Description
31  Specialisation of Field<T> for complexVector.
32 
33 SourceFiles
34  complexVectorField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_complexVectorField_H
39 #define Foam_complexVectorField_H
40 
41 #include "complex.H"
42 #include "complexVector.H"
43 #include "vectorField.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
53 
54 
55 // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
56 
57 //- Zip together complex vector field from real/imag components
58 void zip
59 (
60  complexVectorField& result,
61  const UList<vector>& realValues,
62  const UList<vector>& imagValues
63 );
64 
65 
66 //- Zip together complex vector field from real components
67 //- and constant imag component
68 void zip
69 (
70  complexVectorField& result,
71  const UList<vector>& realValues,
72  const vector& imagValue
73 );
74 
75 
76 //- Zip together complex vector field from constant real component
77 //- and imag components
78 void zip
79 (
80  complexVectorField& result,
81  const vector& realValue,
82  const UList<vector>& imagValues
83 );
84 
85 
86 //- Create complexVector field by zipping two lists of real/imag values
88 (
89  const UList<vector>& realValues,
90  const UList<vector>& imagValues
91 );
92 
93 //- Create complexVector field by zipping a list of real components
94 //- and a constant imag component
96 (
97  const UList<vector>& realValues,
98  const vector& imagValue
99 );
100 
101 //- Create complexVector field by zipping a constant real component
102 //- and a list of imag components
104 (
105  const vector& realValue,
106  const UList<vector>& imagValues
107 );
108 
109 
110 //- Extract real component
111 vectorField Re(const UList<complexVector>& cmplx);
112 
113 //- Extract imag component
114 vectorField Im(const UList<complexVector>& cmplx);
115 
116 //- Sum real and imag components
118 
119 
120 //- Create complexVector field from a list of real (using imag == 0)
121 inline complexVectorField ReComplexField(const UList<vector>& realValues)
122 {
123  return ComplexField(realValues, vector::zero);
124 }
125 
126 //- Create complexVector field from a list of imag (using real == 0)
127 inline complexVectorField ImComplexField(const UList<vector>& imagValues)
128 {
129  return ComplexField(vector::zero, imagValues);
130 }
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 //- Cross-product
136 complexVectorField operator^
137 (
138  const UList<vector>& vec,
139  const UList<complexVector>& cmplx
140 );
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 } // End namespace Foam
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************************************************************* //
Field< complexVector > complexVectorField
Specialisation of Field<T> for complexVector.
void zip(FieldField< Field, SphericalTensor< Cmpt >> &result, const FieldField< Field, Cmpt > &ii)
Zip together sphericalTensor field field from components.
scalarField ReImSum(const UList< complex > &cmplx)
Sum real and imag components.
Definition: complexField.C:191
scalarField Im(const UList< complex > &cmplx)
Extract imag component.
Definition: complexField.C:223
complexField ComplexField(const UList< scalar > &realValues, const UList< scalar > &imagValues)
Create complex field by zipping two lists of real/imag values.
Definition: complexField.C:150
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:105
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
scalarField Re(const UList< complex > &cmplx)
Extract real component.
Definition: complexField.C:207
complexField ReComplexField(const UList< scalar > &realValues)
Create complex field from a list of real (using imag == 0)
Definition: complexField.H:145
complexField ImComplexField(const UList< scalar > &imagValues)
Create complex field from a list of imag (using real == 0)
Definition: complexField.H:153
Namespace for OpenFOAM.