VectorSpace< Form, Cmpt, Ncmpts > Class Template Reference

Templated vector space. More...

Inheritance diagram for VectorSpace< Form, Cmpt, Ncmpts >:

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...
 

Public Member Functions

 VectorSpace ()
 Construct null. More...
 
 VectorSpace (const Foam::zero)
 Construct initialised to zero. More...
 
 VectorSpace (Istream &)
 Construct from Istream. More...
 
template<class Form2 , class Cmpt2 >
 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 &)
 
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 Foam::zero)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 
template<class SubVector , direction BStart>
const VectorSpace< Form, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > block () const
 

Static Public Member Functions

static direction size ()
 Return 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 const direction dim = 3
 Dimensionality of space. More...
 
static const direction nComponents = Ncmpts
 Number of components in this vector space. More...
 
static const direction mRows = Ncmpts
 
static const direction nCols = 1
 
static const char *const typeName = "vectorVector"
 
static const char *const componentNames [] = {"x", "y", "z"}
 
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 87 of file VectorSpace.H.

◆ cmptType

typedef Cmpt cmptType

Component type.

Definition at line 90 of file VectorSpace.H.

Constructor & Destructor Documentation

◆ VectorSpace() [1/4]

VectorSpace
inline

Construct null.

Definition at line 40 of file VectorSpaceI.H.

◆ VectorSpace() [2/4]

VectorSpace ( const Foam::zero  )
inline

Construct initialised to zero.

Definition at line 45 of file VectorSpaceI.H.

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

Here is the call graph for this function:

◆ VectorSpace() [3/4]

VectorSpace ( Istream is)

Construct from Istream.

Definition at line 34 of file VectorSpace.C.

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

Here is the call graph for this function:

◆ VectorSpace() [4/4]

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

Construct as copy of a VectorSpace with the same size.

Definition at line 53 of file VectorSpaceI.H.

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

Here is the call graph for this function:

Member Function Documentation

◆ size()

direction size
inlinestatic

Return the number of elements in the VectorSpace = Ncmpts.

Definition at line 83 of file VectorSpaceI.H.

Referenced by MPLICface::Cf().

Here is the caller graph for this function:

◆ component() [1/3]

◆ component() [2/3]

Cmpt & component ( const direction  d)
inline

Definition at line 109 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 128 of file VectorSpaceI.H.

References FatalErrorInFunction.

◆ replace()

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

Definition at line 148 of file VectorSpaceI.H.

Referenced by particle::trackToMovingTri(), and particle::trackToStationaryTri().

Here is the caller graph for this function:

◆ uniform()

◆ block() [1/2]

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

◆ operator[]() [1/2]

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

Definition at line 189 of file VectorSpaceI.H.

◆ operator[]() [2/2]

Cmpt & operator[] ( const direction  d)
inline

Definition at line 208 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+=()

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

Definition at line 279 of file VectorSpaceI.H.

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

Here is the call graph for this function:

◆ operator-=()

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

Definition at line 289 of file VectorSpaceI.H.

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

Here is the call graph for this function:

◆ operator=()

void operator= ( const Foam::zero  )
inline

Definition at line 299 of file VectorSpaceI.H.

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

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*=()

void operator*= ( const scalar  s)
inline

Definition at line 306 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 316 of file VectorSpaceI.H.

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

Here is the call graph for this function:

◆ block() [2/2]

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

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

const direction dim = 3
static

Dimensionality of space.

Definition at line 96 of file VectorSpace.H.

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

◆ nComponents

◆ mRows

const direction mRows = Ncmpts
static

◆ nCols

const direction nCols = 1
static

◆ typeName

const char *const typeName = "vectorVector"
static

Definition at line 111 of file VectorSpace.H.

◆ componentNames

const char *const componentNames = {"x", "y", "z"}
static

Definition at line 112 of file VectorSpace.H.

Referenced by searchablePlate::searchablePlate(), and writeCellCentres::write().

◆ zero

◆ one

◆ max

◆ min

◆ rootMax

const Foam::vector2D rootMax
static

◆ rootMin

const Foam::vector2D rootMin
static

Definition at line 118 of file VectorSpace.H.


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