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);
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 119 for (label i=0; i < len; ++i)
121 result[i].real(realValue);
122 result[i].imag(imagValues[i]);
129 const UList<complex>&
input,
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 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
172 const UList<scalar>& realValues,
173 const scalar imagValue
186 const scalar realValue,
187 const UList<scalar>& imagValues
192 Foam::zip(result, realValue, imagValues);
239 [](
const complex&
c) {
return c.imag(); }
dimensionedScalar tanh(const dimensionedScalar &ds)
void size(const label n)
Older name for setAddressableSize.
dimensionedScalar acos(const dimensionedScalar &ds)
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
void divide(DimensionedField< Type, GeoMesh > &result, const DimensionedField< Type, GeoMesh > &f1, const DimensionedField< scalar, GeoMesh > &f2)
dimensionedScalar log(const dimensionedScalar &ds)
addCompoundToRunTimeSelectionTable(List< complex >, complexList)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc)
defineCompoundTypeName(List< complex >, complexList)
Field< complex > complexField
Specialisation of Field<T> for complex.
constexpr char nl
The newline '\n' character (0x0a)
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)
scalarField ReImSum(const UList< complex > &cmplx)
Sum real and imag components.
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)
Macros for easy insertion into run-time selection tables.
scalarField Im(const UList< complex > &cmplx)
Extract imag component.
complex sumProd(const UList< complex > &f1, const UList< complex > &f2)
Sum product.
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)
Generic templated field type.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar asinh(const dimensionedScalar &ds)
static Istream & input(Istream &is, IntRange< T > &range)
complexField ComplexField(const UList< scalar > &realValues, const UList< scalar > &imagValues)
Create complex field by zipping two lists of real/imag values.
dimensionedScalar atanh(const dimensionedScalar &ds)
errorManip< error > abort(error &err)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
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)
#define TFOR_ALL_S_OP_F_OP_F(typeS, s, OP1, typeF1, f1, OP2, typeF2, f2)
scalarField Re(const UList< complex > &cmplx)
Extract real component.
dimensionedScalar pow3(const dimensionedScalar &ds)
dimensionedScalar sinh(const dimensionedScalar &ds)
dimensionedScalar atan(const dimensionedScalar &ds)
const dimensionedScalar c
Speed of light in a vacuum.
dimensionedScalar pow4(const dimensionedScalar &ds)
dimensionedScalar pow6(const dimensionedScalar &ds)
A complex number, similar to the C++ complex type.
dimensionedScalar cosh(const dimensionedScalar &ds)
void multiply(DimensionedField< Type, GeoMesh > &result, const DimensionedField< Type, GeoMesh > &f1, const DimensionedField< scalar, GeoMesh > &f2)
dimensionedScalar tan(const dimensionedScalar &ds)
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
dimensionedScalar log10(const dimensionedScalar &ds)