56 template<
class T>
class List;
109 template<
class Cmpt2>
113 inline Vector(
const Cmpt& vx,
const Cmpt& vy,
const Cmpt& vz);
124 const Cmpt&
x() const
noexcept {
return this->
v_[components::X]; }
130 const Cmpt&
z() const
noexcept {
return this->
v_[components::Z]; }
133 Cmpt&
x()
noexcept {
return this->
v_[components::X]; }
139 Cmpt&
z()
noexcept {
return this->
v_[components::Z]; }
151 inline scalar
mag() const;
154 inline scalar
magSqr() const;
158 inline scalar
dist(const
Vector<Cmpt>& v2) const;
213 template<class Cmpt2>
214 std::enable_if_t<
std::is_convertible_v<Cmpt2, Cmpt>,
void>
223 template<
class Cmpt2>
224 std::enable_if_t<std::is_convertible_v<Cmpt2, Cmpt>,
void>
238 struct is_contiguous<Vector<Cmpt>> : is_contiguous<Cmpt> {};
242 struct is_contiguous_label<Vector<Cmpt>> : is_contiguous_label<Cmpt> {};
246 struct is_contiguous_scalar<Vector<Cmpt>> : is_contiguous_scalar<Cmpt> {};
250 class typeOfRank<Cmpt, 1>
254 typedef Vector<Cmpt>
type;
259 class symmTypeOfRank<Cmpt, 1>
263 typedef Vector<Cmpt>
type;
268 class typeOfSolve<Vector<Cmpt>>
272 typedef Vector<solveScalar>
type;
std::enable_if_t< std::is_convertible_v< Cmpt2, Cmpt >, void > operator-=(const Vector< Cmpt2 > &b)
Subtract compatible vector from this.
static bool less_yzx(const Vector< Cmpt > &a, const Vector< Cmpt > &b)
Lexicographically compare a and b with order (y:z:x)
Vector< label > labelType
Equivalent type of labels used for valid component indexing.
scalar distSqr(const Vector< Cmpt > &v2) const
The L2-norm distance squared from another vector. The magSqr() of the difference. ...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Vector()=default
Default construct.
Cmpt inner(const Vector< Cmpt > &v2) const
Scalar-product of this with another Vector.
const Cmpt & y() const noexcept
Access to the vector y component.
Vector< Cmpt > & normalise(const scalar tol=ROOTVSMALL)
Inplace normalise the vector by its magnitude.
static constexpr direction rank
Rank of Vector is 1.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
static bool less_zxy(const Vector< Cmpt > &a, const Vector< Cmpt > &b)
Lexicographically compare a and b with order (z:x:y)
scalar magSqr() const
The length (L2-norm) squared of the vector.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Templated 3D Vector derived from VectorSpace adding construction from 3 components, element access using x(), y() and z() member functions and the inner-product (dot-product) and cross-product operators.
const Cmpt & x() const noexcept
Access to the vector x component.
const Vector< Cmpt > & centre(const Foam::UList< Vector< Cmpt >> &) const noexcept
Return this (for point which is a typedef to Vector<scalar>)
scalar mag() const
The length (L2-norm) of the vector.
friend Ostream & operator(Ostream &, const VectorSpace< Vector< Cmpt >, Cmpt, Ncmpts > &)
static bool less_xyz(const Vector< Cmpt > &a, const Vector< Cmpt > &b)
Lexicographically compare a and b with order (x:y:z)
const Cmpt & z() const noexcept
Access to the vector z component.
PtrList< volScalarField > & Y
Vector & operator=(const Vector &)=default
Copy assignment.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
components
Component labeling enumeration.
Vector< Cmpt > cross(const Vector< Cmpt > &v2) const
Cross-product of this with another Vector.
Vector< Cmpt > & removeCollinear(const Vector< Cmpt > &unitVec)
Inplace removal of components that are collinear to the given unit vector.
scalar dist(const Vector< Cmpt > &v2) const
The L2-norm distance from another vector. The mag() of the difference.
Cmpt v_[Ncmpts]
The components of this vector space.