FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

VectorSpace< Form, Cmpt, nCmpt > Class Template Reference

Templated vector space. More...

#include <OpenFOAM/VectorSpace.H>


Detailed Description

template<class Form, class Cmpt, int nCmpt>
class Foam::VectorSpace< Form, Cmpt, nCmpt >

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 75 of file VectorSpace.H.

Inheritance diagram for VectorSpace< Form, Cmpt, nCmpt >:
Collaboration diagram for VectorSpace< Form, Cmpt, nCmpt >:

List of all members.

Public Types

enum  { dim = 3, nComponents = nCmpt }
typedef Cmpt  cmptType
 Component type.

Public Member Functions

 VectorSpace ()
 Construct null.
 VectorSpace (Istream &)
 Construct from Istream.
 VectorSpace (const VectorSpace< Form, Cmpt, nCmpt > &)
 Construct as copy.
label  size () const
 Return the number of elements in the VectorSpace = nCmpt.
const Cmpt &  component (const direction) const
Cmpt &  component (const direction)
void  component (Cmpt &, const direction) const
void  replace (const direction, const Cmpt &)
const Cmpt &  operator[] (const direction) const
Cmpt &  operator[] (const direction)
void  operator= (const VectorSpace< Form, Cmpt, nCmpt > &)
void  operator+= (const VectorSpace< Form, Cmpt, nCmpt > &)
void  operator-= (const VectorSpace< Form, Cmpt, nCmpt > &)
void  operator*= (const scalar)
void  operator/= (const scalar)

Public Attributes

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

Friends

Istream &  operator>> (Istream &, VectorSpace< Form, Cmpt, nCmpt > &)
Ostream &  operator (Ostream &, const VectorSpace< Form, Cmpt, nCmpt > &)

Member Typedef Documentation

typedef Cmpt cmptType

Component type.

Definition at line 81 of file VectorSpace.H.


Member Enumeration Documentation

anonymous enum
Enumerator:
dim 
nComponents 

Definition at line 86 of file VectorSpace.H.


Constructor & Destructor Documentation

VectorSpace (  ) [inline]

Construct null.

Definition at line 39 of file VectorSpaceI.H.

VectorSpace ( Istream &   is  )

Construct from Istream.

Definition at line 36 of file VectorSpace.C.

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

VectorSpace ( const VectorSpace< Form, Cmpt, nCmpt > &   vs  ) [inline]

Construct as copy.

Definition at line 45 of file VectorSpaceI.H.


Member Function Documentation

label size (  ) const [inline]

Return the number of elements in the VectorSpace = nCmpt.

Definition at line 56 of file VectorSpaceI.H.

Cmpt & component ( const direction   d  ) [inline]

Definition at line 85 of file VectorSpaceI.H.

References Foam::abort(), d, Foam::FatalError, and FatalErrorIn.

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

Definition at line 104 of file VectorSpaceI.H.

References Foam::abort(), d, Foam::FatalError, and FatalErrorIn.

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

Definition at line 126 of file VectorSpaceI.H.

References Foam::abort(), d, Foam::FatalError, and FatalErrorIn.

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

Definition at line 151 of file VectorSpaceI.H.

References Foam::abort(), d, Foam::FatalError, and FatalErrorIn.

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

Definition at line 172 of file VectorSpaceI.H.

References Foam::abort(), d, Foam::FatalError, and FatalErrorIn.

void operator= ( const VectorSpace< Form, Cmpt, nCmpt > &   vs  ) [inline]

Definition at line 191 of file VectorSpaceI.H.

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

Definition at line 201 of file VectorSpaceI.H.

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

Definition at line 211 of file VectorSpaceI.H.

void operator*= ( const scalar   s  ) [inline]

Definition at line 221 of file VectorSpaceI.H.

void operator/= ( const scalar   s  ) [inline]

Definition at line 231 of file VectorSpaceI.H.


Friends And Related Function Documentation

Istream& operator>> ( Istream &   ,
VectorSpace< Form, Cmpt, nCmpt > &    
) [friend]
Ostream& operator ( Ostream &   ,
const VectorSpace< Form, Cmpt, nCmpt > &    
) [friend]

Member Data Documentation


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