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). More...
Public Types | |
| enum | components { X, Y } |
| Component labeling enumeration. More... | |
| typedef Vector2D< label > | labelType |
| Equivalent type of labels used for valid component indexing. More... | |
Public Types inherited from VectorSpace< Vector2D< Cmpt >, Cmpt, 2 > | |
| typedef VectorSpace< Vector2D< Cmpt >, Cmpt, Ncmpts > | vsType |
| VectorSpace type. More... | |
| typedef Cmpt | cmptType |
| Component type. More... | |
| typedef Cmpt | magType |
| Magnitude type. More... | |
| typedef Cmpt * | iterator |
| Random access iterator for traversing VectorSpace. More... | |
Public Member Functions | |
| Vector2D ()=default | |
| Default construct. More... | |
| Vector2D (const Vector2D &)=default | |
| Copy construct. More... | |
| Vector2D & | operator= (const Vector2D &)=default |
| Copy assignment. More... | |
| Vector2D (const Foam::zero) | |
| Construct initialized to zero. More... | |
| Vector2D (const VectorSpace< Vector2D< Cmpt >, Cmpt, 2 > &vs) | |
| Copy construct from VectorSpace of the same rank. More... | |
| Vector2D (const Cmpt &vx, const Cmpt &vy) | |
| Construct from two components. More... | |
| Vector2D (Istream &is) | |
| Construct from Istream. More... | |
| const Cmpt & | x () const |
| Access to the vector x component. More... | |
| const Cmpt & | y () const |
| Access to the vector y component. More... | |
| Cmpt & | x () |
| Access to the vector x component. More... | |
| Cmpt & | y () |
| Access to the vector y component. More... | |
| Vector2D< Cmpt > & | normalise () |
| Normalise the vector by its magnitude. More... | |
| scalar | perp (const Vector2D< Cmpt > &b) const |
| Perp dot product (dot product with perpendicular vector) More... | |
Public Member Functions inherited from VectorSpace< Vector2D< Cmpt >, Cmpt, 2 > | |
| VectorSpace ()=default | |
| Default construct. More... | |
| VectorSpace (const Foam::zero) | |
| Construct initialized to zero. More... | |
| VectorSpace (const VectorSpace< Vector2D< Cmpt >, Cmpt, Ncmpts > &vs) | |
| Copy construct. More... | |
| VectorSpace (const VectorSpace< Form2, Cmpt2, Ncmpts > &) | |
| Copy construct of a VectorSpace with the same size. More... | |
| VectorSpace (Istream &is) | |
| Construct from Istream. More... | |
| const Cmpt & | component (const direction) const |
| Cmpt & | component (const direction) |
| void | component (Cmpt &, const direction) const |
| void | replace (const direction, const Cmpt &) |
| const Cmpt * | cdata () const noexcept |
| Return const pointer to the first data element. More... | |
| Cmpt * | data () noexcept |
| Return pointer to the first data element. More... | |
| const ConstBlock< SubVector, BStart > | block () const |
| const Foam::VectorSpace< Vector2D< Cmpt >, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > | block () const |
| const Cmpt & | operator[] (const direction) const |
| Cmpt & | operator[] (const direction) |
| void | operator= (const VectorSpace< Vector2D< Cmpt >, Cmpt, Ncmpts > &) |
| void | operator= (const Foam::zero) |
| void | operator+= (const VectorSpace< Vector2D< Cmpt >, Cmpt, Ncmpts > &) |
| void | operator-= (const VectorSpace< Vector2D< Cmpt >, Cmpt, Ncmpts > &) |
| void | operator*= (const scalar) |
| void | operator/= (const scalar) |
| iterator | begin () |
| Return an iterator to begin of VectorSpace. More... | |
| const_iterator | begin () const |
| Return const_iterator to begin of VectorSpace. More... | |
| iterator | end () |
| Return an iterator to end of VectorSpace. More... | |
| const_iterator | end () const |
| Return const_iterator to end of VectorSpace. More... | |
| const_iterator | cbegin () const |
| Return const_iterator to begin of VectorSpace. More... | |
| const_iterator | cend () const |
| Return const_iterator to end of VectorSpace. More... | |
Static Public Attributes | |
| static constexpr direction | rank = 1 |
| Rank of Vector2D is 1. More... | |
Static Public Attributes inherited from VectorSpace< Vector2D< Cmpt >, Cmpt, 2 > | |
| static constexpr direction | dim |
| Dimensionality of space. More... | |
| static constexpr direction | nComponents |
| Number of components in this vector space. More... | |
| static constexpr direction | mRows |
| static constexpr direction | nCols |
| static const char *const | typeName |
| static const char *const | componentNames [] |
| static const Vector2D< Cmpt > | zero |
| static const Vector2D< Cmpt > | one |
| static const Vector2D< Cmpt > | max |
| static const Vector2D< Cmpt > | min |
| static const Vector2D< Cmpt > | rootMax |
| static const Vector2D< Cmpt > | rootMin |
Additional Inherited Members | |
Static Public Member Functions inherited from VectorSpace< Vector2D< Cmpt >, Cmpt, 2 > | |
| static constexpr direction | size () noexcept |
| The number of elements in the VectorSpace = Ncmpts. More... | |
| static Vector2D< Cmpt > | uniform (const Cmpt &s) |
| Return a VectorSpace with all elements = s. More... | |
Public Attributes inherited from VectorSpace< Vector2D< Cmpt >, Cmpt, 2 > | |
| const typedef Cmpt * | const_iterator |
| Random access iterator for traversing VectorSpace. More... | |
| Cmpt | v_ [Ncmpts] |
| The components of this vector space. More... | |
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).
Definition at line 55 of file Vector2D.H.
Equivalent type of labels used for valid component indexing.
Definition at line 64 of file Vector2D.H.
| enum components |
|
default |
Default construct.
|
inline |
Construct initialized to zero.
Definition at line 32 of file Vector2DI.H.
|
inline |
Copy construct from VectorSpace of the same rank.
Definition at line 40 of file Vector2DI.H.
|
inline |
Construct from two components.
Definition at line 49 of file Vector2DI.H.
Construct from Istream.
Definition at line 57 of file Vector2DI.H.
|
inline |
Access to the vector x component.
Definition at line 66 of file Vector2DI.H.
Referenced by Tensor2D< Cmpt >::col(), SymmTensor2D< Cmpt >::diag(), Tensor2D< Cmpt >::diag(), Foam::eigenVector(), patchMeanVelocityForce::magUbarAve(), Foam::operator&(), Foam::operator*(), Tensor2D< Cmpt >::row(), and Foam::sqr().
|
inline |
Access to the vector y component.
Definition at line 73 of file Vector2DI.H.
Referenced by Tensor2D< Cmpt >::col(), SymmTensor2D< Cmpt >::diag(), Tensor2D< Cmpt >::diag(), Foam::eigenVector(), patchMeanVelocityForce::magUbarAve(), Foam::operator&(), Foam::operator*(), Tensor2D< Cmpt >::row(), and Foam::sqr().
|
inline |
Access to the vector x component.
Definition at line 80 of file Vector2DI.H.
|
inline |
Access to the vector y component.
Definition at line 87 of file Vector2DI.H.
|
inline |
Normalise the vector by its magnitude.
Definition at line 94 of file Vector2DI.H.
|
inline |
Perp dot product (dot product with perpendicular vector)
Definition at line 127 of file Vector2DI.H.
Referenced by line< Point, PointRef >::nearestDist().
|
staticconstexpr |
Rank of Vector2D is 1.
Definition at line 70 of file Vector2D.H.