VectorSpace< Form, Cmpt, Ncmpts > Class Template Reference

Templated vector space. More...

Inherited by Barycentric< scalar >, DiagTensor< scalar >, MatrixSpace< BarycentricTensor< Cmpt >, Cmpt, 4, 3 >, MatrixSpace< CompactSpatialTensor< Cmpt >, Cmpt, 6, 3 >, MatrixSpace< CompactSpatialTensorT< Cmpt >, Cmpt, 3, 6 >, MatrixSpace< RowVector< Cmpt >, Cmpt, 1, 3 >, MatrixSpace< SpatialTensor< Cmpt >, Cmpt, 6, 6 >, MatrixSpace< Tensor< Cmpt >, Cmpt, 3, 3 >, MatrixSpace< CompactSpatialTensor< scalar >, scalar, 6, 3 >, MatrixSpace< Tensor< scalar >, scalar, 3, 3 >, SpatialVector< scalar >, SphericalTensor< scalar >, SymmTensor< scalar >, Vector< float >, Vector< vector >, Vector< scalar >, Vector< bool >, Vector< Foam::List< scalar > >, Vector< Foam::PDRblock::gridControl >, Vector< Foam::PDRblock::location >, Vector< label >, Vector< Foam::Vector2D >, Vector< int >, Vector< direction >, Vector2D< scalar >, and Vector2D< label >.

Classes

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

Public Types

typedef VectorSpace< Form, 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...
 
typedef const Cmpt * const_iterator
 Random access iterator for traversing VectorSpace. More...
 

Public Member Functions

 VectorSpace ()=default
 Default construct. More...
 
 VectorSpace (const Foam::zero)
 Construct initialized to zero. More...
 
 VectorSpace (const VectorSpace< Form, Cmpt, Ncmpts > &vs)
 Copy construct. More...
 
template<class Form2 , class Cmpt2 >
 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...
 
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 > &)
 
void operator= (const Foam::zero)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 
iterator begin () noexcept
 Return an iterator to begin of VectorSpace. More...
 
iterator end () noexcept
 Return an 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...
 
const_iterator begin () const noexcept
 Return const_iterator to begin of VectorSpace. More...
 
const_iterator end () const noexcept
 Return const_iterator to end of VectorSpace. More...
 
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. More...
 
static Form uniform (const Cmpt &s)
 Return a VectorSpace with all elements = s. More...
 

Public Attributes

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

Static Public Attributes

static constexpr direction dim = 3
 Dimensionality of space. More...
 
static constexpr direction nComponents = Ncmpts
 Number of components in this vector space. More...
 
static constexpr direction mRows = Ncmpts
 
static constexpr direction nCols = 1
 
static const char *const typeName = "diagTensor"
 
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 &, VectorSpace< Form, Cmpt, Ncmpts > &)
 
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 78 of file VectorSpace.H.

Member Typedef Documentation

◆ vsType

typedef VectorSpace<Form, Cmpt, Ncmpts> vsType

VectorSpace type.

Definition at line 86 of file VectorSpace.H.

◆ cmptType

typedef Cmpt cmptType

Component type.

Definition at line 89 of file VectorSpace.H.

◆ magType

typedef Cmpt magType

Magnitude type.

Definition at line 92 of file VectorSpace.H.

◆ iterator

typedef Cmpt* iterator

Random access iterator for traversing VectorSpace.

Definition at line 217 of file VectorSpace.H.

◆ const_iterator

typedef const Cmpt* const_iterator

Random access iterator for traversing VectorSpace.

Definition at line 220 of file VectorSpace.H.

Constructor & Destructor Documentation

◆ VectorSpace() [1/5]

VectorSpace ( )
default

Default construct.

◆ VectorSpace() [2/5]

VectorSpace ( const Foam::zero  )
inline

Construct initialized to zero.

Definition at line 38 of file VectorSpaceI.H.

◆ VectorSpace() [3/5]

VectorSpace ( const VectorSpace< Form, Cmpt, Ncmpts > &  vs)
inline

Copy construct.

Definition at line 45 of file VectorSpaceI.H.

◆ VectorSpace() [4/5]

VectorSpace ( const VectorSpace< Form2, Cmpt2, Ncmpts > &  vs)
inlineexplicit

Copy construct of a VectorSpace with the same size.

Definition at line 56 of file VectorSpaceI.H.

◆ VectorSpace() [5/5]

VectorSpace ( Istream is)
explicit

Construct from Istream.

Definition at line 36 of file VectorSpace.C.

References IOstream::check(), FUNCTION_NAME, Istream::readBegin(), and Istream::readEnd().

Here is the call graph for this function:

Member Function Documentation

◆ size()

static constexpr direction size ( )
inlinestaticconstexprnoexcept

The number of elements in the VectorSpace = Ncmpts.

Definition at line 176 of file VectorSpace.H.

Referenced by Foam::zip().

Here is the caller graph for this function:

◆ component() [1/3]

const Cmpt & component ( const direction  d) const
inline

Definition at line 86 of file VectorSpaceI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and VectorSpace< Form, Cmpt, Ncmpts >::v_.

Referenced by Foam::component(), NURBS3DVolume::computeParametricCoordinates(), Bezier::facePoints_d(), coordinateRotation::findOrthogonal(), cellMDLimitedGrad< Type >::limitFace(), Foam::setComponent(), and symmetryPlaneFvPatchField< Type >::snGradTransformDiag().

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

◆ component() [2/3]

Cmpt & component ( const direction  d)
inline

Definition at line 105 of file VectorSpaceI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and VectorSpace< Form, Cmpt, Ncmpts >::v_.

Here is the call graph for this function:

◆ component() [3/3]

void component ( Cmpt &  c,
const direction  d 
) const
inline

Definition at line 124 of file VectorSpaceI.H.

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

Here is the call graph for this function:

◆ replace()

void replace ( const direction  d,
const Cmpt &  c 
)
inline

Definition at line 144 of file VectorSpaceI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and VectorSpace< Form, Cmpt, Ncmpts >::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()

const Cmpt * cdata
inlinenoexcept

Return const pointer to the first data element.

Definition at line 192 of file VectorSpaceI.H.

◆ data()

Cmpt * data
inlinenoexcept

Return pointer to the first data element.

Definition at line 185 of file VectorSpaceI.H.

References VectorSpace< Form, Cmpt, Ncmpts >::v_.

Referenced by DSMCParcel< ParcelType >::DSMCParcel(), KinematicParcel< ParcelType >::KinematicParcel(), and molecule::molecule().

Here is the caller graph for this function:

◆ uniform()

Form uniform ( const Cmpt &  s)
inlinestatic

Return a VectorSpace with all elements = s.

Definition at line 164 of file VectorSpaceI.H.

◆ block() [1/2]

const ConstBlock< SubVector, BStart > block ( ) const
inline

◆ operator[]() [1/2]

const Cmpt & operator[] ( const direction  d) const
inline

Definition at line 247 of file VectorSpaceI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and VectorSpace< Form, Cmpt, Ncmpts >::v_.

Here is the call graph for this function:

◆ operator[]() [2/2]

Cmpt & operator[] ( const direction  d)
inline

Definition at line 266 of file VectorSpaceI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and VectorSpace< Form, Cmpt, Ncmpts >::v_.

Here is the call graph for this function:

◆ operator=() [1/2]

void operator= ( const VectorSpace< Form, Cmpt, Ncmpts > &  vs)
inline

Definition at line 337 of file VectorSpaceI.H.

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

Here is the caller graph for this function:

◆ operator+=()

void operator+= ( const VectorSpace< Form, Cmpt, Ncmpts > &  vs)
inline

Definition at line 347 of file VectorSpaceI.H.

◆ operator-=()

void operator-= ( const VectorSpace< Form, Cmpt, Ncmpts > &  vs)
inline

Definition at line 357 of file VectorSpaceI.H.

◆ operator=() [2/2]

void operator= ( const Foam::zero  )
inline

Definition at line 367 of file VectorSpaceI.H.

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

Here is the call graph for this function:

◆ operator*=()

void operator*= ( const scalar  s)
inline

Definition at line 374 of file VectorSpaceI.H.

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

Here is the call graph for this function:

◆ operator/=()

void operator/= ( const scalar  s)
inline

Definition at line 384 of file VectorSpaceI.H.

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

Here is the call graph for this function:

◆ begin() [1/2]

Cmpt * begin
inlinenoexcept

Return an iterator to begin of VectorSpace.

Definition at line 199 of file VectorSpaceI.H.

References VectorSpace< Form, Cmpt, Ncmpts >::v_.

Referenced by Foam::eigenValues().

Here is the caller graph for this function:

◆ end() [1/2]

Cmpt * end
inlinenoexcept

Return an iterator to end of VectorSpace.

Definition at line 206 of file VectorSpaceI.H.

Referenced by Foam::eigenValues().

Here is the caller graph for this function:

◆ cbegin()

const Cmpt * cbegin
inlinenoexcept

Return const_iterator to begin of VectorSpace.

Definition at line 213 of file VectorSpaceI.H.

References VectorSpace< Form, Cmpt, Ncmpts >::v_.

◆ cend()

const Cmpt * cend
inlinenoexcept

Return const_iterator to end of VectorSpace.

Definition at line 221 of file VectorSpaceI.H.

References VectorSpace< Form, Cmpt, Ncmpts >::v_.

◆ begin() [2/2]

const Cmpt * begin
inlinenoexcept

Return const_iterator to begin of VectorSpace.

Definition at line 229 of file VectorSpaceI.H.

References VectorSpace< Form, Cmpt, Ncmpts >::v_.

◆ end() [2/2]

const Cmpt * end
inlinenoexcept

Return const_iterator to end of VectorSpace.

Definition at line 237 of file VectorSpaceI.H.

◆ block() [2/2]

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

Definition at line 176 of file VectorSpaceI.H.

Friends And Related Function Documentation

◆ operator>>

Istream & operator>> ( Istream ,
VectorSpace< Form, Cmpt, Ncmpts > &   
)
friend

◆ operator

Ostream & operator ( Ostream ,
const VectorSpace< Form, Cmpt, Ncmpts > &   
)
friend

Member Data Documentation

◆ v_

◆ dim

constexpr direction dim = 3
staticconstexpr

Dimensionality of space.

Definition at line 98 of file VectorSpace.H.

◆ nComponents

constexpr direction nComponents = Ncmpts
staticconstexpr

Number of components in this vector space.

Definition at line 101 of file VectorSpace.H.

Referenced by VectorSpace< Form, Cmpt, Ncmpts >::ConstBlock< SubVector, BStart >::ConstBlock().

◆ mRows

constexpr direction mRows = Ncmpts
staticconstexpr

◆ nCols

constexpr direction nCols = 1
staticconstexpr

◆ typeName

const char *const typeName = "diagTensor"
static

Definition at line 113 of file VectorSpace.H.

◆ componentNames

const char *const componentNames
static
Initial value:
=
{
"xx", "yy", "zz"
}

Definition at line 114 of file VectorSpace.H.

◆ zero

const Foam::vector2D zero
static

Definition at line 115 of file VectorSpace.H.

◆ one

const Foam::vector2D one
static

Definition at line 116 of file VectorSpace.H.

◆ max

◆ min

◆ rootMax

const Foam::vector2D rootMax
static

Definition at line 119 of file VectorSpace.H.

◆ rootMin

const Foam::vector2D rootMin
static

Definition at line 120 of file VectorSpace.H.


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