dune-fem  2.4.1-rc
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Dune::Fem::ReferenceBlockVector< F, BlockSize > Class Template Reference

This is the reference implementation of a block vector as it is expected as the second template parameter to Dune::Fem::BlockVectorDiscreteFunction. More...

#include </local/tomalk/somewhere/tmp/dune-fem/dune/fem/function/blockvectors/referenceblockvector.hh>

Inheritance diagram for Dune::Fem::ReferenceBlockVector< F, BlockSize >:
Inheritance graph

Public Types

typedef BaseType::SizeType SizeType
 
enum  
 Size of each block. More...
 
typedef ArrayType DofContainerType
 
typedef ArrayType::value_type FieldType
 Type of the field the dofs lie in. More...
 
typedef ArrayType::iterator IteratorType
 Iterator to iterate over the dofs. More...
 
typedef ArrayType::const_iterator ConstIteratorType
 Constant iterator to iterate over the dofs. More...
 
typedef FieldType value_type
 Typedef to make this class STL-compatible. More...
 
typedef SizeType size_type
 Typedef to make this class STL-compatible. More...
 
typedef SimpleBlockVectorBlock< ThisTypeDofBlockType
 Type of one (mutable) block. More...
 
typedef SimpleBlockVectorBlock< ThisTypeConstDofBlockType
 Type of one constant block. More...
 
typedef Fem::Envelope< DofBlockTypeDofBlockPtrType
 
typedef Fem::Envelope< ConstDofBlockTypeConstDofBlockPtrType
 

Public Member Functions

 ReferenceBlockVector (SizeType size)
 Constructor; use this to create a block vector with 'size' blocks. More...
 
void reserve (const int size)
 Reserve memory. More...
 
void resize (SizeType size)
 Resize the block vector. More...
 
ConstDofBlockType operator[] (const unsigned int i) const
 Accessor for a constant block. More...
 
DofBlockType operator[] (const unsigned int i)
 Accessor for a block. More...
 
ConstDofBlockPtrType blockPtr (const unsigned int i) const
 Accessor for a constant block. More...
 
DofBlockPtrType blockPtr (const unsigned int i)
 Accessor for a block. More...
 
IteratorType begin ()
 Iterator pointing to the first dof. More...
 
ConstIteratorType begin () const
 Const-iterator pointing to the first dof. More...
 
IteratorType end ()
 Iterator pointing to the last dof. More...
 
ConstIteratorType end () const
 Const-iterator pointing to the last dof. More...
 
SizeType size () const
 Returns the number of blocks. More...
 
SizeType numDofs () const
 Returns the number of dofs in the block vector. More...
 
FieldTypedata ()
 
const FieldTypedata () const
 
const ArrayType & array () const
 
ArrayType & array ()
 
const ThisTypeoperator+= (const ThisType &other)
 Add another block vector to *this. More...
 
const ThisTypeoperator-= (const ThisType &other)
 Subtract another block vector from *this. More...
 
FieldType operator* (const ThisType &other) const
 Scalar product *this with another block vector. More...
 
const ThisTypeoperator*= (const FieldType &scalar)
 Scale this block vector. More...
 
void axpy (const FieldType &scalar, const ThisType &other)
 Add a scalar multiple of another block vector to this block vector. More...
 
void clear ()
 Clear this block vector, i.e. set each dof to 0. More...
 

Protected Member Functions

void assign (const ThisType &other)
 
ThisTypeasImp ()
 
const ThisTypeasImp () const
 

Protected Attributes

ArrayType & array_
 
CounterType sequence_
 

Detailed Description

template<typename F, unsigned int BlockSize>
class Dune::Fem::ReferenceBlockVector< F, BlockSize >

This is the reference implementation of a block vector as it is expected as the second template parameter to Dune::Fem::BlockVectorDiscreteFunction.

Template Parameters
FThe ground fields. All dofs are elements of this field.
BlockSizeSize of the blocks

Member Typedef Documentation

typedef Fem::Envelope< ConstDofBlockType > Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::ConstDofBlockPtrType
inherited
typedef SimpleBlockVectorBlock< ThisType > Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::ConstDofBlockType
inherited

Type of one constant block.

typedef ArrayType::const_iterator Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::ConstIteratorType
inherited

Constant iterator to iterate over the dofs.

typedef Fem::Envelope< DofBlockType > Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::DofBlockPtrType
inherited
typedef SimpleBlockVectorBlock< ThisType > Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::DofBlockType
inherited

Type of one (mutable) block.

typedef ArrayType Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::DofContainerType
inherited
typedef ArrayType::value_type Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::FieldType
inherited

Type of the field the dofs lie in.

typedef ArrayType::iterator Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::IteratorType
inherited

Iterator to iterate over the dofs.

typedef SizeType Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::size_type
inherited

Typedef to make this class STL-compatible.

template<typename F , unsigned int BlockSize>
typedef BaseType::SizeType Dune::Fem::ReferenceBlockVector< F, BlockSize >::SizeType
typedef FieldType Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::value_type
inherited

Typedef to make this class STL-compatible.

Member Enumeration Documentation

anonymous enum
inherited

Size of each block.

Constructor & Destructor Documentation

template<typename F , unsigned int BlockSize>
Dune::Fem::ReferenceBlockVector< F, BlockSize >::ReferenceBlockVector ( SizeType  size)
inlineexplicit

Constructor; use this to create a block vector with 'size' blocks.

The dofs are not initialized.

Parameters
[in]sizeNumber of blocks

Member Function Documentation

const ArrayType& Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::array ( ) const
inlineinherited
ArrayType& Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::array ( )
inlineinherited
ThisType& Dune::Fem::BlockVectorInterface< SimpleBlockVector< std::vector< F >, BlockSize > , std::vector< F >::value_type >::asImp ( )
inlineprotectedinherited
const ThisType& Dune::Fem::BlockVectorInterface< SimpleBlockVector< std::vector< F >, BlockSize > , std::vector< F >::value_type >::asImp ( ) const
inlineprotectedinherited
void Dune::Fem::BlockVectorInterface< SimpleBlockVector< std::vector< F >, BlockSize > , std::vector< F >::value_type >::assign ( const ThisType other)
inlineprotectedinherited
void Dune::Fem::BlockVectorInterface< SimpleBlockVector< std::vector< F >, BlockSize > , std::vector< F >::value_type >::axpy ( const FieldType scalar,
const ThisType other 
)
inlineinherited

Add a scalar multiple of another block vector to this block vector.

Semantic in pseudocode: " *this = *this + scalar*v "

Parameters
[in]scalarScalar factor by which v is multiplied before it is added to *this
[in]otherThe other block vector

References Dune::Fem::SimpleBlockVector< Container, BlockSize >::begin(), and Dune::Fem::SimpleBlockVector< Container, BlockSize >::size().

IteratorType Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::begin ( )
inlineinherited

Iterator pointing to the first dof.

Returns
Iterator pointing to the first dof
ConstIteratorType Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::begin ( ) const
inlineinherited

Const-iterator pointing to the first dof.

Returns
Const-iterator pointing to the first dof
ConstDofBlockPtrType Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::blockPtr ( const unsigned int  i) const
inlineinherited

Accessor for a constant block.

Parameters
[in]iIndex of the block
Returns
The i-th block, constant
DofBlockPtrType Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::blockPtr ( const unsigned int  i)
inlineinherited

Accessor for a block.

Parameters
[in]iIndex of the block
Returns
The i-th block
void Dune::Fem::BlockVectorInterface< SimpleBlockVector< std::vector< F >, BlockSize > , std::vector< F >::value_type >::clear ( )
inlineinherited

Clear this block vector, i.e. set each dof to 0.

FieldType* Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::data ( )
inlineinherited
const FieldType* Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::data ( ) const
inlineinherited
IteratorType Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::end ( )
inlineinherited

Iterator pointing to the last dof.

Returns
Iterator pointing to the last dof
ConstIteratorType Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::end ( ) const
inlineinherited

Const-iterator pointing to the last dof.

Returns
Const-iterator pointing to the last dof
SizeType Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::numDofs ( ) const
inlineinherited

Returns the number of dofs in the block vector.

Returns
Number of dofs
FieldType Dune::Fem::BlockVectorInterface< SimpleBlockVector< std::vector< F >, BlockSize > , std::vector< F >::value_type >::operator* ( const ThisType other) const
inlineinherited

Scalar product *this with another block vector.

Parameters
[in]otherOther block vector
Returns
Returns the scalar product " (*this)*other"

References Dune::Fem::BlockVectorInterface< Imp, Field >::asImp(), Dune::Fem::SimpleBlockVector< Container, BlockSize >::begin(), Dune::Fem::SimpleBlockVector< Container, BlockSize >::size(), and Dune::Std::sum().

const ThisType& Dune::Fem::BlockVectorInterface< SimpleBlockVector< std::vector< F >, BlockSize > , std::vector< F >::value_type >::operator*= ( const FieldType scalar)
inlineinherited

Scale this block vector.

Parameters
[in]scalarFactor for the scaling
Returns
Constant reference to *this
const ThisType& Dune::Fem::BlockVectorInterface< SimpleBlockVector< std::vector< F >, BlockSize > , std::vector< F >::value_type >::operator+= ( const ThisType other)
inlineinherited

Add another block vector to *this.

Parameters
[in]otherOther block vector to add
Returns
Constant reference to *this

References Dune::Fem::SimpleBlockVector< Container, BlockSize >::begin(), and Dune::Fem::SimpleBlockVector< Container, BlockSize >::size().

const ThisType& Dune::Fem::BlockVectorInterface< SimpleBlockVector< std::vector< F >, BlockSize > , std::vector< F >::value_type >::operator-= ( const ThisType other)
inlineinherited

Subtract another block vector from *this.

Parameters
[in]otherOther block vector to subtract
Returns
Constant reference to *this

References Dune::Fem::SimpleBlockVector< Container, BlockSize >::begin(), and Dune::Fem::SimpleBlockVector< Container, BlockSize >::size().

ConstDofBlockType Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::operator[] ( const unsigned int  i) const
inlineinherited

Accessor for a constant block.

Parameters
[in]iIndex of the block
Returns
The i-th block, constant
DofBlockType Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::operator[] ( const unsigned int  i)
inlineinherited

Accessor for a block.

Parameters
[in]iIndex of the block
Returns
The i-th block
void Dune::Fem::MutableBlockVector< std::vector< F > , BlockSize >::reserve ( const int  size)
inlineinherited

Reserve memory.

This method is a no-op. It is defined here to make the block vector compatible to the managed dof storage mechanisms used by Dune::Fem::BlockVectorDiscreteFunction

Parameters
[in]sizeNumber of blocks
void Dune::Fem::MutableBlockVector< std::vector< F > , BlockSize >::resize ( SizeType  size)
inlineinherited

Resize the block vector.

Parameters
[in]sizeNew number of blocks
SizeType Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::size ( ) const
inlineinherited

Returns the number of blocks.

Returns
Number of blocks

Member Data Documentation

ArrayType& Dune::Fem::SimpleBlockVector< std::vector< F > , BlockSize >::array_
protectedinherited
CounterType Dune::Fem::BlockVectorInterface< SimpleBlockVector< std::vector< F >, BlockSize > , std::vector< F >::value_type >::sequence_
mutableprotectedinherited

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