42#ifndef Foam_VectorSpace_H
43#define Foam_VectorSpace_H
57template<
class Form,
class Cmpt, direction Ncmpts>
class VectorSpace;
59template<
class Form,
class Cmpt, direction Ncmpts>
66template<
class Form,
class Cmpt, direction Ncmpts>
78template<
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);
200 template<
class SubVector, direction BStart>
201 inline const ConstBlock<SubVector, BStart>
block()
const;
214 template<
class Form2,
class Cmpt2>
254 friend Istream&
operator>> <Form, Cmpt, Ncmpts>
271template<
class Form,
class Cmpt, direction Ncmpts>
283 #include "VectorSpace.txx"
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,...
ConstBlock(const vsType &vs)
Construct for a given vector.
static const direction nComponents
Number of components in this vector space.
const Cmpt & operator[](const direction i) const
[i] const element access operator
static constexpr direction nCols
static const char *const componentNames[]
void operator=(Foam::zero)
VectorSpace(Istream &is)
Construct from Istream.
VectorSpace(Foam::zero)
Construct initialized to zero.
void fill(const Cmpt &s)
Assign all components to given value.
const_iterator begin() const noexcept
Return const_iterator (const pointer) to begin of VectorSpace.
static const Vector< scalar > zero
const Cmpt & component(const direction) const
Cmpt * data() noexcept
Return pointer to the first data element.
static const Vector< scalar > one
void operator=(const VectorSpace< Form, Cmpt, Ncmpts > &)
Cmpt & component(const direction)
void replace(const direction, const Cmpt &)
static const Vector< scalar > max
const_iterator end() const noexcept
Return const_iterator (const pointer) to end of VectorSpace.
const ConstBlock< SubVector, BStart > block() const
VectorSpace(const VectorSpace< Form2, Cmpt2, Ncmpts > &)
Copy construct of a VectorSpace with the same size.
static constexpr direction nComponents
static constexpr direction size() noexcept
The number of elements in the VectorSpace = Ncmpts.
VectorSpace(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
Copy construct.
static constexpr direction dim
void component(Cmpt &, const direction) const
const Cmpt * cdata() const noexcept
Return const pointer to the first data element.
void operator/=(const scalar)
iterator begin() noexcept
Return an iterator (pointer) to begin of VectorSpace.
const_iterator cend() const noexcept
Return const_iterator (const pointer) to end of VectorSpace.
static constexpr direction mRows
VectorSpace< Vector< scalar >, scalar, Ncmpts > vsType
void operator+=(const VectorSpace< Form, Cmpt, Ncmpts > &)
const Cmpt & operator[](const direction) const
void operator=(const VectorSpace< Form2, Cmpt2, Ncmpts > &)
Copy assign from a VectorSpace with the same size.
void operator-=(const VectorSpace< Form, Cmpt, Ncmpts > &)
const_iterator cbegin() const noexcept
Return const_iterator (const pointer) to begin of VectorSpace.
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
static const Vector< scalar > rootMin
static const Vector< scalar > rootMax
friend Ostream & operator(Ostream &, const VectorSpace< Form, Cmpt, Ncmpts > &)
VectorSpace()=default
Default construct.
static const Vector< scalar > min
const scalar * const_iterator
void operator*=(const scalar)
Cmpt & operator[](const direction)
static const char *const typeName
iterator end() noexcept
Return an iterator (pointer) to end of VectorSpace.
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 ...
Direction is an 8-bit unsigned integer type used to represent Cartesian directions,...
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))