42 #ifndef Foam_VectorSpace_H 43 #define Foam_VectorSpace_H 57 template<
class Form,
class Cmpt, direction Ncmpts>
class VectorSpace;
59 template<
class Form,
class Cmpt, direction Ncmpts>
66 template<
class Form,
class Cmpt, direction Ncmpts>
78 template<
class Form,
class Cmpt, direction Ncmpts>
119 static const Form
zero;
122 static const Form
min;
130 template<
class SubVector, direction BStart>
170 template<
class Form2,
class Cmpt2>
195 inline void fill(
const Cmpt&
s);
198 inline static Form
uniform(
const Cmpt&
s);
200 template<
class SubVector, direction BStart>
201 inline const ConstBlock<SubVector, BStart>
block()
const;
209 inline void operator=(
const VectorSpace<Form, Cmpt, Ncmpts>&);
210 inline void operator+=(
const VectorSpace<Form, Cmpt, Ncmpts>&);
250 friend Istream&
operator>> <Form, Cmpt, Ncmpts>
253 VectorSpace<Form, Cmpt, Ncmpts>&
256 friend Ostream& operator<< <Form, Cmpt, Ncmpts>
259 const VectorSpace<Form, Cmpt, Ncmpts>&
267 template<
class Form,
class Cmpt, direction Ncmpts>
static const char *const typeName
static constexpr direction nCols
static constexpr direction mRows
void operator=(const VectorSpace< Form, Cmpt, Ncmpts > &)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
iterator begin() noexcept
Return an iterator (pointer) to begin of VectorSpace.
static const char *const componentNames[]
static const Form rootMin
Cmpt magType
Magnitude type.
const_iterator cend() const noexcept
Return const_iterator (const pointer) to end of VectorSpace.
ConstBlock(const vsType &vs)
Construct for a given vector.
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
void replace(const direction, const Cmpt &)
void operator-=(const VectorSpace< Form, Cmpt, Ncmpts > &)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
const Cmpt * const_iterator
Random access iterator for traversing VectorSpace.
const_iterator cbegin() const noexcept
Return const_iterator (const pointer) to begin of VectorSpace.
A class for handling words, derived from Foam::string.
void operator+=(const VectorSpace< Form, Cmpt, Ncmpts > &)
VectorSpace()=default
Default construct.
Cmpt * data() noexcept
Return pointer to the first data element.
direction size_type
The type to represent the size of a VectorSpace.
static constexpr direction dim
Dimensionality of space.
const ConstBlock< SubVector, BStart > block() const
static constexpr direction nComponents
Number of components in this vector space.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
friend Ostream & operator(Ostream &, const VectorSpace< Form, Cmpt, Ncmpts > &)
static const Form rootMax
Direction is an 8-bit unsigned integer type used to represent Cartesian directions, components etc.
Cmpt cmptType
Component type.
void fill(const Cmpt &s)
Assign all components to given value.
static constexpr direction size() noexcept
The number of elements in the VectorSpace = Ncmpts.
void operator*=(const scalar)
iterator end() noexcept
Return an iterator (pointer) to end of VectorSpace.
const Cmpt * cdata() const noexcept
Return const pointer to the first data element.
const Cmpt & component(const direction) const
VectorSpace< Form, Cmpt, Ncmpts > vsType
VectorSpace type.
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
void operator/=(const scalar)
Cmpt * iterator
Random access iterator for traversing VectorSpace.
const Cmpt & operator[](const direction) 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))
Cmpt v_[Ncmpts]
The components of this vector space.
static const direction nComponents
Number of components in this vector space.
const Cmpt & operator[](const direction i) const
[i] const element access operator