40 #ifndef Foam_Vector2D_H 41 #define Foam_Vector2D_H 99 inline Vector2D(
const Cmpt& vx,
const Cmpt& vy);
125 inline scalar
mag()
const;
128 inline scalar
magSqr()
const;
154 const scalar tol = 1
e-10
184 struct is_contiguous_label<Vector2D<Cmpt>> : is_contiguous_label<Cmpt> {};
188 struct is_contiguous_scalar<Vector2D<Cmpt>> : is_contiguous_scalar<Cmpt> {};
Vector2D< Cmpt > & removeCollinear(const Vector2D< Cmpt > &unitVec)
Inplace removal of components that are collinear to the given unit vector.
const Cmpt & y() const noexcept
Access to the vector y component.
Vector2D & operator=(const Vector2D &)=default
Copy assignment.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
static bool less_yx(const Vector2D< Cmpt > &a, const Vector2D< Cmpt > &b)
Lexicographically compare a and b with order (y:x)
scalar perp(const Vector2D< Cmpt > &b) const
Perp dot product (dot product with perpendicular vector)
const dimensionedScalar e
Elementary charge.
scalar distSqr(const Vector2D< Cmpt > &v2) const
The L2-norm distance squared from another vector. The magSqr() of the difference. ...
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
scalar dist(const Vector2D< Cmpt > &v2) const
The L2-norm distance from another vector. The mag() of the difference.
scalar magSqr() const
The length (L2-norm) squared of the vector.
Vector2D< Cmpt > & normalise(const scalar tol=ROOTVSMALL)
Normalise the vector by its magnitude.
const Cmpt & x() const noexcept
Access to the vector x component.
scalar mag() const
The length (L2-norm) of the vector.
components
Component labeling enumeration.
static bool less_xy(const Vector2D< Cmpt > &a, const Vector2D< Cmpt > &b)
Lexicographically compare a and b with order (x:y)
bool isClose(const Vector2D< Cmpt > &b, const scalar tol=1e-10) const
Return true if vector is within tol.
A template class to specify that a data type can be considered as being contiguous in memory...
static constexpr direction rank
Rank of Vector2D is 1.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Vector2D()=default
Default construct.
Templated 2D Vector derived from VectorSpace adding construction from 2 components, element access using x() and y() member functions and the inner-product (dot-product).
Vector2D< label > labelType
Equivalent type of labels used for valid component indexing.
Cmpt v_[Ncmpts]
The components of this vector space.