Public Types | Public Member Functions | Static Public Attributes | List of all members
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 >:
Inheritance graph
[legend]
Collaboration diagram for Vector< Cmpt >:
Collaboration graph
[legend]

Public Types

enum  components { X, Y, Z }
 
typedef Vector< label > labelType
 
- Public Types inherited from VectorSpace< Vector< Cmpt >, Cmpt, 3 >
typedef VectorSpace< Form, Cmpt, Ncmpts > vsType
 
typedef Cmpt cmptType
 
typedef Cmpt magType
 
typedef Cmpt * iterator
 

Public Member Functions

 Vector ()=default
 
 Vector (const Vector &)=default
 
Vectoroperator= (const Vector &)=default
 
 Vector (const Foam::zero)
 
template<class Cmpt2 >
 Vector (const VectorSpace< Vector< Cmpt2 >, Cmpt2, 3 > &vs)
 
 Vector (const Cmpt &vx, const Cmpt &vy, const Cmpt &vz)
 
 Vector (Istream &is)
 
const Cmpt & x () const
 
const Cmpt & y () const
 
const Cmpt & z () const
 
Cmpt & x ()
 
Cmpt & y ()
 
Cmpt & z ()
 
Vector< Cmpt > & normalise ()
 
const Vector< Cmpt > & centre (const Foam::List< Vector< Cmpt >> &) const
 
- Public Member Functions inherited from VectorSpace< Vector< Cmpt >, Cmpt, 3 >
 VectorSpace ()=default
 
 VectorSpace (const Foam::zero)
 
 VectorSpace (const VectorSpace< Form, Cmpt, Ncmpts > &vs)
 
 VectorSpace (const VectorSpace< Form2, Cmpt2, Ncmpts > &)
 
 VectorSpace (Istream &is)
 
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
 
Cmpt * data () noexcept
 
const ConstBlock< SubVector, BStart > block () const
 
const Foam::VectorSpace< Form, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > block () const
 
const Cmpt & operator[] (const direction) const
 
Cmpt & operator[] (const direction)
 
void operator= (const VectorSpace< Form, Cmpt, Ncmpts > &)
 
void operator= (const Foam::zero)
 
void operator+= (const VectorSpace< Form, Cmpt, Ncmpts > &)
 
void operator-= (const VectorSpace< Form, Cmpt, Ncmpts > &)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 

Static Public Attributes

static constexpr direction rank = 1
 
- Static Public Attributes inherited from VectorSpace< Vector< Cmpt >, Cmpt, 3 >
static constexpr direction dim
 
static constexpr direction nComponents
 
static constexpr direction mRows
 
static constexpr direction nCols
 
static const char *const typeName
 
static const char *const componentNames []
 
static const Form zero
 
static const Form one
 
static const Form max
 
static const Form min
 
static const Form rootMax
 
static const Form rootMin
 

Additional Inherited Members

- Static Public Member Functions inherited from VectorSpace< Vector< Cmpt >, Cmpt, 3 >
static constexpr direction size () noexcept
 
static Form uniform (const Cmpt &s)
 
- Public Attributes inherited from VectorSpace< Vector< Cmpt >, Cmpt, 3 >
const typedef Cmpt * const_iterator
 
Cmpt v_ [Ncmpts]
 

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 58 of file Vector.H.

Member Typedef Documentation

◆ labelType

typedef Vector<label> labelType

Definition at line 67 of file Vector.H.

Member Enumeration Documentation

◆ components

enum components
Enumerator

Definition at line 77 of file Vector.H.

Constructor & Destructor Documentation

◆ Vector() [1/6]

Vector ( )
default

◆ Vector() [2/6]

Vector ( const Vector< Cmpt > &  )
default

◆ Vector() [3/6]

Vector ( const Foam::zero  )
inline

Definition at line 25 of file VectorI.H.

◆ Vector() [4/6]

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

Definition at line 34 of file VectorI.H.

◆ Vector() [5/6]

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

Definition at line 44 of file VectorI.H.

◆ Vector() [6/6]

Vector ( Istream is)
inlineexplicit

Definition at line 57 of file VectorI.H.

Member Function Documentation

◆ operator=()

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

Referenced by triad::operator=().

Here is the caller graph for this function:

◆ x() [1/2]

Cmpt & x
inline

Definition at line 66 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(), 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(), adjointRotatingWallVelocityFvPatchVectorField::dxdbMult(), 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(), 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::pointToBarycentric(), treeBoundBox::posBits(), triad::primaryDirection(), projectFace::project(), FIRECore::putFirePoint(), quaternion::quaternion(), Foam::Ra(), AC3DsurfaceFormat< Face >::read(), energySpectrum::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(), snappyVoxelMeshDriver::snappyVoxelMeshDriver(), SpatialVector< scalar >::SpatialVector(), Foam::sqr(), leastSquares::stencilWeights(), treeBoundBox::subBbox(), treeBoundBox::subOctant(), Foam::toCartesian(), NURBS3DVolumeCylindrical::transformationTensorDxDb(), controlPointsDefinition::transformControlPoints(), NURBS3DVolumeCylindrical::transformPointToCartesian(), Foam::transformPrincipal_vector(), 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(), Cloud< passivePositionParticle >::writePositions(), moleculeCloud::writeXYZ(), PDRobstacle::x(), Foam::Xinterpolate(), and Foam::XstepForwardsToNextPoint().

◆ y() [1/2]

Cmpt & y
inline

Definition at line 72 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(), 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(), adjointRotatingWallVelocityFvPatchVectorField::dxdbMult(), 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(), Rxyz::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::pointToBarycentric(), treeBoundBox::posBits(), triad::primaryDirection(), projectFace::project(), FIRECore::putFirePoint(), quaternion::quaternion(), Foam::Ra(), AC3DsurfaceFormat< Face >::read(), energySpectrum::read(), IjkField< Foam::Vector< bool > >::resize(), linearSpringDamper::restrain(), Tensor< scalar >::row(), Tensor< scalar >::rows(), treeBoundBox::searchOrder(), NURBS3DCurve::setNrm2DOrientation(), snappyVoxelMeshDriver::snappyVoxelMeshDriver(), SpatialVector< scalar >::SpatialVector(), Foam::sqr(), leastSquares::stencilWeights(), treeBoundBox::subBbox(), treeBoundBox::subOctant(), Foam::toCartesian(), NURBS3DVolumeCylindrical::transformationTensorDxDb(), controlPointsDefinition::transformControlPoints(), NURBS3DVolumeCylindrical::transformPointToCartesian(), Foam::transformPrincipal_vector(), 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(), Cloud< passivePositionParticle >::writePositions(), moleculeCloud::writeXYZ(), and PDRobstacle::y().

◆ z() [1/2]

Cmpt & z
inline

Definition at line 78 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(), 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(), adjointRotatingWallVelocityFvPatchVectorField::dxdbMult(), 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::pointToBarycentric(), treeBoundBox::posBits(), triad::primaryDirection(), projectFace::project(), FIRECore::putFirePoint(), quaternion::quaternion(), Foam::Ra(), AC3DsurfaceFormat< Face >::read(), energySpectrum::read(), IjkField< Foam::Vector< bool > >::resize(), linearSpringDamper::restrain(), Tensor< scalar >::row(), Tensor< scalar >::rows(), treeBoundBox::searchOrder(), NURBS3DCurve::setNrm2DOrientation(), snappyVoxelMeshDriver::snappyVoxelMeshDriver(), SpatialVector< scalar >::SpatialVector(), Foam::sqr(), leastSquares::stencilWeights(), treeBoundBox::subBbox(), treeBoundBox::subOctant(), Foam::toCartesian(), controlPointsDefinition::transformControlPoints(), NURBS3DVolumeCylindrical::transformPointToCartesian(), Foam::transformPrincipal_vector(), 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(), Cloud< passivePositionParticle >::writePositions(), moleculeCloud::writeXYZ(), and PDRobstacle::z().

◆ x() [2/2]

Cmpt& x ( )
inline

◆ y() [2/2]

Cmpt& y ( )
inline

◆ z() [2/2]

Cmpt& z ( )
inline

◆ normalise()

Foam::Vector< Cmpt > & normalise
inline

◆ centre()

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

Definition at line 107 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

Definition at line 73 of file Vector.H.


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