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. More...
Public Types | |
enum | components { X, Y, Z } |
Component labeling enumeration. More... | |
typedef Vector< label > | labelType |
Equivalent type of labels used for valid component indexing. More... | |
Public Types inherited from VectorSpace< Vector< Cmpt >, Cmpt, 3 > | |
typedef VectorSpace< Vector< 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... | |
typedef const Cmpt * | const_iterator |
Random access iterator for traversing VectorSpace. More... | |
Public Member Functions | |
Vector ()=default | |
Default construct. More... | |
Vector (const Vector &)=default | |
Copy construct. More... | |
Vector & | operator= (const Vector &)=default |
Copy assignment. More... | |
Vector (const Foam::zero) | |
Construct initialized to zero. More... | |
template<class Cmpt2 > | |
Vector (const VectorSpace< Vector< Cmpt2 >, Cmpt2, 3 > &vs) | |
Copy construct from VectorSpace of the same rank. More... | |
Vector (const Cmpt &vx, const Cmpt &vy, const Cmpt &vz) | |
Construct from three components. More... | |
Vector (Istream &is) | |
Construct from Istream. More... | |
const Cmpt & | x () const noexcept |
Access to the vector x component. More... | |
const Cmpt & | y () const noexcept |
Access to the vector y component. More... | |
const Cmpt & | z () const noexcept |
Access to the vector z component. More... | |
Cmpt & | x () noexcept |
Access to the vector x component. More... | |
Cmpt & | y () noexcept |
Access to the vector y component. More... | |
Cmpt & | z () noexcept |
Access to the vector z component. More... | |
const Vector< Cmpt > & | centre (const Foam::UList< Vector< Cmpt >> &) const noexcept |
Return this (for point which is a typedef to Vector<scalar>) More... | |
scalar | mag () const |
The length (L2-norm) of the vector. More... | |
scalar | magSqr () const |
The length (L2-norm) squared of the vector. More... | |
scalar | dist (const Vector< Cmpt > &v2) const |
The L2-norm distance from another vector. The mag() of the difference. More... | |
scalar | distSqr (const Vector< Cmpt > &v2) const |
The L2-norm distance squared from another vector. The magSqr() of the difference. More... | |
Vector< Cmpt > & | normalise (const scalar tol=ROOTVSMALL) |
Inplace normalise the vector by its magnitude. More... | |
Vector< Cmpt > & | removeCollinear (const Vector< Cmpt > &unitVec) |
Inplace removal of components that are collinear to the given unit vector. More... | |
Cmpt | inner (const Vector< Cmpt > &v2) const |
Scalar-product of this with another Vector. More... | |
Vector< Cmpt > | cross (const Vector< Cmpt > &v2) const |
Cross-product of this with another Vector. More... | |
Public Member Functions inherited from VectorSpace< Vector< Cmpt >, Cmpt, 3 > | |
VectorSpace ()=default | |
Default construct. More... | |
VectorSpace (const Foam::zero) | |
Construct initialized to zero. More... | |
VectorSpace (const VectorSpace< Vector< 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< Vector< Cmpt >, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > | block () const |
const Cmpt & | operator[] (const direction) const |
Cmpt & | operator[] (const direction) |
void | operator= (const VectorSpace< Vector< Cmpt >, Cmpt, Ncmpts > &) |
void | operator= (const Foam::zero) |
void | operator+= (const VectorSpace< Vector< Cmpt >, Cmpt, Ncmpts > &) |
void | operator-= (const VectorSpace< Vector< Cmpt >, Cmpt, Ncmpts > &) |
void | operator*= (const scalar) |
void | operator/= (const scalar) |
iterator | begin () noexcept |
Return an iterator to begin of VectorSpace. More... | |
const_iterator | begin () const noexcept |
Return const_iterator to begin of VectorSpace. More... | |
iterator | end () noexcept |
Return an iterator to end of VectorSpace. More... | |
const_iterator | end () const noexcept |
Return const_iterator to end of VectorSpace. More... | |
const_iterator | cbegin () const noexcept |
Return const_iterator to begin of VectorSpace. More... | |
const_iterator | cend () const noexcept |
Return const_iterator to end of VectorSpace. More... | |
Static Public Member Functions | |
static bool | less_xyz (const Vector< Cmpt > &a, const Vector< Cmpt > &b) |
Lexicographically compare a and b with order (x:y:z) More... | |
static bool | less_yzx (const Vector< Cmpt > &a, const Vector< Cmpt > &b) |
Lexicographically compare a and b with order (y:z:x) More... | |
static bool | less_zxy (const Vector< Cmpt > &a, const Vector< Cmpt > &b) |
Lexicographically compare a and b with order (z:x:y) More... | |
Static Public Member Functions inherited from VectorSpace< Vector< Cmpt >, Cmpt, 3 > | |
static constexpr direction | size () noexcept |
The number of elements in the VectorSpace = Ncmpts. More... | |
static Vector< Cmpt > | uniform (const Cmpt &s) |
Return a VectorSpace with all elements = s. More... | |
Static Public Attributes | |
static constexpr direction | rank = 1 |
Rank of Vector is 1. More... | |
Static Public Attributes inherited from VectorSpace< Vector< Cmpt >, Cmpt, 3 > | |
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 Vector< Cmpt > | zero |
static const Vector< Cmpt > | one |
static const Vector< Cmpt > | max |
static const Vector< Cmpt > | min |
static const Vector< Cmpt > | rootMax |
static const Vector< Cmpt > | rootMin |
Additional Inherited Members | |
Public Attributes inherited from VectorSpace< Vector< Cmpt >, Cmpt, 3 > | |
Cmpt | v_ [Ncmpts] |
The components of this vector space. More... | |
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.
A centre() member function which returns the Vector for which it is called is defined so that point which is a typedef to Vector<scalar> behaves as other shapes in the shape hierarchy.
enum components |
|
default |
Default construct.
|
inline |
|
inline |
Copy construct from VectorSpace of the same rank.
|
inline |
|
inlinenoexcept |
Access to the vector x component.
Definition at line 135 of file Vector.H.
Referenced by SymmTensor< scalar >::addDiag(), Tensor< scalar >::addDiag(), BarycentricTensor< Cmpt >::BarycentricTensor(), blockDescriptor::blockDescriptor(), PDRblock::blockMeshDict(), PDRblock::C(), energySpectrum::calcAndWriteSpectrum(), ijkAddressing::checkIndex(), Tensor< scalar >::col(), Tensor< scalar >::cols(), Vector< Foam::List< scalar > >::cross(), volumetricBSplinesDesignVariables::dCdb(), volBSplinesBase::decomposeDV(), SymmTensor< scalar >::diag(), Tensor< scalar >::diag(), Vector< Foam::List< scalar > >::distSqr(), volumetricBSplinesDesignVariables::dndb(), volumetricBSplinesDesignVariables::dSdb(), PDRblock::dx(), volumetricBSplinesDesignVariables::dxdbFace(), volumetricBSplinesDesignVariables::dxdbVol(), Foam::eigenVector(), Foam::eigenVectors(), Foam::faceNij(), Foam::facePoint(), Foam::facePointN(), PDRblock::grid(), ijkAddressing::index(), voxelMeshSearch::index(), voxelMeshSearch::index3(), Vector< Foam::List< scalar > >::inner(), cellShapeControlMesh::insert(), Foam::lerp(), Vector< Foam::List< scalar > >::less_xyz(), Vector< Foam::List< scalar > >::less_yzx(), Vector< Foam::List< scalar > >::less_zxy(), Field< Foam::vector >::normalise(), voxelMeshSearch::offset(), Foam::operator &(), Foam::operator*(), Foam::operator/(), Foam::operator^(), ijkMesh::pointLabel(), projectFace::project(), PDRblock::reset(), IjkField< Foam::vector >::resize(), SymmTensor< scalar >::row(), Tensor< scalar >::row(), Tensor< scalar >::rows(), SpatialVector< scalar >::SpatialVector(), Foam::sqr(), SymmTensor< scalar >::subtractDiag(), Tensor< scalar >::subtractDiag(), PDRblock::V(), and ijkMesh::vertLabels().
|
inlinenoexcept |
Access to the vector y component.
Definition at line 140 of file Vector.H.
Referenced by SymmTensor< scalar >::addDiag(), Tensor< scalar >::addDiag(), BarycentricTensor< Cmpt >::BarycentricTensor(), blockDescriptor::blockDescriptor(), PDRblock::blockMeshDict(), PDRblock::C(), energySpectrum::calcAndWriteSpectrum(), ijkAddressing::checkIndex(), Tensor< scalar >::col(), Tensor< scalar >::cols(), Vector< Foam::List< scalar > >::cross(), volumetricBSplinesDesignVariables::dCdb(), volBSplinesBase::decomposeDV(), SymmTensor< scalar >::diag(), Tensor< scalar >::diag(), Vector< Foam::List< scalar > >::distSqr(), volumetricBSplinesDesignVariables::dndb(), volumetricBSplinesDesignVariables::dSdb(), volumetricBSplinesDesignVariables::dxdbFace(), volumetricBSplinesDesignVariables::dxdbVol(), PDRblock::dy(), Foam::eigenVector(), Foam::eigenVectors(), Foam::faceNij(), Foam::facePoint(), Foam::facePointN(), PDRblock::grid(), ijkAddressing::index(), voxelMeshSearch::index(), voxelMeshSearch::index3(), Vector< Foam::List< scalar > >::inner(), cellShapeControlMesh::insert(), Foam::lerp(), Vector< Foam::List< scalar > >::less_xyz(), Vector< Foam::List< scalar > >::less_yzx(), Vector< Foam::List< scalar > >::less_zxy(), Field< Foam::vector >::normalise(), voxelMeshSearch::offset(), Foam::operator &(), Foam::operator*(), Foam::operator/(), Foam::operator^(), ijkMesh::pointLabel(), projectFace::project(), PDRblock::reset(), IjkField< Foam::vector >::resize(), SymmTensor< scalar >::row(), Tensor< scalar >::row(), Tensor< scalar >::rows(), SpatialVector< scalar >::SpatialVector(), Foam::sqr(), SymmTensor< scalar >::subtractDiag(), Tensor< scalar >::subtractDiag(), PDRblock::V(), and ijkMesh::vertLabels().
|
inlinenoexcept |
Access to the vector z component.
Definition at line 145 of file Vector.H.
Referenced by SymmTensor< scalar >::addDiag(), Tensor< scalar >::addDiag(), BarycentricTensor< Cmpt >::BarycentricTensor(), blockDescriptor::blockDescriptor(), PDRblock::blockMeshDict(), PDRblock::C(), energySpectrum::calcAndWriteSpectrum(), ijkAddressing::checkIndex(), Tensor< scalar >::col(), Tensor< scalar >::cols(), Vector< Foam::List< scalar > >::cross(), volumetricBSplinesDesignVariables::dCdb(), volBSplinesBase::decomposeDV(), SymmTensor< scalar >::diag(), Tensor< scalar >::diag(), Vector< Foam::List< scalar > >::distSqr(), volumetricBSplinesDesignVariables::dndb(), volumetricBSplinesDesignVariables::dSdb(), volumetricBSplinesDesignVariables::dxdbFace(), volumetricBSplinesDesignVariables::dxdbVol(), PDRblock::dz(), Foam::eigenVector(), Foam::eigenVectors(), Foam::faceNij(), Foam::facePoint(), Foam::facePointN(), PDRblock::grid(), ijkAddressing::index(), voxelMeshSearch::index(), voxelMeshSearch::index3(), Vector< Foam::List< scalar > >::inner(), cellShapeControlMesh::insert(), Foam::lerp(), Vector< Foam::List< scalar > >::less_xyz(), Vector< Foam::List< scalar > >::less_yzx(), Vector< Foam::List< scalar > >::less_zxy(), Field< Foam::vector >::normalise(), Foam::operator &(), Foam::operator*(), Foam::operator/(), Foam::operator^(), ijkMesh::pointLabel(), projectFace::project(), PDRblock::reset(), IjkField< Foam::vector >::resize(), SymmTensor< scalar >::row(), Tensor< scalar >::row(), SymmTensor< scalar >::rows(), Tensor< scalar >::rows(), SpatialVector< scalar >::SpatialVector(), Foam::sqr(), SymmTensor< scalar >::subtractDiag(), Tensor< scalar >::subtractDiag(), PDRblock::V(), and ijkMesh::vertLabels().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Scalar-product of this
with another Vector.
Definition at line 146 of file VectorI.H.
Referenced by Foam::operator &().
|
inline |
Cross-product of this
with another Vector.
Definition at line 156 of file VectorI.H.
Referenced by Foam::operator^().