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... | |
![]() | |
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... | |
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 |
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... | |
![]() | |
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 Attributes | |
static constexpr direction | rank = 1 |
Rank of Vector is 1. More... | |
![]() | |
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 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... | |
![]() | |
const typedef Cmpt * | const_iterator |
Random access iterator for traversing VectorSpace. More... | |
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 |
|
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(), Rxyz::jcalc(), Rzyx::jcalc(), Ryxz::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(), ijkMesh::vertLabels(), 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().
|
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(), ijkMesh::vertLabels(), 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().
|
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(), Ryxz::jcalc(), Rxyz::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(), ijkMesh::vertLabels(), 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().
|
inline |
Normalise the vector by its magnitude.
Definition at line 123 of file VectorI.H.
Referenced by wedgePolyPatch::calcGeometry(), cutCell::calcIsoFacePointsFromEdges(), ConeInjection< CloudType >::ConeInjection(), rotorDiskSource::createCoordinateSystem(), Foam::meshTools::edgeToCutDir(), searchableExtrudedCircle::findParametricNearest(), forAll(), NURBS3DCurve::nrm3D(), surfaceFieldValue::processValues(), setFlow::read(), forces::read(), propellerInfo::setCoordinateSystem(), ConeInjection< CloudType >::setProperties(), ConeNozzleInjection< CloudType >::setProperties(), wallBoundedParticle::trackFaceTri(), and surfaceIteratorPLIC::vofCutCell().
|
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().
|
staticconstexpr |