39 #ifndef Foam_primitives_complex_H 40 #define Foam_primitives_complex_H 115 inline complex(
const std::complex<float>&
c);
118 inline complex(
const std::complex<double>&
c);
151 inline scalar
magSqr()
const;
162 return std::complex<scalar>(re, im);
233 struct pTraits_cmptType<
complex> {
typedef scalar
type; };
237 struct pTraits_nComponents<
complex>
239 std::integral_constant<Foam::direction, 2>
257 typedef scalar magType;
260 typedef label labelType;
277 static const char*
const typeName;
278 static const char*
const componentNames[];
323 typename std::enable_if
325 !std::is_same<complex, T>::value,
334 typename std::enable_if
336 std::is_same<complex, T>::value,
340 return val.conjugate();
std::enable_if< !std::is_same< complex, T >::value, const T &>::type conj(const T &val)
The 'conjugate' of non-complex returns itself (pass-through) it does not return a complex! ...
void operator/=(const complex &c)
bitSet operator~(const bitSet &bitset)
Bitset complement, returns a copy of the bitset with all its bits flipped.
bool operator!=(const complex &c) const
friend complex operator/(const complex &c1, const complex &c2)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
const dimensionedScalar c2
Second radiation constant: default SI units: [m.K].
void operator+=(const complex &c)
constexpr scalar imag() const noexcept
Imaginary part of complex number - STL naming.
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
friend complex operator+(const complex &c1, const complex &c2)
pTraits(const Base &obj)
Copy construct from base class.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
friend complex operator*(const complex &c1, const complex &c2)
complex & operator=(const complex &) noexcept=default
Copy assignment.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
tmp< faMatrix< Type > > operator*(const areaScalarField::Internal &, const faMatrix< Type > &)
A class for handling words, derived from Foam::string.
Istream & operator>>(Istream &, directionInfo &)
void operator*=(const complex &c)
scalar Im() const noexcept
Get imaginary part of complex number. Same as imag()
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
void operator-=(const complex &c)
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Unary negation.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
scalar Re() const noexcept
Get real part of complex number. Same as real()
OBJstream os(runTime.globalPath()/outputName)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
complex conjugate() const
Complex conjugate.
scalar magSqr() const
The L2-norm squared of complex.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
constexpr complex() noexcept
Default construct, as zero-initialized.
scalar cmptSum() const noexcept
The sum of real/imag components.
A template class to specify if a data type is composed solely of Foam::scalar elements.
scalar magnitude() const
The magnitude (L2-norm) of complex. Called magnitude() instead mag(), which looks too much like imag(...
friend complex operator-(const complex &c)
A template class to specify that a data type can be considered as being contiguous in memory...
const dimensionedScalar c
Speed of light in a vacuum.
const dimensionedScalar c1
First radiation constant: default SI units: [W/m2].
::Foam::direction rank(const expressions::valueTypeCode) noexcept
The vector-space rank associated with given valueTypeCode.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
A complex number, similar to the C++ complex type.
constexpr scalar real() const noexcept
Real part of complex number - STL naming.
bool operator==(const complex &c) const
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))
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...