45 complexVectorField& result,
46 const UList<vector>& realValues,
47 const UList<vector>& imagValues
50 const label len = result.size();
53 if (len != realValues.size() || len != imagValues.size())
56 <<
"Components sizes do not match: " << len <<
" ("
57 << realValues.size() <<
' ' << imagValues.size() <<
')' << nl
62 for (label i=0; i < len; ++i)
64 result[i] =
Foam::zip(realValues[i], imagValues[i]);
71 complexVectorField& result,
72 const UList<vector>& realValues,
76 const label len = result.size();
79 if (len != realValues.size())
82 <<
"Components sizes do not match: " << len <<
" != "
83 << realValues.size() <<
nl
88 for (label i=0; i < len; ++i)
90 result[i] =
Foam::zip(realValues[i], imagValue);
97 complexVectorField& result,
99 const UList<vector>& imagValues
102 const label len = result.size();
105 if (len != imagValues.size())
108 <<
"Components sizes do not match: " << len <<
" != "
109 << imagValues.size() <<
nl
110 <<
abort(FatalError);
114 for (label i=0; i < len; ++i)
116 result[i] =
Foam::zip(realValue, imagValues[i]);
123 const UList<vector>& realValues,
124 const UList<vector>& imagValues
129 Foam::zip(result, realValues, imagValues);
137 const UList<vector>& realValues,
141 complexVectorField result(realValues.size());
143 Foam::zip(result, realValues, imagValue);
152 const UList<vector>& imagValues
155 complexVectorField result(imagValues.size());
157 Foam::zip(result, realValue, imagValues);
165 vectorField result(cmplx.size());
172 [](
const complexVector& c)
174 return vector(c.x().cmptSum(), c.y().cmptSum(), c.z().cmptSum());
184 vectorField result(cmplx.size());
191 [](
const complexVector& c)
193 return vector(c.x().real(), c.y().real(), c.z().real());
203 vectorField result(cmplx.size());
210 [](
const complexVector& c)
212 return vector(c.x().imag(), c.y().imag(), c.z().imag());
222 const UList<vector>& vec,
223 const UList<complexVector>& cmplx
226 const label len = cmplx.size();
229 if (len != vec.size())
232 <<
"Parameter sizes do not match: " << vec.size()
233 <<
" != " << len << nl
234 << abort(FatalError);
240 for (label i=0; i < len; ++i)
242 result[i] = (vec[i] ^ cmplx[i]);
Macros for easy insertion into run-time selection tables.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
iterator begin() noexcept
Return an iterator to begin traversing the UList.
const_iterator cend() const noexcept
Return const_iterator to end traversing the constant UList.
const_iterator cbegin() const noexcept
Return const_iterator to begin traversing the constant UList.
void size(const label n)
Older name for setAddressableSize.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
scalarField ReImSum(const UList< complex > &cmplx)
Sum real and imag components.
scalarField Im(const UList< complex > &cmplx)
Extract imag component.
Field< complexVector > complexVectorField
Specialisation of Field<T> for complexVector.
Vector< complex > complexVector
A Vector of complex values with 'scalar' precision.
errorManip< error > abort(error &err)
Field< vector > vectorField
Specialisation of Field<T> for vector.
scalarField Re(const UList< complex > &cmplx)
Extract real component.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
complexField ComplexField(const UList< scalar > &realValues, const UList< scalar > &imagValues)
Create complex field by zipping two lists of real/imag values.
void zip(FieldField< Field, SphericalTensor< Cmpt > > &result, const FieldField< Field, Cmpt > &ii)
Zip together sphericalTensor field field from components.
constexpr char nl
The newline '\n' character (0x0a).
#define addCompoundToRunTimeSelectionTable(Type, Tag)
Add compound to selection tables, lookup using typeName.
#define defineCompoundTypeName(Type, UnusedTag)
Define compound using Type for its name.