Vector< Cmpt > Class Template Reference

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...

Inheritance diagram for Vector< Cmpt >:
[legend]
Collaboration diagram for Vector< Cmpt >:
[legend]

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...
 

Public Member Functions

 Vector ()=default
 Default construct. More...
 
 Vector (const Vector &)=default
 Copy construct. More...
 
Vectoroperator= (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
 Access to the vector x component. More...
 
const Cmpt & y () const
 Access to the vector y component. More...
 
const Cmpt & z () const
 Access to the vector z component. More...
 
Cmpt & x ()
 Access to the vector x component. More...
 
Cmpt & y ()
 Access to the vector y component. More...
 
Cmpt & z ()
 Access to the vector z component. More...
 
Vector< Cmpt > & normalise ()
 Normalise the vector by its magnitude. More...
 
const Vector< Cmpt > & centre (const Foam::List< Vector< Cmpt >> &) const
 Return *this (used for point which is a typedef to Vector<scalar>. 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 ()
 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 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

- 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...
 
- Public Attributes inherited from VectorSpace< Vector< Cmpt >, Cmpt, 3 >
const typedef Cmpt * const_iterator
 Random access iterator for traversing VectorSpace. More...
 
Cmpt v_ [Ncmpts]
 The components of this vector space. More...
 

Detailed Description

template<class Cmpt>
class Foam::Vector< Cmpt >

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.

Source files

Definition at line 62 of file Vector.H.

Member Typedef Documentation

◆ labelType

typedef Vector<label> labelType

Equivalent type of labels used for valid component indexing.

Definition at line 71 of file Vector.H.

Member Enumeration Documentation

◆ components

enum components

Component labeling enumeration.

Enumerator

Definition at line 81 of file Vector.H.

Constructor & Destructor Documentation

◆ Vector() [1/6]

Vector ( )
default

Default construct.

◆ Vector() [2/6]

Vector ( const Vector< Cmpt > &  )
default

Copy construct.

◆ Vector() [3/6]

Vector ( const Foam::zero  )
inline

Construct initialized to zero.

Definition at line 32 of file VectorI.H.

◆ Vector() [4/6]

Vector ( const VectorSpace< Vector< Cmpt2 >, Cmpt2, 3 > &  vs)
inline

Copy construct from VectorSpace of the same rank.

Definition at line 41 of file VectorI.H.

◆ Vector() [5/6]

Vector ( const Cmpt &  vx,
const Cmpt &  vy,
const Cmpt &  vz 
)
inline

Construct from three components.

Definition at line 51 of file VectorI.H.

◆ Vector() [6/6]

Vector ( Istream is)
inlineexplicit

Construct from Istream.

Definition at line 64 of file VectorI.H.

Member Function Documentation

◆ operator=()

Vector& operator= ( const Vector< Cmpt > &  )
default

Copy assignment.

Referenced by triad::operator=().

Here is the caller graph for this function:

◆ x() [1/2]

const Cmpt & x ( ) const
inline

Access to the vector x component.

Definition at line 73 of file VectorI.H.

Referenced by biLinearFitPolynomial::addCoeffs(), cubicUpwindFitPolynomial::addCoeffs(), linearFitPolynomial::addCoeffs(), quadraticFitPolynomial::addCoeffs(), quadraticLinearUpwindFitPolynomial::addCoeffs(), quadraticUpwindFitPolynomial::addCoeffs(), quadraticLinearFitPolynomial::addCoeffs(), triad::align(), BarycentricTensor< Cmpt >::BarycentricTensor(), blockDescriptor::blockDescriptor(), PDRblock::blockMeshDict(), NURBS3DVolume::bound(), PDRblock::C(), energySpectrum::calcAndWriteSpectrum(), CentredFitSnGradData< Polynomial >::calcFit(), FitData< CentredFitSnGradData< Polynomial >, extendedCentredCellToFaceStencil, Polynomial >::calcFit(), wedgePolyPatch::calcGeometry(), DarcyForchheimer::calcTransformModelData(), rotorDiskSource::calculate(), ijkAddressing::checkIndex(), Tensor< scalar >::col(), Tensor< scalar >::cols(), axisAligned::computeControlPoints(), transformBox::computeControlPoints(), boundBox::contains(), boundBox::containsInside(), NURBS3DVolume::coordinates(), cyclicPolyPatch::coupledEdges(), cyclicPolyPatch::coupledPoints(), SymmTensor< scalar >::diag(), Tensor< scalar >::diag(), treeBoundBox::distanceCmp(), PDRblock::dx(), Foam::eigenVector(), Foam::eigenVectors(), pitchForkRing::energy(), treeBoundBox::faceBits(), boundBox::faceCentre(), Foam::faceNij(), Foam::facePoint(), Foam::facePointN(), dynamicTreeDataPoint::findNearest(), NURBS3DVolume::findPointsInBox(), pitchForkRing::force(), rigidBodyModel::forwardDynamics(), Foam::fromCartesian(), FIRECore::getFirePoint(), boundaryMesh::getNearest(), ellipsoidImplicitFunction::grad(), PDRblock::grid(), ijkAddressing::index(), voxelMeshSearch::index(), voxelMeshSearch::index3(), waveModel::initialiseGeometry(), waveMakerPointPatchVectorField::initialiseGeometry(), cellShapeControlMesh::insert(), cellShapeControlMesh::insertFar(), treeBoundBox::intersects(), Foam::inv(), NURBS3DVolume::JacobianUVW(), Ryxz::jcalc(), Rxyz::jcalc(), Rzyx::jcalc(), cellMDLimitedGrad< Type >::limitFace(), momentOfInertia::massPropertiesSolid(), boundBox::nearest(), twoDPointCorrector::normalDir(), NURBS3DCurve::nrm2D(), voxelMeshSearch::offset(), Foam::operator&(), treeDataPoint::findNearestOp::operator()(), treeDataEdge::findNearestOp::operator()(), Foam::operator*(), Foam::operator/(), Foam::operator^(), boundBox::overlaps(), plane::planeIntersect(), ijkMesh::pointLabel(), polyTopoChange::pointRemoved(), tetrahedron< Point, PointRef >::pointToBarycentric(), treeBoundBox::posBits(), triad::primaryDirection(), projectFace::project(), FIRECore::putFirePoint(), quaternion::quaternion(), Foam::Ra(), AC3DsurfaceFormat< Face >::read(), IjkField< Foam::Vector< bool > >::resize(), linearSpringDamper::restrain(), Tensor< scalar >::row(), Tensor< scalar >::rows(), treeBoundBox::searchOrder(), NURBS3DCurve::setNrm2DOrientation(), ReactingLookupTableInjection< CloudType >::setPositionAndCell(), ThermoLookupTableInjection< CloudType >::setPositionAndCell(), ReactingMultiphaseLookupTableInjection< CloudType >::setPositionAndCell(), KinematicLookupTableInjection< CloudType >::setPositionAndCell(), SpatialVector< scalar >::SpatialVector(), Foam::sqr(), leastSquares::stencilWeights(), treeBoundBox::subBbox(), treeBoundBox::subOctant(), Foam::toCartesian(), NURBS3DVolumeCylindrical::transformationTensorDxDb(), controlPointsDefinition::transformControlPoints(), NURBS3DVolumeCylindrical::transformPointToCartesian(), Foam::transformPrincipal_vector(), triad::triad(), pointConstraint::unconstrainedDirections(), joint::unitQuaternion(), objectiveForce::update_dxdbMultiplier(), NURBS3DVolumeCylindrical::updateLocalCoordinateSystem(), PDRblock::V(), paraboloidImplicitFunction::value(), ellipsoidImplicitFunction::value(), NURBS3DVolume::volumeDerivativeCP(), wallLayerCells::wallLayerCells(), SMESHsurfaceFormat< Face >::write(), nastranSetWriter< Type >::write(), STLtriangle::write(), OBJstream::write(), sixDoFRigidBodyState::write(), meshToMeshMethod::writeConnectivity(), Foam::meshTools::writeOBJ(), coupledPolyPatch::writeOBJ(), triSurfaceTools::writeOBJ(), cellCuts::writeOBJ(), Foam::writeObjPoints(), moleculeCloud::writeXYZ(), PDRobstacle::x(), Foam::Xinterpolate(), and Foam::XstepForwardsToNextPoint().

◆ y() [1/2]

const Cmpt & y ( ) const
inline

Access to the vector y component.

Definition at line 79 of file VectorI.H.

Referenced by biLinearFitPolynomial::addCoeffs(), cubicUpwindFitPolynomial::addCoeffs(), linearFitPolynomial::addCoeffs(), quadraticFitPolynomial::addCoeffs(), quadraticLinearUpwindFitPolynomial::addCoeffs(), quadraticUpwindFitPolynomial::addCoeffs(), quadraticLinearFitPolynomial::addCoeffs(), triad::align(), BarycentricTensor< Cmpt >::BarycentricTensor(), blockDescriptor::blockDescriptor(), PDRblock::blockMeshDict(), NURBS3DVolume::bound(), PDRblock::C(), energySpectrum::calcAndWriteSpectrum(), CentredFitSnGradData< Polynomial >::calcFit(), FitData< CentredFitSnGradData< Polynomial >, extendedCentredCellToFaceStencil, Polynomial >::calcFit(), wedgePolyPatch::calcGeometry(), DarcyForchheimer::calcTransformModelData(), rotorDiskSource::calculate(), ijkAddressing::checkIndex(), Tensor< scalar >::col(), Tensor< scalar >::cols(), axisAligned::computeControlPoints(), transformBox::computeControlPoints(), boundBox::contains(), boundBox::containsInside(), NURBS3DVolume::coordinates(), cyclicPolyPatch::coupledEdges(), cyclicPolyPatch::coupledPoints(), SymmTensor< scalar >::diag(), Tensor< scalar >::diag(), treeBoundBox::distanceCmp(), PDRblock::dy(), Foam::eigenVector(), Foam::eigenVectors(), pitchForkRing::energy(), treeBoundBox::faceBits(), boundBox::faceCentre(), Foam::faceNij(), Foam::facePoint(), Foam::facePointN(), dynamicTreeDataPoint::findNearest(), NURBS3DVolume::findPointsInBox(), pitchForkRing::force(), rigidBodyModel::forwardDynamics(), Foam::fromCartesian(), FIRECore::getFirePoint(), boundaryMesh::getNearest(), ellipsoidImplicitFunction::grad(), PDRblock::grid(), ijkAddressing::index(), voxelMeshSearch::index(), voxelMeshSearch::index3(), waveModel::initialiseGeometry(), waveMakerPointPatchVectorField::initialiseGeometry(), cellShapeControlMesh::insert(), cellShapeControlMesh::insertFar(), treeBoundBox::intersects(), Foam::inv(), NURBS3DVolume::JacobianUVW(), Rzyx::jcalc(), Ryxz::jcalc(), Rxyz::jcalc(), cellMDLimitedGrad< Type >::limitFace(), momentOfInertia::massPropertiesSolid(), boundBox::nearest(), twoDPointCorrector::normalDir(), NURBS3DCurve::nrm2D(), voxelMeshSearch::offset(), Foam::operator&(), treeDataPoint::findNearestOp::operator()(), treeDataEdge::findNearestOp::operator()(), Foam::operator*(), Foam::operator/(), Foam::operator^(), boundBox::overlaps(), plane::planeIntersect(), ijkMesh::pointLabel(), polyTopoChange::pointRemoved(), tetrahedron< Point, PointRef >::pointToBarycentric(), treeBoundBox::posBits(), triad::primaryDirection(), projectFace::project(), FIRECore::putFirePoint(), quaternion::quaternion(), Foam::Ra(), AC3DsurfaceFormat< Face >::read(), IjkField< Foam::Vector< bool > >::resize(), linearSpringDamper::restrain(), Tensor< scalar >::row(), Tensor< scalar >::rows(), treeBoundBox::searchOrder(), NURBS3DCurve::setNrm2DOrientation(), SpatialVector< scalar >::SpatialVector(), Foam::sqr(), leastSquares::stencilWeights(), treeBoundBox::subBbox(), treeBoundBox::subOctant(), Foam::toCartesian(), NURBS3DVolumeCylindrical::transformationTensorDxDb(), controlPointsDefinition::transformControlPoints(), NURBS3DVolumeCylindrical::transformPointToCartesian(), Foam::transformPrincipal_vector(), triad::triad(), pointConstraint::unconstrainedDirections(), joint::unitQuaternion(), objectiveForce::update_dxdbMultiplier(), NURBS3DVolumeCylindrical::updateLocalCoordinateSystem(), PDRblock::V(), paraboloidImplicitFunction::value(), ellipsoidImplicitFunction::value(), NURBS3DVolume::volumeDerivativeCP(), wallLayerCells::wallLayerCells(), SMESHsurfaceFormat< Face >::write(), nastranSetWriter< Type >::write(), STLtriangle::write(), OBJstream::write(), meshToMeshMethod::writeConnectivity(), Foam::meshTools::writeOBJ(), coupledPolyPatch::writeOBJ(), triSurfaceTools::writeOBJ(), cellCuts::writeOBJ(), Foam::writeObjPoints(), moleculeCloud::writeXYZ(), and PDRobstacle::y().

◆ z() [1/2]

const Cmpt & z ( ) const
inline

Access to the vector z component.

Definition at line 85 of file VectorI.H.

Referenced by biLinearFitPolynomial::addCoeffs(), cubicUpwindFitPolynomial::addCoeffs(), linearFitPolynomial::addCoeffs(), quadraticFitPolynomial::addCoeffs(), quadraticLinearUpwindFitPolynomial::addCoeffs(), quadraticUpwindFitPolynomial::addCoeffs(), quadraticLinearFitPolynomial::addCoeffs(), triad::align(), BarycentricTensor< Cmpt >::BarycentricTensor(), blockDescriptor::blockDescriptor(), PDRblock::blockMeshDict(), NURBS3DVolume::bound(), PDRblock::C(), energySpectrum::calcAndWriteSpectrum(), CentredFitSnGradData< Polynomial >::calcFit(), FitData< CentredFitSnGradData< Polynomial >, extendedCentredCellToFaceStencil, Polynomial >::calcFit(), wedgePolyPatch::calcGeometry(), DarcyForchheimer::calcTransformModelData(), rotorDiskSource::calculate(), ijkAddressing::checkIndex(), Tensor< scalar >::col(), Tensor< scalar >::cols(), axisAligned::computeControlPoints(), transformBox::computeControlPoints(), boundBox::contains(), boundBox::containsInside(), NURBS3DVolume::coordinates(), cyclicPolyPatch::coupledEdges(), cyclicPolyPatch::coupledPoints(), SymmTensor< scalar >::diag(), Tensor< scalar >::diag(), treeBoundBox::distanceCmp(), PDRblock::dz(), Foam::eigenVector(), Foam::eigenVectors(), pitchForkRing::energy(), treeBoundBox::faceBits(), boundBox::faceCentre(), Foam::faceNij(), Foam::facePoint(), Foam::facePointN(), dynamicTreeDataPoint::findNearest(), NURBS3DVolume::findPointsInBox(), pitchForkRing::force(), rigidBodyModel::forwardDynamics(), Foam::fromCartesian(), FIRECore::getFirePoint(), boundaryMesh::getNearest(), ellipsoidImplicitFunction::grad(), PDRblock::grid(), ijkAddressing::index(), voxelMeshSearch::index(), voxelMeshSearch::index3(), waveModel::initialiseGeometry(), waveMakerPointPatchVectorField::initialiseGeometry(), cellShapeControlMesh::insert(), cellShapeControlMesh::insertFar(), treeBoundBox::intersects(), Foam::inv(), NURBS3DVolume::JacobianUVW(), Rzyx::jcalc(), Rxyz::jcalc(), Ryxz::jcalc(), cellMDLimitedGrad< Type >::limitFace(), momentOfInertia::massPropertiesSolid(), boundBox::nearest(), twoDPointCorrector::normalDir(), NURBS3DCurve::nrm2D(), Foam::operator&(), treeDataPoint::findNearestOp::operator()(), treeDataEdge::findNearestOp::operator()(), Foam::operator*(), Foam::operator/(), Foam::operator^(), boundBox::overlaps(), plane::planeIntersect(), ijkMesh::pointLabel(), polyTopoChange::pointRemoved(), tetrahedron< Point, PointRef >::pointToBarycentric(), treeBoundBox::posBits(), triad::primaryDirection(), projectFace::project(), FIRECore::putFirePoint(), quaternion::quaternion(), Foam::Ra(), AC3DsurfaceFormat< Face >::read(), IjkField< Foam::Vector< bool > >::resize(), linearSpringDamper::restrain(), Tensor< scalar >::row(), Tensor< scalar >::rows(), treeBoundBox::searchOrder(), NURBS3DCurve::setNrm2DOrientation(), SpatialVector< scalar >::SpatialVector(), Foam::sqr(), leastSquares::stencilWeights(), treeBoundBox::subBbox(), treeBoundBox::subOctant(), Foam::toCartesian(), controlPointsDefinition::transformControlPoints(), NURBS3DVolumeCylindrical::transformPointToCartesian(), Foam::transformPrincipal_vector(), triad::triad(), joint::unitQuaternion(), objectiveForce::update_dxdbMultiplier(), NURBS3DVolumeCylindrical::updateLocalCoordinateSystem(), PDRblock::V(), paraboloidImplicitFunction::value(), ellipsoidImplicitFunction::value(), NURBS3DVolume::volumeDerivativeCP(), wallLayerCells::wallLayerCells(), SMESHsurfaceFormat< Face >::write(), nastranSetWriter< Type >::write(), STLtriangle::write(), OBJstream::write(), meshToMeshMethod::writeConnectivity(), Foam::meshTools::writeOBJ(), coupledPolyPatch::writeOBJ(), triSurfaceTools::writeOBJ(), cellCuts::writeOBJ(), Foam::writeObjPoints(), moleculeCloud::writeXYZ(), and PDRobstacle::z().

◆ x() [2/2]

Cmpt & x ( )
inline

Access to the vector x component.

Definition at line 92 of file VectorI.H.

◆ y() [2/2]

Cmpt & y ( )
inline

Access to the vector y component.

Definition at line 98 of file VectorI.H.

◆ z() [2/2]

Cmpt & z ( )
inline

Access to the vector z component.

Definition at line 104 of file VectorI.H.

◆ normalise()

◆ centre()

const Foam::Vector< Cmpt > & centre ( const Foam::List< Vector< Cmpt >> &  ) const
inline

Return *this (used for point which is a typedef to Vector<scalar>.

Definition at line 114 of file VectorI.H.

Referenced by cellShape::centre(), cyclicPolyPatch::coupledEdges(), and extendedEdgeMesh::sortPointsAndEdges().

Here is the caller graph for this function:

Member Data Documentation

◆ rank

constexpr direction rank = 1
staticconstexpr

Rank of Vector is 1.

Definition at line 77 of file Vector.H.


The documentation for this class was generated from the following files: