DUNE-FEM (unstable)

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>

Public Types

enum  
 Size of each block.
 
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 Field DofType
 make consistent with discrete function
 

Public Member Functions

 ReferenceBlockVector (SizeType size)
 Constructor; use this to create a block vector with 'size' blocks. More...
 
void setMemoryFactor (const double memFactor)
 set memory overestimate factor, here does nothing
 
void reserve (const int size)
 Reserve memory. More...
 
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.
 
IteratorType beforeEnd ()
 Iterator pointing to last dof.
 
ConstIteratorType beforeEnd () const
 Iterator pointing to last dof.
 
IteratorType beforeBegin ()
 Iterator pointing to before the first dof.
 
ConstIteratorType beforeBegin () const
 Iterator pointing to before the first dof.
 
IteratorType find (const SizeType dof)
 Iterator pointing to a given dof (non blocked numbering)
 
ConstIteratorType find (const SizeType dof) const
 Iterator pointing to a given dof (non blocked numbering)
 
SizeType size () const
 Number of blocks.
 
SizeType numDofs () const
 Number of dofs in the block vector.
 
const ThisType & operator+= (const ThisType &other)
 Add another block vector to *this.
 
const ThisType & operator-= (const ThisType &other)
 Subtract another block vector from *this.
 
FieldType operator* (const ThisType &other) const
 Scalar product between *this and another block vector.
 
const ThisType & operator*= (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.
 
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
 

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

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

◆ axpy()

template<class Imp , class Field >
void Dune::Fem::BlockVectorInterface< Imp, Field >::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

◆ copyContent()

template<class Imp , class Field >
void Dune::Fem::BlockVectorInterface< Imp, Field >::copyContent ( const size_t  newIndex,
const size_t  oldIndex 
)
inlineinherited

implements array[ newIndex ] = array[ oldIndex ]

◆ operator*=()

template<class Imp , class Field >
const ThisType & Dune::Fem::BlockVectorInterface< Imp, Field >::operator*= ( const FieldType &  scalar)
inlineinherited

Scale this block vector.

Parameters
[in]scalarFactor for the scaling
Returns
Constant reference to *this

◆ reserve()

template<class Container , unsigned int BlockSize>
void Dune::Fem::MutableBlockVector< Container, 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

◆ usedMemorySize()

template<class Imp , class Field >
std::size_t Dune::Fem::BlockVectorInterface< Imp, Field >::usedMemorySize ( ) const
inlineinherited

return memory used by this block vector


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 27, 22:29, 2024)