dune-fem  2.4.1-rc
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Dune::Fem::SimpleBlockVector< Container, 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/defaultblockvectors.hh>

Inheritance diagram for Dune::Fem::SimpleBlockVector< Container, BlockSize >:
Inheritance graph

Public Types

enum  { blockSize = BlockSize }
 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 ArrayType::size_type SizeType
 Used for indexing the blocks, for example. 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

 SimpleBlockVector (ArrayType &array)
 Constructor; use this to create a block vector with 'size' blocks. More...
 
const ThisTypeoperator= (const ThisType &other)
 Copy assignment operator. 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<class Container, int BlockSize>
class Dune::Fem::SimpleBlockVector< Container, 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

template<class Container, int BlockSize>
typedef Fem::Envelope< ConstDofBlockType > Dune::Fem::SimpleBlockVector< Container, BlockSize >::ConstDofBlockPtrType
template<class Container, int BlockSize>
typedef SimpleBlockVectorBlock< ThisType > Dune::Fem::SimpleBlockVector< Container, BlockSize >::ConstDofBlockType

Type of one constant block.

template<class Container, int BlockSize>
typedef ArrayType::const_iterator Dune::Fem::SimpleBlockVector< Container, BlockSize >::ConstIteratorType

Constant iterator to iterate over the dofs.

template<class Container, int BlockSize>
typedef Fem::Envelope< DofBlockType > Dune::Fem::SimpleBlockVector< Container, BlockSize >::DofBlockPtrType
template<class Container, int BlockSize>
typedef SimpleBlockVectorBlock< ThisType > Dune::Fem::SimpleBlockVector< Container, BlockSize >::DofBlockType

Type of one (mutable) block.

template<class Container, int BlockSize>
typedef ArrayType Dune::Fem::SimpleBlockVector< Container, BlockSize >::DofContainerType
template<class Container, int BlockSize>
typedef ArrayType::value_type Dune::Fem::SimpleBlockVector< Container, BlockSize >::FieldType

Type of the field the dofs lie in.

template<class Container, int BlockSize>
typedef ArrayType::iterator Dune::Fem::SimpleBlockVector< Container, BlockSize >::IteratorType

Iterator to iterate over the dofs.

template<class Container, int BlockSize>
typedef SizeType Dune::Fem::SimpleBlockVector< Container, BlockSize >::size_type

Typedef to make this class STL-compatible.

template<class Container, int BlockSize>
typedef ArrayType::size_type Dune::Fem::SimpleBlockVector< Container, BlockSize >::SizeType

Used for indexing the blocks, for example.

template<class Container, int BlockSize>
typedef FieldType Dune::Fem::SimpleBlockVector< Container, BlockSize >::value_type

Typedef to make this class STL-compatible.

Member Enumeration Documentation

template<class Container, int BlockSize>
anonymous enum

Size of each block.

Enumerator
blockSize 

Constructor & Destructor Documentation

template<class Container, int BlockSize>
Dune::Fem::SimpleBlockVector< Container, BlockSize >::SimpleBlockVector ( ArrayType &  array)
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

template<class Container, int BlockSize>
const ArrayType& Dune::Fem::SimpleBlockVector< Container, BlockSize >::array ( ) const
inline
template<class Container, int BlockSize>
ArrayType& Dune::Fem::SimpleBlockVector< Container, BlockSize >::array ( )
inline
ThisType& Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::value_type >::asImp ( )
inlineprotectedinherited
const ThisType& Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::value_type >::asImp ( ) const
inlineprotectedinherited
void Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::value_type >::assign ( const ThisType other)
inlineprotectedinherited
void Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::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
template<class Container, int BlockSize>
IteratorType Dune::Fem::SimpleBlockVector< Container, BlockSize >::begin ( )
inline
template<class Container, int BlockSize>
ConstIteratorType Dune::Fem::SimpleBlockVector< Container, BlockSize >::begin ( ) const
inline

Const-iterator pointing to the first dof.

Returns
Const-iterator pointing to the first dof
template<class Container, int BlockSize>
ConstDofBlockPtrType Dune::Fem::SimpleBlockVector< Container, BlockSize >::blockPtr ( const unsigned int  i) const
inline

Accessor for a constant block.

Parameters
[in]iIndex of the block
Returns
The i-th block, constant
template<class Container, int BlockSize>
DofBlockPtrType Dune::Fem::SimpleBlockVector< Container, BlockSize >::blockPtr ( const unsigned int  i)
inline

Accessor for a block.

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

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

template<class Container, int BlockSize>
FieldType* Dune::Fem::SimpleBlockVector< Container, BlockSize >::data ( )
inline
template<class Container, int BlockSize>
const FieldType* Dune::Fem::SimpleBlockVector< Container, BlockSize >::data ( ) const
inline
template<class Container, int BlockSize>
IteratorType Dune::Fem::SimpleBlockVector< Container, BlockSize >::end ( )
inline

Iterator pointing to the last dof.

Returns
Iterator pointing to the last dof

Referenced by Dune::Fem::BlockVectorInterface< SimpleBlockVector< std::vector< F >, BlockSize >, std::vector< F >::value_type >::assign().

template<class Container, int BlockSize>
ConstIteratorType Dune::Fem::SimpleBlockVector< Container, BlockSize >::end ( ) const
inline

Const-iterator pointing to the last dof.

Returns
Const-iterator pointing to the last dof
template<class Container, int BlockSize>
SizeType Dune::Fem::SimpleBlockVector< Container, BlockSize >::numDofs ( ) const
inline

Returns the number of dofs in the block vector.

Returns
Number of dofs
FieldType Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::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"
const ThisType& Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::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< Container, BlockSize > , Container::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
const ThisType& Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::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
template<class Container, int BlockSize>
const ThisType& Dune::Fem::SimpleBlockVector< Container, BlockSize >::operator= ( const ThisType other)
inline

Copy assignment operator.

template<class Container, int BlockSize>
ConstDofBlockType Dune::Fem::SimpleBlockVector< Container, BlockSize >::operator[] ( const unsigned int  i) const
inline

Accessor for a constant block.

Parameters
[in]iIndex of the block
Returns
The i-th block, constant
template<class Container, int BlockSize>
DofBlockType Dune::Fem::SimpleBlockVector< Container, BlockSize >::operator[] ( const unsigned int  i)
inline

Accessor for a block.

Parameters
[in]iIndex of the block
Returns
The i-th block
template<class Container, int BlockSize>
SizeType Dune::Fem::SimpleBlockVector< Container, BlockSize >::size ( ) const
inline

Member Data Documentation

template<class Container, int BlockSize>
ArrayType& Dune::Fem::SimpleBlockVector< Container, BlockSize >::array_
protected
CounterType Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::value_type >::sequence_
mutableprotectedinherited

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