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 >:
Collaboration diagram for Vector< Cmpt >:

Public Types

enum  components { X, Y, Z }
 Component labeling enumeration. More...
 
typedef Vector< labellabelType
 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...
 

Public Member Functions

 Vector ()
 Construct null. More...
 
 Vector (const Foam::zero)
 Construct initialised to zero. More...
 
template<class Cmpt2 >
 Vector (const VectorSpace< Vector< Cmpt2 >, Cmpt2, 3 > &)
 Construct given VectorSpace of the same rank. More...
 
 Vector (const Cmpt &vx, const Cmpt &vy, const Cmpt &vz)
 Construct given three components. More...
 
 Vector (Istream &)
 Construct from Istream. More...
 
const Cmpt & x () const
 
const Cmpt & y () const
 
const Cmpt & z () const
 
Cmpt & x ()
 
Cmpt & y ()
 
Cmpt & z ()
 
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 ()
 Construct null. More...
 
 VectorSpace (const Foam::zero)
 Construct initialised to zero. More...
 
 VectorSpace (Istream &)
 Construct from Istream. More...
 
 VectorSpace (const VectorSpace< Form2, Cmpt2, Ncmpts > &)
 Construct as copy of a VectorSpace with the same size. More...
 
const Cmpt & component (const direction) const
 
Cmpt & component (const direction)
 
void component (Cmpt &, const direction) const
 
void replace (const direction, const Cmpt &)
 
const ConstBlock< SubVector, BStart > block () const
 
const 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 VectorSpace< Vector< Cmpt >, Cmpt, Ncmpts > &)
 
void operator= (const Foam::zero)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 

Static Public Attributes

static const direction rank = 1
 Rank of Vector is 1. More...
 
- Static Public Attributes inherited from VectorSpace< Vector< Cmpt >, Cmpt, 3 >
static const direction dim
 Dimensionality of space. More...
 
static const direction nComponents
 Number of components in this vector space. More...
 
static const direction mRows
 
static const 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 direction size ()
 Return 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 >
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 57 of file Vector.H.

Member Typedef Documentation

◆ labelType

Equivalent type of labels used for valid component indexing.

Definition at line 65 of file Vector.H.

Member Enumeration Documentation

◆ components

enum components

Component labeling enumeration.

Enumerator

Definition at line 75 of file Vector.H.

Constructor & Destructor Documentation

◆ Vector() [1/5]

Vector ( )
inline

Construct null.

Definition at line 29 of file VectorI.H.

Referenced by Vector< vector >::Vector().

Here is the caller graph for this function:

◆ Vector() [2/5]

Vector ( const Foam::zero  )
inline

Construct initialised to zero.

Definition at line 34 of file VectorI.H.

◆ Vector() [3/5]

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

Construct given VectorSpace of the same rank.

Definition at line 43 of file VectorI.H.

◆ Vector() [4/5]

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

Construct given three components.

Definition at line 53 of file VectorI.H.

◆ Vector() [5/5]

Vector ( Istream is)
inline

Construct from Istream.

Definition at line 66 of file VectorI.H.

Member Function Documentation

◆ x() [1/2]

const Cmpt & x ( ) const
inline

Definition at line 75 of file VectorI.H.

Referenced by biLinearFitPolynomial::addCoeffs(), cubicUpwindFitPolynomial::addCoeffs(), linearFitPolynomial::addCoeffs(), quadraticFitPolynomial::addCoeffs(), quadraticLinearUpwindFitPolynomial::addCoeffs(), quadraticUpwindFitPolynomial::addCoeffs(), quadraticLinearFitPolynomial::addCoeffs(), triad::align(), polygonTriangulate::angle(), sixDoFRigidBodyState::angularVelocity(), plane::aPoint(), BarycentricTensor< Cmpt >::BarycentricTensor(), BarycentricTensor2D< Cmpt >::BarycentricTensor2D(), Foam::meshTools::calcBoxPointNormals(), treeBoundBox::calcExtremities(), CentredFitSnGradData< Polynomial >::calcFit(), FitData< CentredFitSnGradData< Polynomial >, extendedCentredCellToFaceStencil, Polynomial >::calcFit(), rotorDiskSource::calculate(), edgeCollapser::checkMeshQuality(), molecule::constantProperties::constantProperties(), boundBox::contains(), boundBox::containsInside(), MaxwellianThermal< CloudType >::correct(), MixedDiffuseSpecular< CloudType >::correct(), cyclicPolyPatch::coupledEdges(), cyclicPolyPatch::coupledPoints(), treeBoundBox::distanceCmp(), Foam::eigenValues(), Foam::eigenVector(), Foam::eigenVectors(), pitchForkRing::energy(), treeBoundBox::extend(), treeBoundBox::faceBits(), indexedOctree< Foam::treeDataFace >::findLine(), dynamicTreeDataPoint::findNearest(), dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::findNearest(), indexedOctree< Foam::treeDataFace >::findNearest(), pitchForkRing::force(), rigidBodyModel::forwardDynamics(), repatchMesh::getNearest(), waveSuperposition::height(), cellShapeControlMesh::insert(), cellShapeControlMesh::insertFar(), triangleFuncs::intersectBb(), treeBoundBox::intersects(), Foam::inv(), Rzyx::jcalc(), Rxyz::jcalc(), Ryxz::jcalc(), cellMDLimitedGrad< Type >::limitFace(), momentOfInertia::massPropertiesSolid(), conformalVoronoiMesh::maxSurfaceProtrusion(), molecule::move(), NamedEnum< compressibleField, 8 >::names(), boundBox::nearest(), twoDPointCorrector::normalDir(), Foam::operator &(), treeDataPoint::findNearestOp::operator()(), treeDataEdge::findNearestOp::operator()(), Foam::operator*(), Foam::operator/(), Foam::operator^(), boundBox::overlaps(), searchablePlate::overlaps(), dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::overlaps(), indexedOctree< Foam::treeDataFace >::overlaps(), plane::planeCoeffs(), plane::planeIntersect(), polyTopoChange::pointRemoved(), boundBox::points(), tetrahedron< Point, PointRef >::pointToBarycentric(), treeBoundBox::posBits(), particle::prepareForInteractionListReferral(), particle::prepareForNonConformalCyclicTransfer(), triad::primaryDirection(), quaternion::quaternion(), quaternion::R(), AC3DsurfaceFormat< Face >::read(), Foam::readUpto(), Foam::rotationTensor(), treeBoundBox::searchOrder(), ThermoLookupTableInjection< CloudType >::setPositionAndCell(), ReactingLookupTableInjection< CloudType >::setPositionAndCell(), ReactingMultiphaseLookupTableInjection< CloudType >::setPositionAndCell(), MomentumLookupTableInjection< CloudType >::setPositionAndCell(), triad::sortxyz(), SpatialVector< scalar >::SpatialVector(), Foam::sqr(), Foam::triIntersect::srcPointTgtTriIntersection(), treeBoundBox::subBbox(), treeBoundBox::subOctant(), surfaceDisplacementPointPatchVectorField::surfaceDisplacementPointPatchVectorField(), Tensor< scalar >::Tensor(), Foam::toPoint(), coordinateRotation::transformPrincipal(), triad::triad(), pointConstraint::unconstrainedDirections(), joint::unitQuaternion(), waveSuperposition::velocity(), vtkInsertNextOpenFOAMPoint(), wallLayerCells::wallLayerCells(), X3DsurfaceFormat< Face >::write(), WRLsurfaceFormat< Face >::write(), SMESHsurfaceFormat< Face >::write(), OBJsurfaceFormat< Face >::write(), GTSsurfaceFormat< Face >::write(), AC3DsurfaceFormat< Face >::write(), OBJedgeFormat::write(), OBJstream::write(), rigidBodyState::write(), sixDoFRigidBodyState::write(), meshToMeshMethod::writeConnectivity(), VTKsurfaceFormatCore::writeHeader(), VTKedgeFormat::writeHeader(), Foam::meshTools::writeOBJ(), coupledPolyPatch::writeOBJ(), triSurfaceTools::writeOBJ(), treeBoundBox::writeOBJ(), cellCuts::writeOBJ(), moleculeCloud::writeXYZ(), Foam::Xinterpolate(), and Foam::XstepForwardsToNextPoint().

◆ y() [1/2]

const Cmpt & y ( ) const
inline

Definition at line 81 of file VectorI.H.

Referenced by biLinearFitPolynomial::addCoeffs(), cubicUpwindFitPolynomial::addCoeffs(), linearFitPolynomial::addCoeffs(), quadraticFitPolynomial::addCoeffs(), quadraticLinearUpwindFitPolynomial::addCoeffs(), quadraticUpwindFitPolynomial::addCoeffs(), quadraticLinearFitPolynomial::addCoeffs(), triad::align(), polygonTriangulate::angle(), sixDoFRigidBodyState::angularVelocity(), plane::aPoint(), BarycentricTensor< Cmpt >::BarycentricTensor(), BarycentricTensor2D< Cmpt >::BarycentricTensor2D(), Foam::meshTools::calcBoxPointNormals(), treeBoundBox::calcExtremities(), CentredFitSnGradData< Polynomial >::calcFit(), FitData< CentredFitSnGradData< Polynomial >, extendedCentredCellToFaceStencil, Polynomial >::calcFit(), rotorDiskSource::calculate(), edgeCollapser::checkMeshQuality(), molecule::constantProperties::constantProperties(), boundBox::contains(), boundBox::containsInside(), MaxwellianThermal< CloudType >::correct(), MixedDiffuseSpecular< CloudType >::correct(), cyclicPolyPatch::coupledEdges(), cyclicPolyPatch::coupledPoints(), treeBoundBox::distanceCmp(), Foam::eigenValues(), Foam::eigenVector(), Foam::eigenVectors(), pitchForkRing::energy(), treeBoundBox::extend(), treeBoundBox::faceBits(), indexedOctree< Foam::treeDataFace >::findLine(), dynamicTreeDataPoint::findNearest(), dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::findNearest(), indexedOctree< Foam::treeDataFace >::findNearest(), pitchForkRing::force(), rigidBodyModel::forwardDynamics(), repatchMesh::getNearest(), waveSuperposition::height(), cellShapeControlMesh::insert(), cellShapeControlMesh::insertFar(), triangleFuncs::intersectBb(), treeBoundBox::intersects(), Foam::inv(), Rxyz::jcalc(), Ryxz::jcalc(), Rzyx::jcalc(), cellMDLimitedGrad< Type >::limitFace(), momentOfInertia::massPropertiesSolid(), conformalVoronoiMesh::maxSurfaceProtrusion(), molecule::move(), NamedEnum< compressibleField, 8 >::names(), boundBox::nearest(), twoDPointCorrector::normalDir(), Foam::operator &(), treeDataPoint::findNearestOp::operator()(), treeDataEdge::findNearestOp::operator()(), Foam::operator*(), Foam::operator/(), Foam::operator^(), boundBox::overlaps(), searchablePlate::overlaps(), dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::overlaps(), indexedOctree< Foam::treeDataFace >::overlaps(), plane::planeCoeffs(), plane::planeIntersect(), polyTopoChange::pointRemoved(), boundBox::points(), tetrahedron< Point, PointRef >::pointToBarycentric(), treeBoundBox::posBits(), particle::prepareForInteractionListReferral(), particle::prepareForNonConformalCyclicTransfer(), triad::primaryDirection(), quaternion::quaternion(), quaternion::R(), AC3DsurfaceFormat< Face >::read(), Foam::readUpto(), Foam::rotationTensor(), treeBoundBox::searchOrder(), triad::sortxyz(), SpatialVector< scalar >::SpatialVector(), Foam::sqr(), Foam::triIntersect::srcPointTgtTriIntersection(), treeBoundBox::subBbox(), treeBoundBox::subOctant(), surfaceDisplacementPointPatchVectorField::surfaceDisplacementPointPatchVectorField(), Tensor< scalar >::Tensor(), Foam::toPoint(), coordinateRotation::transformPrincipal(), triad::triad(), pointConstraint::unconstrainedDirections(), joint::unitQuaternion(), waveSuperposition::velocity(), vtkInsertNextOpenFOAMPoint(), wallLayerCells::wallLayerCells(), X3DsurfaceFormat< Face >::write(), WRLsurfaceFormat< Face >::write(), SMESHsurfaceFormat< Face >::write(), OBJsurfaceFormat< Face >::write(), GTSsurfaceFormat< Face >::write(), AC3DsurfaceFormat< Face >::write(), OBJedgeFormat::write(), OBJstream::write(), meshToMeshMethod::writeConnectivity(), VTKsurfaceFormatCore::writeHeader(), VTKedgeFormat::writeHeader(), Foam::meshTools::writeOBJ(), coupledPolyPatch::writeOBJ(), triSurfaceTools::writeOBJ(), treeBoundBox::writeOBJ(), cellCuts::writeOBJ(), moleculeCloud::writeXYZ(), and Foam::Xinterpolate().

◆ z() [1/2]

const Cmpt & z ( ) const
inline

Definition at line 87 of file VectorI.H.

Referenced by biLinearFitPolynomial::addCoeffs(), linearFitPolynomial::addCoeffs(), quadraticFitPolynomial::addCoeffs(), quadraticLinearUpwindFitPolynomial::addCoeffs(), quadraticUpwindFitPolynomial::addCoeffs(), cubicUpwindFitPolynomial::addCoeffs(), quadraticLinearFitPolynomial::addCoeffs(), triad::align(), sixDoFRigidBodyState::angularVelocity(), plane::aPoint(), BarycentricTensor< Cmpt >::BarycentricTensor(), BarycentricTensor2D< Cmpt >::BarycentricTensor2D(), Foam::meshTools::calcBoxPointNormals(), treeBoundBox::calcExtremities(), CentredFitSnGradData< Polynomial >::calcFit(), FitData< CentredFitSnGradData< Polynomial >, extendedCentredCellToFaceStencil, Polynomial >::calcFit(), rotorDiskSource::calculate(), molecule::constantProperties::constantProperties(), boundBox::contains(), boundBox::containsInside(), MaxwellianThermal< CloudType >::correct(), MixedDiffuseSpecular< CloudType >::correct(), cyclicPolyPatch::coupledEdges(), cyclicPolyPatch::coupledPoints(), treeBoundBox::distanceCmp(), Foam::eigenValues(), Foam::eigenVector(), Foam::eigenVectors(), pitchForkRing::energy(), treeBoundBox::extend(), treeBoundBox::faceBits(), indexedOctree< Foam::treeDataFace >::findLine(), dynamicTreeDataPoint::findNearest(), dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::findNearest(), indexedOctree< Foam::treeDataFace >::findNearest(), pitchForkRing::force(), rigidBodyModel::forwardDynamics(), repatchMesh::getNearest(), waveSuperposition::height(), cellShapeControlMesh::insert(), cellShapeControlMesh::insertFar(), triangleFuncs::intersectBb(), treeBoundBox::intersects(), Foam::inv(), Rxyz::jcalc(), Rzyx::jcalc(), Ryxz::jcalc(), cellMDLimitedGrad< Type >::limitFace(), momentOfInertia::massPropertiesSolid(), conformalVoronoiMesh::maxSurfaceProtrusion(), NamedEnum< compressibleField, 8 >::names(), boundBox::nearest(), twoDPointCorrector::normalDir(), Foam::operator &(), treeDataPoint::findNearestOp::operator()(), treeDataEdge::findNearestOp::operator()(), Foam::operator*(), Foam::operator/(), Foam::operator^(), boundBox::overlaps(), searchablePlate::overlaps(), dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::overlaps(), indexedOctree< Foam::treeDataFace >::overlaps(), plane::planeCoeffs(), plane::planeIntersect(), polyTopoChange::pointRemoved(), boundBox::points(), tetrahedron< Point, PointRef >::pointToBarycentric(), treeBoundBox::posBits(), particle::prepareForInteractionListReferral(), particle::prepareForNonConformalCyclicTransfer(), triad::primaryDirection(), quaternion::quaternion(), quaternion::R(), AC3DsurfaceFormat< Face >::read(), Foam::readUpto(), Foam::rotationTensor(), treeBoundBox::searchOrder(), triad::sortxyz(), SpatialVector< scalar >::SpatialVector(), Foam::sqr(), Foam::triIntersect::srcPointTgtTriIntersection(), treeBoundBox::subBbox(), treeBoundBox::subOctant(), surfaceDisplacementPointPatchVectorField::surfaceDisplacementPointPatchVectorField(), Tensor< scalar >::Tensor(), Foam::toPoint(), coordinateRotation::transformPrincipal(), triad::triad(), joint::unitQuaternion(), layeredEngine::update(), waveSuperposition::velocity(), vtkInsertNextOpenFOAMPoint(), wallLayerCells::wallLayerCells(), X3DsurfaceFormat< Face >::write(), WRLsurfaceFormat< Face >::write(), SMESHsurfaceFormat< Face >::write(), GTSsurfaceFormat< Face >::write(), OBJsurfaceFormat< Face >::write(), AC3DsurfaceFormat< Face >::write(), OBJedgeFormat::write(), OBJstream::write(), meshToMeshMethod::writeConnectivity(), VTKsurfaceFormatCore::writeHeader(), VTKedgeFormat::writeHeader(), Foam::meshTools::writeOBJ(), coupledPolyPatch::writeOBJ(), triSurfaceTools::writeOBJ(), treeBoundBox::writeOBJ(), cellCuts::writeOBJ(), and moleculeCloud::writeXYZ().

◆ x() [2/2]

Cmpt & x ( )
inline

Definition at line 94 of file VectorI.H.

◆ y() [2/2]

Cmpt & y ( )
inline

Definition at line 100 of file VectorI.H.

◆ z() [2/2]

Cmpt & z ( )
inline

Definition at line 106 of file VectorI.H.

◆ 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 116 of file VectorI.H.

Referenced by cyclicPolyPatch::coupledEdges(), Foam::meshEdge(), Foam::min(), treeDataPrimitivePatch< PatchType >::overlaps(), surfaceFeatures::setFromStatus(), extendedEdgeMesh::sortPointsAndEdges(), and Vector< vector >::z().

Here is the caller graph for this function:

Member Data Documentation

◆ rank

const direction rank = 1
static

Rank of Vector is 1.

Definition at line 71 of file Vector.H.


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