49 const UList<scalar>& realValues,
50 const UList<scalar>& imagValues
53 const label len = result.size();
56 if (len != realValues.size() || len != imagValues.size())
59 <<
"Components sizes do not match: " << len <<
" ("
60 << realValues.size() <<
' ' << imagValues.size() <<
')' << nl
65 for (label i=0; i < len; ++i)
67 result[i].real(realValues[i]);
68 result[i].imag(imagValues[i]);
76 const UList<scalar>& realValues,
77 const scalar imagValue
80 const label len = result.size();
83 if (len != realValues.size())
86 <<
"Components sizes do not match: " << len
87 <<
" != " << realValues.size() <<
nl
92 for (label i=0; i < len; ++i)
94 result[i].real(realValues[i]);
95 result[i].imag(imagValue);
102 complexField& result,
103 const scalar realValue,
104 const UList<scalar>& imagValues
107 const label len = result.size();
110 if (len != imagValues.size())
113 <<
"Components sizes do not match: " << len
114 <<
" != " << imagValues.size() <<
nl
115 <<
abort(FatalError);
119 for (label i=0; i < len; ++i)
121 result[i].real(realValue);
122 result[i].imag(imagValues[i]);
129 const UList<complex>& input,
130 scalarField& realValues,
131 scalarField& imagValues
134 const label len = input.size();
137 if (len != realValues.size() || len != imagValues.size())
140 <<
"Components sizes do not match: " << len <<
" ("
141 << realValues.size() <<
' ' << imagValues.size() <<
')' <<
nl
142 <<
abort(FatalError);
146 for (label i=0; i < len; ++i)
148 realValues[i] = input[i].real();
149 imagValues[i] = input[i].imag();
158 const UList<scalar>& realValues,
159 const UList<scalar>& imagValues
164 Foam::zip(result, realValues, imagValues);
172 const UList<scalar>& realValues,
173 const scalar imagValue
176 complexField result(realValues.size());
178 Foam::zip(result, realValues, imagValue);
186 const scalar realValue,
187 const UList<scalar>& imagValues
190 complexField result(imagValues.size());
192 Foam::zip(result, realValue, imagValues);
200 scalarField result(cmplx.size());
216 scalarField result(cmplx.size());
232 scalarField result(cmplx.size());
239 [](
const complex& c) { return c.imag(); }
#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)
#define TFOR_ALL_S_OP_F_OP_F(typeS, s, OP1, typeF1, f1, OP2, typeF2, f2)
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 complex number, similar to the C++ complex type.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
scalarField ReImSum(const UList< complex > &cmplx)
Sum real and imag components.
dimensionedScalar pow6(const dimensionedScalar &ds)
dimensionedScalar pow5(const dimensionedScalar &ds)
dimensionedScalar asin(const dimensionedScalar &ds)
dimensionedScalar exp(const dimensionedScalar &ds)
dimensionedScalar tan(const dimensionedScalar &ds)
scalarField Im(const UList< complex > &cmplx)
Extract imag component.
void subtract(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
dimensionedScalar pow3(const dimensionedScalar &ds)
dimensionedScalar cosh(const dimensionedScalar &ds)
dimensionedScalar sin(const dimensionedScalar &ds)
dimensionedScalar tanh(const dimensionedScalar &ds)
dimensionedScalar sinh(const dimensionedScalar &ds)
void divide(DimensionedField< Type, GeoMesh > &result, const DimensionedField< Type, GeoMesh > &f1, const DimensionedField< scalar, GeoMesh > &f2)
dimensionedScalar log10(const dimensionedScalar &ds)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar log(const dimensionedScalar &ds)
dimensionedScalar acosh(const dimensionedScalar &ds)
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
dimensionedScalar sqrt(const dimensionedScalar &ds)
complex sumProd(const UList< complex > &f1, const UList< complex > &f2)
Sum product.
Field< complex > complexField
Specialisation of Field<T> for complex.
dimensionedScalar pow4(const dimensionedScalar &ds)
errorManip< error > abort(error &err)
dimensionedScalar atanh(const dimensionedScalar &ds)
scalarField Re(const UList< complex > &cmplx)
Extract real component.
void unzip(const FieldField< Field, SphericalTensor< Cmpt > > &input, FieldField< Field, Cmpt > &ii)
Unzip sphericalTensor field field into components.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
dimensionedScalar atan(const dimensionedScalar &ds)
void multiply(DimensionedField< Type, GeoMesh > &result, const DimensionedField< Type, GeoMesh > &f1, const DimensionedField< scalar, GeoMesh > &f2)
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedScalar acos(const dimensionedScalar &ds)
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.
dimensionedScalar pow025(const dimensionedScalar &ds)
constexpr char nl
The newline '\n' character (0x0a).
dimensionedScalar asinh(const dimensionedScalar &ds)
dict add("bounds", meshBb)
#define addCompoundToRunTimeSelectionTable(Type, Tag)
Add compound to selection tables, lookup using typeName.
#define defineCompoundTypeName(Type, UnusedTag)
Define compound using Type for its name.