39#ifndef Foam_primitives_complex_H
40#define Foam_primitives_complex_H
57inline scalar
magSqr(
const complex&);
58inline scalar
mag(
const complex&);
60inline const complex&
min(
const complex&,
const complex&);
61inline const complex&
max(
const complex&,
const complex&);
137 constexpr scalar
real()
const
143 constexpr scalar
imag()
const
149 inline void real(scalar val);
152 inline void imag(scalar val);
158 inline scalar
Re()
const;
161 inline scalar
Im()
const;
182 operator std::complex<scalar>()
const
184 return std::complex<scalar>(re, im);
283 static constexpr direction nComponents = 2;
288 static const char*
const typeName;
289 static const char*
const componentNames[];
340 typename std::enable_if
342 !std::is_same<complex, T>::value,
351 typename std::enable_if
353 std::is_same<complex, T>::value,
357 return val.conjugate();
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A complex number, similar to the C++ complex type.
friend complex operator-(const complex &c)
complex conjugate() const
Complex conjugate.
complex & operator=(complex &&)=default
Move assignment.
friend complex limit(const complex &c1, const complex &c2)
friend const complex & max(const complex &c1, const complex &c2)
complex(const complex &)=default
Copy construct.
complex & operator=(const complex &)=default
Copy assignment.
void operator+=(const complex &c)
friend complex operator+(const complex &c1, const complex &c2)
constexpr scalar imag() const
Imaginary part of complex number - STL naming.
friend const complex & min(const complex &c1, const complex &c2)
friend complex operator*(const complex &c1, const complex &c2)
constexpr complex() noexcept
Default construct, as zero-initialized.
friend complex sqr(const complex &c)
scalar Im() const
Imaginary part of complex number.
void operator-=(const complex &c)
friend scalar csign(const complex &c)
csgn() https://en.wikipedia.org/wiki/Sign_function#Complex_signum
scalar Re() const
Real part of complex number.
void operator*=(const complex &c)
friend complex sign(const complex &c)
sgn() https://en.wikipedia.org/wiki/Sign_function#Complex_signum
bool operator!=(const complex &c) const
friend scalar mag(const complex &c)
void operator/=(const complex &c)
friend complex operator/(const complex &c1, const complex &c2)
constexpr scalar real() const
Real part of complex number - STL naming.
friend scalar magSqr(const complex &c)
bool operator==(const complex &c) const
complex(complex &&)=default
Move construct.
friend const complex & sum(const complex &c)
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
static const char *const typeName
static const complex zero
complex (0,0)
static const complex rootMax
complex (ROOTVGREAT, ROOTVGREAT)
pTraits(const complex &val)
Copy construct from primitive.
static const complex one
complex (1,0)
static const complex min
complex (-VGREAT,-VGREAT)
complex cmptType
Component type.
static const complex max
complex (VGREAT,VGREAT)
scalar magType
Magnitude type.
pTraits(Istream &is)
Read construct from Istream.
label labelType
Equivalent type of labels used for valid component indexing.
static const complex rootMin
complex (-ROOTVGREAT, -ROOTVGREAT)
A traits class, which is primarily used for primitives.
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
std::enable_if<!std::is_same< complex, T >::value, constT & >::type conj(const T &val)
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Unary negation.
bitSet operator~(const bitSet &bitset)
Bitset complement, returns a copy of the bitset with all its bits flipped.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
complex limit(const complex &, const complex &)
tmp< faMatrix< Type > > operator*(const areaScalarField::Internal &, const faMatrix< Type > &)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Istream & operator>>(Istream &, directionInfo &)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
A template class to specify if a data type is composed solely of Foam::scalar elements.
A template class to specify that a data type can be considered as being contiguous in memory.