Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
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::complexVectorField
29
30Description
31 Specialisation of Field<T> for complexVector.
32
33SourceFiles
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
47namespace Foam
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
53
54
55// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
56
57//- Zip together complex vector field from real/imag components
58void 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
68void 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
78void 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
112
113//- Extract imag component
115
116//- Sum real and imag components
118
119
120//- Create complexVector field from a list of real (using imag == 0)
121inline 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)
127inline complexVectorField ImComplexField(const UList<vector>& imagValues)
128{
129 return ComplexField(vector::zero, imagValues);
130}
131
132
133// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134
135//- Cross-product
136complexVectorField operator^
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// ************************************************************************* //
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
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:89
static const Form zero
Namespace for OpenFOAM.
scalarField ReImSum(const UList< complex > &cmplx)
Sum real and imag components.
scalarField Im(const UList< complex > &cmplx)
Extract imag component.
complexField ReComplexField(const UList< scalar > &realValues)
Create complex field from a list of real (using imag == 0).
Field< complexVector > complexVectorField
Specialisation of Field<T> for complexVector.
Field< vector > vectorField
Specialisation of Field<T> for vector.
scalarField Re(const UList< complex > &cmplx)
Extract real component.
Vector< scalar > vector
Definition vector.H:57
complexField ComplexField(const UList< scalar > &realValues, const UList< scalar > &imagValues)
Create complex field by zipping two lists of real/imag values.
complexField ImComplexField(const UList< scalar > &imagValues)
Create complex field from a list of imag (using real == 0).
void zip(FieldField< Field, SphericalTensor< Cmpt > > &result, const FieldField< Field, Cmpt > &ii)
Zip together sphericalTensor field field from components.