Loading...
Searching...
No Matches
VectorSpace< Form, Cmpt, Ncmpts > Class Template Reference

Templated vector space. More...

#include <VectorSpace.H>

Inherited by Barycentric< label >, Barycentric< scalar >, Barycentric2D< label >, Barycentric2D< scalar >, DiagTensor< label >, DiagTensor< scalar >, SpatialVector< scalar >, SphericalTensor< scalar >, SphericalTensor< label >, SphericalTensor< solveScalar >, SphericalTensor2D< scalar >, SphericalTensor2D< label >, SymmTensor< scalar >, SymmTensor< label >, SymmTensor< solveScalar >, SymmTensor2D< scalar >, SymmTensor2D< label >, Tensor2D< scalar >, Tensor2D< label >, Vector< vector >, Vector< complex >, Vector< float >, Vector< double >, Vector< scalar >, Vector< solveScalar >, Vector< label >, Vector2D< vector >, Vector2D< float >, Vector2D< double >, Vector2D< scalar >, and Vector2D< label >.

Classes

class  ConstBlock
 Const sub-block type. More...

Public Types

typedef VectorSpace< Form, Cmpt, Ncmpts > vsType
 VectorSpace type.
typedef Cmpt cmptType
 Component type.
typedef Cmpt magType
 Magnitude type.
typedef direction size_type
 The type to represent the size of a VectorSpace.
typedef Cmpt * iterator
 Random access iterator for traversing VectorSpace.
typedef const Cmpt * const_iterator
 Random access iterator for traversing VectorSpace.

Public Member Functions

 VectorSpace ()=default
 Default construct.
 VectorSpace (Foam::zero)
 Construct initialized to zero.
 VectorSpace (const VectorSpace< Form, Cmpt, Ncmpts > &vs)
 Copy construct.
template<class Form2, class Cmpt2>
 VectorSpace (const VectorSpace< Form2, Cmpt2, Ncmpts > &)
 Copy construct of a VectorSpace with the same size.
 VectorSpace (Istream &is)
 Construct from Istream.
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.
Cmpt * data () noexcept
 Return pointer to the first data element.
void fill (const Cmpt &s)
 Assign all components to given value.
template<class SubVector, direction BStart>
const 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 VectorSpace< Form, Cmpt, Ncmpts > &)
void operator-= (const VectorSpace< Form, Cmpt, Ncmpts > &)
template<class Form2, class Cmpt2>
void operator= (const VectorSpace< Form2, Cmpt2, Ncmpts > &)
 Copy assign from a VectorSpace with the same size.
void operator= (Foam::zero)
void operator*= (const scalar)
void operator/= (const scalar)
iterator begin () noexcept
 Return an iterator (pointer) to begin of VectorSpace.
const_iterator begin () const noexcept
 Return const_iterator (const pointer) to begin of VectorSpace.
const_iterator cbegin () const noexcept
 Return const_iterator (const pointer) to begin of VectorSpace.
iterator end () noexcept
 Return an iterator (pointer) to end of VectorSpace.
const_iterator end () const noexcept
 Return const_iterator (const pointer) to end of VectorSpace.
const_iterator cend () const noexcept
 Return const_iterator (const pointer) to end of VectorSpace.
template<class SubVector, Foam::direction BStart>
const Foam::VectorSpace< Form, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > block () const

Static Public Member Functions

static constexpr direction size () noexcept
 The number of elements in the VectorSpace = Ncmpts.
static Form uniform (const Cmpt &s)
 Return a VectorSpace with all elements = s.

Public Attributes

Cmpt v_ [Ncmpts]
 The components of this vector space.

Static Public Attributes

static constexpr direction dim = 3
 Dimensionality of space.
static constexpr direction nComponents = Ncmpts
 Number of components in this vector space.
static constexpr direction mRows = Ncmpts
static constexpr direction nCols = 1
static const char *const typeName = "spatialVector"
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

Friends

Istreamoperator>> (Istream &is, VectorSpace< Form, Cmpt, Ncmpts > &vs)
Ostreamoperator (Ostream &, const VectorSpace< Form, Cmpt, Ncmpts > &)

Detailed Description

template<class Form, class Cmpt, direction Ncmpts>
class Foam::VectorSpace< Form, Cmpt, Ncmpts >

Templated vector space.

Template arguments are the Form the vector space will be used to create, the type of the elements and the number of elements.

Source files

Definition at line 74 of file VectorSpace.H.

Member Typedef Documentation

◆ vsType

template<class Form, class Cmpt, direction Ncmpts>
typedef VectorSpace<Form, Cmpt, Ncmpts> vsType

VectorSpace type.

Definition at line 86 of file VectorSpace.H.

◆ cmptType

template<class Form, class Cmpt, direction Ncmpts>
typedef Cmpt cmptType

Component type.

Definition at line 91 of file VectorSpace.H.

◆ magType

template<class Form, class Cmpt, direction Ncmpts>
typedef Cmpt magType

Magnitude type.

Definition at line 96 of file VectorSpace.H.

◆ size_type

template<class Form, class Cmpt, direction Ncmpts>
typedef direction size_type

The type to represent the size of a VectorSpace.

Definition at line 101 of file VectorSpace.H.

◆ iterator

template<class Form, class Cmpt, direction Ncmpts>
typedef Cmpt* iterator

Random access iterator for traversing VectorSpace.

Definition at line 268 of file VectorSpace.H.

◆ const_iterator

template<class Form, class Cmpt, direction Ncmpts>
typedef const Cmpt* const_iterator

Random access iterator for traversing VectorSpace.

Definition at line 273 of file VectorSpace.H.

Constructor & Destructor Documentation

◆ VectorSpace() [1/5]

◆ VectorSpace() [2/5]

template<class Form, class Cmpt, Foam::direction Ncmpts>
VectorSpace ( Foam::zero )
inline

Construct initialized to zero.

Definition at line 31 of file VectorSpaceI.H.

References begin(), and VectorSpaceOps< N, I >::fill_n().

Here is the call graph for this function:

◆ VectorSpace() [3/5]

template<class Form, class Cmpt, Foam::direction Ncmpts>
VectorSpace ( const VectorSpace< Form, Cmpt, Ncmpts > & vs)
inline

Copy construct.

Definition at line 38 of file VectorSpaceI.H.

References cbegin(), VectorSpaceOps< N, I >::copy_n(), and VectorSpace().

Here is the call graph for this function:

◆ VectorSpace() [4/5]

template<class Form, class Cmpt, Foam::direction Ncmpts>
template<class Form2, class Cmpt2>
VectorSpace ( const VectorSpace< Form2, Cmpt2, Ncmpts > & vs)
inlineexplicit

Copy construct of a VectorSpace with the same size.

Definition at line 49 of file VectorSpaceI.H.

References cbegin(), VectorSpaceOps< N, I >::copy_n(), and VectorSpace().

Here is the call graph for this function:

◆ VectorSpace() [5/5]

template<class Form, class Cmpt, direction Ncmpts>
VectorSpace ( Istream & is)
explicit

Construct from Istream.

Member Function Documentation

◆ size()

template<class Form, class Cmpt, direction Ncmpts>
constexpr direction size ( )
inlinestaticconstexprnoexcept

The number of elements in the VectorSpace = Ncmpts.

Definition at line 211 of file VectorSpace.H.

Referenced by Foam::zip(), Foam::zip(), Foam::zip(), Foam::zip(), and Foam::zip().

Here is the caller graph for this function:

◆ component() [1/3]

template<class Form, class Cmpt, Foam::direction Ncmpts>
const Cmpt & component ( const direction d) const
inline

Definition at line 79 of file VectorSpaceI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and v_.

Referenced by Foam::component(), NURBS3DVolume::computeParametricCoordinates(), NURBS3DVolume::computeParametricCoordinates(), Bezier::facePoints_d(), coordinateRotation::findOrthogonal(), and Foam::setComponent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ component() [2/3]

template<class Form, class Cmpt, Foam::direction Ncmpts>
Cmpt & component ( const direction d)
inline

Definition at line 98 of file VectorSpaceI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and v_.

Here is the call graph for this function:

◆ component() [3/3]

template<class Form, class Cmpt, Foam::direction Ncmpts>
void component ( Cmpt & c,
const direction d ) const
inline

Definition at line 117 of file VectorSpaceI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and v_.

Here is the call graph for this function:

◆ replace()

template<class Form, class Cmpt, Foam::direction Ncmpts>
void replace ( const direction d,
const Cmpt & c )
inline

Definition at line 137 of file VectorSpaceI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and v_.

Referenced by particle< Type >::trackToMovingTri(), and particle< Type >::trackToStationaryTri().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cdata()

template<class Form, class Cmpt, direction Ncmpts>
const Cmpt * cdata ( ) const
inlinenoexcept

Return const pointer to the first data element.

Definition at line 222 of file VectorSpace.H.

◆ data()

template<class Form, class Cmpt, direction Ncmpts>
Cmpt * data ( )
inlinenoexcept

Return pointer to the first data element.

Definition at line 227 of file VectorSpace.H.

◆ fill()

template<class Form, class Cmpt, Foam::direction Ncmpts>
void fill ( const Cmpt & s)
inline

Assign all components to given value.

Definition at line 157 of file VectorSpaceI.H.

References begin(), VectorSpaceOps< N, I >::fill_n(), and s().

Here is the call graph for this function:

◆ uniform()

◆ block() [1/2]

template<class Form, class Cmpt, direction Ncmpts>
template<class SubVector, direction BStart>
const ConstBlock< SubVector, BStart > block ( ) const
inline

◆ operator[]() [1/2]

template<class Form, class Cmpt, Foam::direction Ncmpts>
const Cmpt & operator[] ( const direction d) const
inline

Definition at line 185 of file VectorSpaceI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, operator, and v_.

Referenced by triad::align(), triad::operator+=(), triad::orthogonalise(), triad::set(), triad::sortxyz(), and triad::triad().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator[]() [2/2]

template<class Form, class Cmpt, Foam::direction Ncmpts>
Cmpt & operator[] ( const direction d)
inline

Definition at line 204 of file VectorSpaceI.H.

References FatalErrorInFunction, and operator.

Here is the call graph for this function:

◆ operator=() [1/3]

template<class Form, class Cmpt, Foam::direction Ncmpts>
void operator= ( const VectorSpace< Form, Cmpt, Ncmpts > & vs)
inline

Definition at line 275 of file VectorSpaceI.H.

References VectorSpaceOps< N, I >::copy_n(), operator, and VectorSpace().

Referenced by MatrixSpace< Form, Cmpt, Mrows, Ncols >::operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator+=()

template<class Form, class Cmpt, Foam::direction Ncmpts>
void operator+= ( const VectorSpace< Form, Cmpt, Ncmpts > & vs)
inline

Definition at line 296 of file VectorSpaceI.H.

References VectorSpaceOps< N, I >::eqOp(), operator, and VectorSpace().

Here is the call graph for this function:

◆ operator-=()

template<class Form, class Cmpt, Foam::direction Ncmpts>
void operator-= ( const VectorSpace< Form, Cmpt, Ncmpts > & vs)
inline

Definition at line 306 of file VectorSpaceI.H.

References VectorSpaceOps< N, I >::eqOp(), operator, and VectorSpace().

Here is the call graph for this function:

◆ operator=() [2/3]

template<class Form, class Cmpt, Foam::direction Ncmpts>
template<class Form2, class Cmpt2>
void operator= ( const VectorSpace< Form2, Cmpt2, Ncmpts > & vs)
inline

Copy assign from a VectorSpace with the same size.

Definition at line 286 of file VectorSpaceI.H.

References VectorSpaceOps< N, I >::copy_n(), operator, and VectorSpace().

Here is the call graph for this function:

◆ operator=() [3/3]

template<class Form, class Cmpt, Foam::direction Ncmpts>
void operator= ( Foam::zero )
inline

Definition at line 316 of file VectorSpaceI.H.

References begin(), and VectorSpaceOps< N, I >::fill_n().

Here is the call graph for this function:

◆ operator*=()

template<class Form, class Cmpt, Foam::direction Ncmpts>
void operator*= ( const scalar s)
inline

Definition at line 323 of file VectorSpaceI.H.

References VectorSpaceOps< N, I >::eqOpS(), operator, and s().

Here is the call graph for this function:

◆ operator/=()

template<class Form, class Cmpt, Foam::direction Ncmpts>
void operator/= ( const scalar s)
inline

Definition at line 333 of file VectorSpaceI.H.

References VectorSpaceOps< N, I >::eqOpS(), operator, and s().

Here is the call graph for this function:

◆ begin() [1/2]

template<class Form, class Cmpt, direction Ncmpts>
iterator begin ( )
inlinenoexcept

Return an iterator (pointer) to begin of VectorSpace.

Definition at line 281 of file VectorSpace.H.

Referenced by fill(), operator=(), and VectorSpace().

Here is the caller graph for this function:

◆ begin() [2/2]

template<class Form, class Cmpt, direction Ncmpts>
const_iterator begin ( ) const
inlinenoexcept

Return const_iterator (const pointer) to begin of VectorSpace.

Definition at line 286 of file VectorSpace.H.

◆ cbegin()

template<class Form, class Cmpt, direction Ncmpts>
const_iterator cbegin ( ) const
inlinenoexcept

Return const_iterator (const pointer) to begin of VectorSpace.

Definition at line 291 of file VectorSpace.H.

Referenced by VectorSpace(), and VectorSpace().

Here is the caller graph for this function:

◆ end() [1/2]

template<class Form, class Cmpt, direction Ncmpts>
iterator end ( )
inlinenoexcept

Return an iterator (pointer) to end of VectorSpace.

Definition at line 296 of file VectorSpace.H.

◆ end() [2/2]

template<class Form, class Cmpt, direction Ncmpts>
const_iterator end ( ) const
inlinenoexcept

Return const_iterator (const pointer) to end of VectorSpace.

Definition at line 301 of file VectorSpace.H.

◆ cend()

template<class Form, class Cmpt, direction Ncmpts>
const_iterator cend ( ) const
inlinenoexcept

Return const_iterator (const pointer) to end of VectorSpace.

Definition at line 306 of file VectorSpace.H.

◆ block() [2/2]

template<class Form, class Cmpt, direction Ncmpts>
template<class SubVector, Foam::direction BStart>
const Foam::VectorSpace< Form, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > block ( ) const
inline

Definition at line 176 of file VectorSpaceI.H.

◆ operator>>

template<class Form, class Cmpt, direction Ncmpts>
Istream & operator>> ( Istream & is,
VectorSpace< Form, Cmpt, Ncmpts > & vs )
friend

◆ operator

Member Data Documentation

◆ v_

template<class Form, class Cmpt, direction Ncmpts>
Cmpt v_[Ncmpts]

The components of this vector space.

Definition at line 81 of file VectorSpace.H.

Referenced by Barycentric2D< label >::a(), Barycentric2D< label >::a(), Barycentric< label >::a(), Barycentric< label >::a(), Barycentric2D< label >::b(), Barycentric2D< label >::b(), Barycentric< label >::b(), Barycentric< label >::b(), Barycentric2D< label >::c(), Barycentric2D< label >::c(), Barycentric< label >::c(), Barycentric< label >::c(), Foam::cmptMax(), Foam::cmptMin(), Foam::cmptProduct(), Foam::cmptSum(), component(), component(), component(), Barycentric< label >::d(), Barycentric< label >::d(), SphericalTensor2D< scalar >::ii(), SphericalTensor2D< scalar >::ii(), SphericalTensor< scalar >::ii(), SphericalTensor< scalar >::ii(), SpatialVector< scalar >::lx(), SpatialVector< scalar >::lx(), SpatialVector< scalar >::ly(), SpatialVector< scalar >::ly(), SpatialVector< scalar >::lz(), SpatialVector< scalar >::lz(), Foam::magSqr(), operator[](), replace(), SpatialVector< scalar >::wx(), SpatialVector< scalar >::wx(), SpatialVector< scalar >::wy(), SpatialVector< scalar >::wy(), SpatialVector< scalar >::wz(), SpatialVector< scalar >::wz(), Vector2D< vector >::x(), Vector2D< vector >::x(), Vector< vector >::x(), Vector< vector >::x(), DiagTensor< label >::xx(), DiagTensor< label >::xx(), SymmTensor2D< scalar >::xx(), SymmTensor2D< scalar >::xx(), SymmTensor< scalar >::xx(), SymmTensor< scalar >::xx(), Tensor2D< scalar >::xx(), Tensor2D< scalar >::xx(), SymmTensor2D< scalar >::xy(), SymmTensor2D< scalar >::xy(), SymmTensor< scalar >::xy(), SymmTensor< scalar >::xy(), Tensor2D< scalar >::xy(), Tensor2D< scalar >::xy(), SymmTensor< scalar >::xz(), SymmTensor< scalar >::xz(), Vector2D< vector >::y(), Vector2D< vector >::y(), Vector< vector >::y(), Vector< vector >::y(), SymmTensor2D< scalar >::yx(), SymmTensor2D< scalar >::yx(), SymmTensor< scalar >::yx(), SymmTensor< scalar >::yx(), Tensor2D< scalar >::yx(), Tensor2D< scalar >::yx(), DiagTensor< label >::yy(), DiagTensor< label >::yy(), SymmTensor2D< scalar >::yy(), SymmTensor2D< scalar >::yy(), SymmTensor< scalar >::yy(), SymmTensor< scalar >::yy(), Tensor2D< scalar >::yy(), Tensor2D< scalar >::yy(), SymmTensor< scalar >::yz(), SymmTensor< scalar >::yz(), Vector< vector >::z(), Vector< vector >::z(), SymmTensor< scalar >::zx(), SymmTensor< scalar >::zx(), SymmTensor< scalar >::zy(), SymmTensor< scalar >::zy(), DiagTensor< label >::zz(), DiagTensor< label >::zz(), SymmTensor< scalar >::zz(), and SymmTensor< scalar >::zz().

◆ dim

template<class Form, class Cmpt, direction Ncmpts>
direction dim = 3
staticconstexpr

Dimensionality of space.

Definition at line 109 of file VectorSpace.H.

Referenced by Foam::cof(), Foam::det(), Foam::det(), and Foam::kShellMean().

◆ nComponents

template<class Form, class Cmpt, direction Ncmpts>
direction nComponents = Ncmpts
staticconstexpr

◆ mRows

template<class Form, class Cmpt, direction Ncmpts>
direction mRows = Ncmpts
staticconstexpr

◆ nCols

template<class Form, class Cmpt, direction Ncmpts>
direction nCols = 1
staticconstexpr

◆ typeName

const char *const typeName = "spatialVector"
static

Definition at line 126 of file VectorSpace.H.

◆ componentNames

const char *const componentNames
static
Initial value:
=
{
"wx", "wy", "wz", "lx", "ly", "lz"
}

Definition at line 127 of file VectorSpace.H.

Referenced by searchablePlate::searchablePlate(), regionSizeDistribution::write(), writeCellCentres::write(), and PDRblock::gridControl::writeDict().

◆ zero

const Foam::Vector< Foam::vector > zero
static

Definition at line 128 of file VectorSpace.H.

Referenced by extractEulerianParticles::accumulateParticleInfo(), sensitivitySurfacePoints::assembleSensitivities(), pointSmoother::average(), NURBS3DCurve::buildCurve(), NURBS3DSurface::buildSurface(), faceAreaIntersect::calc(), energySpectrum::calcAndWriteSpectrum(), Foam::calcEk(), fieldExtents::calcFieldExtents(), geometricElementTransformPointSmoother::calculate(), polyMeshGeometry::checkFaceTwist(), ShapeSensitivitiesBase::clearSurfaceFields(), averageNeighbourFvGeometryScheme::clipFaceTet(), averageNeighbourFvGeometryScheme::clipPyramids(), transformBox::computeControlPoints(), NURBS3DVolume::computeParametricCoordinates(), sensitivitySurfacePoints::constructGlobalPointNormalsAndAreas(), waveModel::correct(), motionSmootherAlgo::correctBoundaryConditions(), laplacianMotionSolver::curPoints(), motionSmootherAlgo::curPoints(), pLaplacianMotionSolver::curPoints(), triSurfaceTools::curvatures(), particle< Type >::deviationFromMeshCentre(), triSurfaceMesh::edgeTree(), inverseDistance::fill(), searchableSurfacesQueries::findNearest(), Foam::ImComplexField(), triangle2D::interArea(), interpolationCellPatchConstrained< Type >::interpolate(), patchTransformedInterpolation::interpolate(), meshRefinement::isGap(), meshRefinement::isNormalGap(), Foam::matchPoints(), Foam::matchPoints(), areaOp::operator()(), inverseDistance::overlaps(), projectFace::project(), radiativeIntensityRay::radiativeIntensityRay(), Foam::ReComplexField(), boundBox::reset(), pointSmoother::reset(), softWall::restrain(), wallBoundedStreamLineParticle::sample(), motionSmootherAlgo::scaleMesh(), displacementMethoddisplacementLaplacian::setMotionField(), displacementMethodvelocityLaplacian::setMotionField(), addPatchCellLayer::setRefinement(), rigidBodyMeshMotion::solve(), rigidBodyMeshMotionSolver::solve(), meshRefinement::testSyncPointList(), triSurfaceSearch::tree(), triSurfaceRegionSearch::treeByRegion(), UOprocess::UOprocess(), NURBS3DVolumeCylindrical::updateLocalCoordinateSystem(), eddy::uPrime(), forceCoeffs::coeffDesc::value(), and mappedPatchBase::write().

◆ one

◆ max

◆ min

const Foam::Vector< Foam::vector > min
static

Definition at line 131 of file VectorSpace.H.

Referenced by triangulatedPatch::randomLocalPoint().

◆ rootMax

◆ rootMin

const Foam::Vector< Foam::vector > rootMin
static

Definition at line 133 of file VectorSpace.H.

Referenced by cell::box(), and face::box().


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