dune-fem 2.8.0
Loading...
Searching...
No Matches
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 <dune/fem/function/blockvectors/referenceblockvector.hh>

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

Public Types

typedef BaseType::SizeType SizeType
 
enum  { blockSize = BlockSize }
 Size of each block. More...
 
typedef ArrayType DofContainerType
 
typedef ArrayType::value_type FieldType
 Type of the field the dofs lie in.
 
typedef ArrayType::iterator IteratorType
 Iterator to iterate over the dofs.
 
typedef ArrayType::const_iterator ConstIteratorType
 Constant iterator to iterate over the dofs.
 
typedef FieldType value_type
 Typedef to make this class STL-compatible.
 
typedef SizeType size_type
 Typedef to make this class STL-compatible.
 
typedef SubVector< DofContainerType, StaticOffsetSubMapper< BlockSize > > DofBlockType
 Type of one (mutable) block.
 
typedef DofBlockType ConstDofBlockType
 Type of one constant block.
 
typedef Fem::Envelope< DofBlockTypeDofBlockPtrType
 
typedef Fem::Envelope< ConstDofBlockTypeConstDofBlockPtrType
 
typedef Hybrid::IndexRange< int, blockSizeBlockIndices
 

Public Member Functions

 ReferenceBlockVector (SizeType size)
 Constructor; use this to create a block vector with 'size' blocks.
 
void setMemoryFactor (const double memFactor)
 set memory overestimate factor, here does nothing
 
void reserve (const int size)
 Reserve memory.
 
void resize (SizeType size)
 Resize the block vector.
 
ConstDofBlockType operator[] (const unsigned int i) const
 Constant access the i-th block.
 
DofBlockType operator[] (const unsigned int i)
 Access the i-th block.
 
ConstDofBlockPtrType blockPtr (const unsigned int i) const
 Constant access for the i-th block.
 
DofBlockPtrType blockPtr (const unsigned int i)
 Access the i-th block.
 
IteratorType begin ()
 Iterator pointing to the first dof.
 
ConstIteratorType begin () const
 Const-iterator pointing to the first dof.
 
IteratorType end ()
 Iterator pointing to the last dof.
 
ConstIteratorType end () const
 Const-iterator pointing to the last dof.
 
SizeType size () const
 Number of blocks.
 
SizeType numDofs () const
 Number of dofs in the block vector.
 
FieldTypedata ()
 
const FieldTypedata () const
 
const ArrayType & array () const
 
ArrayType & array ()
 
const ThisTypeoperator+= (const ThisType &other)
 Add another block vector to *this.
 
const ThisTypeoperator-= (const ThisType &other)
 Subtract another block vector from *this.
 
FieldType operator* (const ThisType &other) const
 Scalar product between *this and another block vector.
 
const ThisTypeoperator*= (const FieldType &scalar)
 Scale this block vector.
 
void axpy (const FieldType &scalar, const ThisType &other)
 Add a scalar multiple of another block vector to this block vector.
 
void clear ()
 Clear this block vector, i.e. set each dof to 0.
 
std::size_t usedMemorySize () const
 
void copyContent (const size_t newIndex, const size_t oldIndex)
 
void memMoveBackward (const size_t length, const size_t oldStartIdx, const size_t newStartIdx)
 move memory blocks backwards
 
void memMoveForward (const size_t length, const size_t oldStartIdx, const size_t newStartIdx)
 move memory blocks forward
 

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

◆ BlockIndices

template<class Container , int BlockSize>
typedef Hybrid::IndexRange< int, blockSize > Dune::Fem::SimpleBlockVector< Container, BlockSize >::BlockIndices
inherited

◆ ConstDofBlockPtrType

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

◆ ConstDofBlockType

template<class Container , int BlockSize>
typedef DofBlockType Dune::Fem::SimpleBlockVector< Container, BlockSize >::ConstDofBlockType
inherited

Type of one constant block.

◆ ConstIteratorType

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

Constant iterator to iterate over the dofs.

◆ DofBlockPtrType

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

◆ DofBlockType

template<class Container , int BlockSize>
typedef SubVector< DofContainerType, StaticOffsetSubMapper< BlockSize > > Dune::Fem::SimpleBlockVector< Container, BlockSize >::DofBlockType
inherited

Type of one (mutable) block.

◆ DofContainerType

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

◆ FieldType

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

Type of the field the dofs lie in.

◆ IteratorType

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

Iterator to iterate over the dofs.

◆ size_type

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

Typedef to make this class STL-compatible.

◆ SizeType

template<typename F , unsigned int BlockSize>
typedef BaseType::SizeType Dune::Fem::ReferenceBlockVector< F, BlockSize >::SizeType

◆ value_type

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

Typedef to make this class STL-compatible.

Member Enumeration Documentation

◆ anonymous enum

template<class Container , int BlockSize>
anonymous enum
inherited

Size of each block.

Enumerator
blockSize 

Constructor & Destructor Documentation

◆ ReferenceBlockVector()

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

◆ array() [1/2]

template<class Container , int BlockSize>
ArrayType & Dune::Fem::SimpleBlockVector< Container, BlockSize >::array ( )
inlineinherited

◆ array() [2/2]

template<class Container , int BlockSize>
const ArrayType & Dune::Fem::SimpleBlockVector< Container, BlockSize >::array ( ) const
inlineinherited

◆ asImp() [1/2]

ThisType & Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::value_type >::asImp ( )
inlineprotectedinherited

◆ asImp() [2/2]

const ThisType & Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::value_type >::asImp ( ) const
inlineprotectedinherited

◆ assign()

void Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::value_type >::assign ( const ThisType other)
inlineprotectedinherited

◆ axpy()

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

◆ begin() [1/2]

template<class Container , int BlockSize>
IteratorType Dune::Fem::SimpleBlockVector< Container, BlockSize >::begin ( )
inlineinherited

Iterator pointing to the first dof.

◆ begin() [2/2]

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

Const-iterator pointing to the first dof.

◆ blockPtr() [1/2]

template<class Container , int BlockSize>
DofBlockPtrType Dune::Fem::SimpleBlockVector< Container, BlockSize >::blockPtr ( const unsigned int  i)
inlineinherited

Access the i-th block.

◆ blockPtr() [2/2]

template<class Container , int BlockSize>
ConstDofBlockPtrType Dune::Fem::SimpleBlockVector< Container, BlockSize >::blockPtr ( const unsigned int  i) const
inlineinherited

Constant access for the i-th block.

◆ clear()

void Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::value_type >::clear ( )
inlineinherited

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

◆ copyContent()

void Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::value_type >::copyContent ( const size_t  newIndex,
const size_t  oldIndex 
)
inlineinherited

implements array[ newIndex ] = array[ oldIndex ]

◆ data() [1/2]

template<class Container , int BlockSize>
FieldType * Dune::Fem::SimpleBlockVector< Container, BlockSize >::data ( )
inlineinherited

◆ data() [2/2]

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

◆ end() [1/2]

template<class Container , int BlockSize>
IteratorType Dune::Fem::SimpleBlockVector< Container, BlockSize >::end ( )
inlineinherited

Iterator pointing to the last dof.

◆ end() [2/2]

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

Const-iterator pointing to the last dof.

◆ memMoveBackward()

void Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::value_type >::memMoveBackward ( const size_t  length,
const size_t  oldStartIdx,
const size_t  newStartIdx 
)
inlineinherited

move memory blocks backwards

◆ memMoveForward()

void Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::value_type >::memMoveForward ( const size_t  length,
const size_t  oldStartIdx,
const size_t  newStartIdx 
)
inlineinherited

move memory blocks forward

◆ numDofs()

template<class Container , int BlockSize>
SizeType Dune::Fem::SimpleBlockVector< Container, BlockSize >::numDofs ( ) const
inlineinherited

Number of dofs in the block vector.

◆ operator*()

FieldType Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::value_type >::operator* ( const ThisType other) const
inlineinherited

Scalar product between *this and another block vector.

◆ operator*=()

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

◆ operator+=()

const ThisType & Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::value_type >::operator+= ( const ThisType other)
inlineinherited

Add another block vector to *this.

◆ operator-=()

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

Subtract another block vector from *this.

◆ operator[]() [1/2]

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

Access the i-th block.

◆ operator[]() [2/2]

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

Constant access the i-th block.

◆ reserve()

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

◆ resize()

void Dune::Fem::MutableBlockVector< std::vector< F > , BlockSize >::resize ( SizeType  size)
inlineinherited

Resize the block vector.

◆ setMemoryFactor()

void Dune::Fem::MutableBlockVector< std::vector< F > , BlockSize >::setMemoryFactor ( const double  memFactor)
inlineinherited

set memory overestimate factor, here does nothing

◆ size()

template<class Container , int BlockSize>
SizeType Dune::Fem::SimpleBlockVector< Container, BlockSize >::size ( ) const
inlineinherited

Number of blocks.

◆ usedMemorySize()

std::size_t Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::value_type >::usedMemorySize ( ) const
inlineinherited

return memory used by this block vector

Member Data Documentation

◆ array_

template<class Container , int BlockSize>
ArrayType& Dune::Fem::SimpleBlockVector< Container, BlockSize >::array_
protectedinherited

◆ sequence_

CounterType Dune::Fem::BlockVectorInterface< SimpleBlockVector< Container, BlockSize > , Container::value_type >::sequence_
mutableprotectedinherited

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