
Public Types | |
| typedef VectorType | BlockType |
| typedef BlockType::value_type | value_type |
| typedef value_type * | pointer |
| typedef const value_type * | const_pointer |
| typedef internal::BlockVectorIterators::Iterator < BlockVectorBase, false > | iterator |
| typedef internal::BlockVectorIterators::Iterator < BlockVectorBase, true > | const_iterator |
| typedef BlockType::reference | reference |
| typedef BlockType::const_reference | const_reference |
| typedef std::size_t | size_type |
| typedef BlockType::real_type | real_type |
Public Member Functions | |
| BlockVectorBase () | |
| void | collect_sizes () |
| void | compress () |
| BlockType & | block (const unsigned int i) |
| const BlockType & | block (const unsigned int i) const |
| const BlockIndices & | get_block_indices () const |
| unsigned int | n_blocks () const |
| unsigned int | size () const |
| iterator | begin () |
| const_iterator | begin () const |
| iterator | end () |
| const_iterator | end () const |
| value_type | operator() (const unsigned int i) const |
| reference | operator() (const unsigned int i) |
| BlockVectorBase & | operator= (const value_type s) |
| BlockVectorBase & | operator= (const BlockVectorBase &V) |
| template<class VectorType2 > | |
| BlockVectorBase & | operator= (const BlockVectorBase< VectorType2 > &V) |
| BlockVectorBase & | operator= (const VectorType &v) |
| template<class VectorType2 > | |
| bool | operator== (const BlockVectorBase< VectorType2 > &v) const |
| value_type | operator* (const BlockVectorBase &V) const |
| real_type | norm_sqr () const |
| value_type | mean_value () const |
| real_type | l1_norm () const |
| real_type | l2_norm () const |
| real_type | linfty_norm () const |
| bool | all_zero () const |
| bool | is_non_negative () const |
| BlockVectorBase & | operator+= (const BlockVectorBase &V) |
| BlockVectorBase & | operator-= (const BlockVectorBase &V) |
| template<typename Number > | |
| void | add (const std::vector< unsigned int > &indices, const std::vector< Number > &values) |
| template<typename Number > | |
| void | add (const std::vector< unsigned int > &indices, const Vector< Number > &values) |
| template<typename Number > | |
| void | add (const unsigned int n_elements, const unsigned int *indices, const Number *values) |
| void | add (const value_type s) |
| void | add (const BlockVectorBase &V) |
| void | add (const value_type a, const BlockVectorBase &V) |
| void | add (const value_type a, const BlockVectorBase &V, const value_type b, const BlockVectorBase &W) |
| void | sadd (const value_type s, const BlockVectorBase &V) |
| void | sadd (const value_type s, const value_type a, const BlockVectorBase &V) |
| void | sadd (const value_type s, const value_type a, const BlockVectorBase &V, const value_type b, const BlockVectorBase &W) |
| void | sadd (const value_type s, const value_type a, const BlockVectorBase &V, const value_type b, const BlockVectorBase &W, const value_type c, const BlockVectorBase &X) |
| BlockVectorBase & | operator*= (const value_type factor) |
| BlockVectorBase & | operator/= (const value_type factor) |
| template<class BlockVector2 > | |
| void | scale (const BlockVector2 &v) |
| template<class BlockVector2 > | |
| void | equ (const value_type a, const BlockVector2 &V) |
| void | equ (const value_type a, const BlockVectorBase &V, const value_type b, const BlockVectorBase &W) |
| void | update_ghost_values () const |
| std::size_t | memory_consumption () const |
Protected Attributes | |
| std::vector< VectorType > | components |
| BlockIndices | block_indices |
Friends | |
| class | internal::BlockVectorIterators::Iterator |
| class | BlockVectorBase |
A vector composed of several blocks each representing a vector of its own.
The BlockVector is a collection of Vectors (e.g. of either deal.II Vector objects or PETScWrappers::Vector object). Each of the vectors inside can have a different size.
The functionality of BlockVector includes everything a Vector can do, plus the access to a single Vector inside the BlockVector by block(i). It also has a complete random access iterator, just as the other Vector classes or the standard C++ library template std::vector. Therefore, all algorithms working on iterators also work with objects of this class.
While this base class implements most of the functionality by dispatching calls to its member functions to the respective functions on each of the individual blocks, this class does not actually allocate some memory or change the size of vectors. For this, the constructors, assignment operators and reinit() functions of derived classes are responsible. This class only handles the common part that is independent of the actual vector type the block vector is built on.
Apart from using this object as a whole, you can use each block separately as a vector, using the block() function. There is a single caveat: if you have changed the size of one or several blocks, you must call the function collect_sizes() of the block vector to update its internal structures.
Definition at line 719 of file block_vector_base.h.
| typedef VectorType BlockVectorBase< VectorType >::BlockType |
Typedef the type of the underlying vector.
Reimplemented in BlockVector< Number >, parallel::distributed::BlockVector< Number >, PETScWrappers::BlockVector, PETScWrappers::MPI::BlockVector, TrilinosWrappers::MPI::BlockVector, and TrilinosWrappers::BlockVector.
Definition at line 726 of file block_vector_base.h.
| typedef BlockType::value_type BlockVectorBase< VectorType >::value_type |
Reimplemented in BlockVector< Number >, parallel::distributed::BlockVector< Number >, PETScWrappers::BlockVector, PETScWrappers::MPI::BlockVector, TrilinosWrappers::MPI::BlockVector, and TrilinosWrappers::BlockVector.
Definition at line 738 of file block_vector_base.h.
| typedef value_type* BlockVectorBase< VectorType >::pointer |
Reimplemented in BlockVector< Number >, parallel::distributed::BlockVector< Number >, PETScWrappers::BlockVector, PETScWrappers::MPI::BlockVector, TrilinosWrappers::MPI::BlockVector, and TrilinosWrappers::BlockVector.
Definition at line 739 of file block_vector_base.h.
| typedef const value_type* BlockVectorBase< VectorType >::const_pointer |
Reimplemented in BlockVector< Number >, parallel::distributed::BlockVector< Number >, PETScWrappers::BlockVector, PETScWrappers::MPI::BlockVector, TrilinosWrappers::MPI::BlockVector, and TrilinosWrappers::BlockVector.
Definition at line 740 of file block_vector_base.h.
| typedef internal::BlockVectorIterators::Iterator<BlockVectorBase,false> BlockVectorBase< VectorType >::iterator |
Reimplemented in BlockVector< Number >, parallel::distributed::BlockVector< Number >, PETScWrappers::BlockVector, PETScWrappers::MPI::BlockVector, TrilinosWrappers::MPI::BlockVector, and TrilinosWrappers::BlockVector.
Definition at line 741 of file block_vector_base.h.
| typedef internal::BlockVectorIterators::Iterator<BlockVectorBase,true> BlockVectorBase< VectorType >::const_iterator |
Reimplemented in BlockVector< Number >, parallel::distributed::BlockVector< Number >, PETScWrappers::BlockVector, PETScWrappers::MPI::BlockVector, TrilinosWrappers::MPI::BlockVector, and TrilinosWrappers::BlockVector.
Definition at line 742 of file block_vector_base.h.
| typedef BlockType::reference BlockVectorBase< VectorType >::reference |
Reimplemented in BlockVector< Number >, parallel::distributed::BlockVector< Number >, PETScWrappers::BlockVector, PETScWrappers::MPI::BlockVector, TrilinosWrappers::MPI::BlockVector, and TrilinosWrappers::BlockVector.
Definition at line 743 of file block_vector_base.h.
| typedef BlockType::const_reference BlockVectorBase< VectorType >::const_reference |
Reimplemented in BlockVector< Number >, parallel::distributed::BlockVector< Number >, PETScWrappers::BlockVector, PETScWrappers::MPI::BlockVector, TrilinosWrappers::MPI::BlockVector, and TrilinosWrappers::BlockVector.
Definition at line 744 of file block_vector_base.h.
| typedef std::size_t BlockVectorBase< VectorType >::size_type |
Reimplemented in BlockVector< Number >, parallel::distributed::BlockVector< Number >, PETScWrappers::BlockVector, PETScWrappers::MPI::BlockVector, TrilinosWrappers::MPI::BlockVector, and TrilinosWrappers::BlockVector.
Definition at line 746 of file block_vector_base.h.
| typedef BlockType::real_type BlockVectorBase< VectorType >::real_type |
Declare a type that has holds real-valued numbers with the same precision as the template argument to this class. If the template argument of this class is a real data type, then real_type equals the template argument. If the template argument is a std::complex type then real_type equals the type underlying the complex numbers.
This typedef is used to represent the return type of norms.
Reimplemented in BlockVector< Number >, and parallel::distributed::BlockVector< Number >.
Definition at line 767 of file block_vector_base.h.
| BlockVectorBase< VectorType >::BlockVectorBase | ( | ) |
Default constructor.
| void BlockVectorBase< VectorType >::collect_sizes | ( | ) |
Update internal structures after resizing vectors. Whenever you reinited a block of a block vector, the internal data structures are corrupted. Therefore, you should call this function after al blocks got their new size.
| void BlockVectorBase< VectorType >::compress | ( | ) |
Call the compress() function on all the subblocks of the matrix.
| BlockType& BlockVectorBase< VectorType >::block | ( | const unsigned int | i ) |
Access to a single block.
Referenced by PETScWrappers::BlockVector::BlockVector(), PETScWrappers::MPI::BlockVector::reinit(), PETScWrappers::BlockVector::reinit(), TrilinosWrappers::BlockVector::swap(), and TrilinosWrappers::MPI::BlockVector::swap().
| const BlockType& BlockVectorBase< VectorType >::block | ( | const unsigned int | i ) | const |
Read-only access to a single block.
| const BlockIndices& BlockVectorBase< VectorType >::get_block_indices | ( | ) | const |
Return a reference on the object that describes the mapping between block and global indices. The use of this function is highly deprecated and it should vanish in one of the next versions
Referenced by PETScWrappers::BlockVector::BlockVector(), PETScWrappers::MPI::BlockVector::reinit(), and PETScWrappers::BlockVector::reinit().
| unsigned int BlockVectorBase< VectorType >::n_blocks | ( | ) | const |
Number of blocks.
Referenced by TrilinosWrappers::BlockVector::BlockVector(), TrilinosWrappers::MPI::BlockVector::BlockVector(), PETScWrappers::MPI::BlockVector::BlockVector(), PETScWrappers::BlockVector::BlockVector(), TrilinosWrappers::BlockVector::swap(), TrilinosWrappers::MPI::BlockVector::swap(), PETScWrappers::MPI::BlockVector::swap(), and PETScWrappers::BlockVector::swap().
| unsigned int BlockVectorBase< VectorType >::size | ( | ) | const |
Return dimension of the vector. This is the sum of the dimensions of all components.
| iterator BlockVectorBase< VectorType >::begin | ( | ) |
Return an iterator pointing to the first element.
| const_iterator BlockVectorBase< VectorType >::begin | ( | ) | const |
Return an iterator pointing to the first element of a constant block vector.
| iterator BlockVectorBase< VectorType >::end | ( | ) |
Return an iterator pointing to the element past the end.
| const_iterator BlockVectorBase< VectorType >::end | ( | ) | const |
Return an iterator pointing to the element past the end of a constant block vector.
| value_type BlockVectorBase< VectorType >::operator() | ( | const unsigned int | i ) | const |
Access components, returns U(i).
| reference BlockVectorBase< VectorType >::operator() | ( | const unsigned int | i ) |
Access components, returns U(i) as a writeable reference.
| BlockVectorBase& BlockVectorBase< VectorType >::operator= | ( | const value_type | s ) |
Copy operator: fill all components of the vector with the given scalar value.
| BlockVectorBase& BlockVectorBase< VectorType >::operator= | ( | const BlockVectorBase< VectorType > & | V ) |
Copy operator for arguments of the same type.
| BlockVectorBase& BlockVectorBase< VectorType >::operator= | ( | const BlockVectorBase< VectorType2 > & | V ) |
Copy operator for template arguments of different types.
| BlockVectorBase& BlockVectorBase< VectorType >::operator= | ( | const VectorType & | v ) |
Copy operator from non-block vectors to block vectors.
Reimplemented in BlockVector< Number >.
| bool BlockVectorBase< VectorType >::operator== | ( | const BlockVectorBase< VectorType2 > & | v ) | const |
Check for equality of two block vector types. This operation is only allowed if the two vectors already have the same block structure.
| value_type BlockVectorBase< VectorType >::operator* | ( | const BlockVectorBase< VectorType > & | V ) | const |
: scalar product.
| real_type BlockVectorBase< VectorType >::norm_sqr | ( | ) | const |
Return square of the
-norm.
| value_type BlockVectorBase< VectorType >::mean_value | ( | ) | const |
Return the mean value of the elements of this vector.
| real_type BlockVectorBase< VectorType >::l1_norm | ( | ) | const |
Return the
-norm of the vector, i.e. the sum of the absolute values.
| real_type BlockVectorBase< VectorType >::l2_norm | ( | ) | const |
Return the
-norm of the vector, i.e. the square root of the sum of the squares of the elements.
| real_type BlockVectorBase< VectorType >::linfty_norm | ( | ) | const |
Return the maximum absolute value of the elements of this vector, which is the
-norm of a vector.
| bool BlockVectorBase< VectorType >::all_zero | ( | ) | const |
Return whether the vector contains only elements with value zero. This function is mainly for internal consistency check and should seldomly be used when not in debug mode since it uses quite some time.
| bool BlockVectorBase< VectorType >::is_non_negative | ( | ) | const |
Return true if the vector has no negative entries, i.e. all entries are zero or positive. This function is used, for example, to check whether refinement indicators are really all positive (or zero).
| BlockVectorBase& BlockVectorBase< VectorType >::operator+= | ( | const BlockVectorBase< VectorType > & | V ) |
Addition operator. Fast equivalent to U.add(1, V).
| BlockVectorBase& BlockVectorBase< VectorType >::operator-= | ( | const BlockVectorBase< VectorType > & | V ) |
Subtraction operator. Fast equivalent to U.add(-1, V).
| void BlockVectorBase< VectorType >::add | ( | const std::vector< unsigned int > & | indices, |
| const std::vector< Number > & | values | ||
| ) |
A collective add operation: This funnction adds a whole set of values stored in values to the vector components specified by indices.
| void BlockVectorBase< VectorType >::add | ( | const std::vector< unsigned int > & | indices, |
| const Vector< Number > & | values | ||
| ) |
This is a second collective add operation. As a difference, this function takes a deal.II vector of values.
| void BlockVectorBase< VectorType >::add | ( | const unsigned int | n_elements, |
| const unsigned int * | indices, | ||
| const Number * | values | ||
| ) |
Take an address where n_elements are stored contiguously and add them into the vector. Handles all cases which are not covered by the other two add() functions above.
| void BlockVectorBase< VectorType >::add | ( | const value_type | s ) |
. Addition of s to all components. Note that s is a scalar and not a vector.
| void BlockVectorBase< VectorType >::add | ( | const BlockVectorBase< VectorType > & | V ) |
U+=V. Simple vector addition, equal to the operator +=.
| void BlockVectorBase< VectorType >::add | ( | const value_type | a, |
| const BlockVectorBase< VectorType > & | V | ||
| ) |
U+=a*V. Simple addition of a scaled vector.
| void BlockVectorBase< VectorType >::add | ( | const value_type | a, |
| const BlockVectorBase< VectorType > & | V, | ||
| const value_type | b, | ||
| const BlockVectorBase< VectorType > & | W | ||
| ) |
U+=a*V+b*W. Multiple addition of scaled vectors.
| void BlockVectorBase< VectorType >::sadd | ( | const value_type | s, |
| const BlockVectorBase< VectorType > & | V | ||
| ) |
U=s*U+V. Scaling and simple vector addition.
| void BlockVectorBase< VectorType >::sadd | ( | const value_type | s, |
| const value_type | a, | ||
| const BlockVectorBase< VectorType > & | V | ||
| ) |
U=s*U+a*V. Scaling and simple addition.
| void BlockVectorBase< VectorType >::sadd | ( | const value_type | s, |
| const value_type | a, | ||
| const BlockVectorBase< VectorType > & | V, | ||
| const value_type | b, | ||
| const BlockVectorBase< VectorType > & | W | ||
| ) |
U=s*U+a*V+b*W. Scaling and multiple addition.
| void BlockVectorBase< VectorType >::sadd | ( | const value_type | s, |
| const value_type | a, | ||
| const BlockVectorBase< VectorType > & | V, | ||
| const value_type | b, | ||
| const BlockVectorBase< VectorType > & | W, | ||
| const value_type | c, | ||
| const BlockVectorBase< VectorType > & | X | ||
| ) |
U=s*U+a*V+b*W+c*X. Scaling and multiple addition.
| BlockVectorBase& BlockVectorBase< VectorType >::operator*= | ( | const value_type | factor ) |
Scale each element of the vector by a constant value.
| BlockVectorBase& BlockVectorBase< VectorType >::operator/= | ( | const value_type | factor ) |
Scale each element of the vector by the inverse of the given value.
| void BlockVectorBase< VectorType >::scale | ( | const BlockVector2 & | v ) |
Multiply each element of this vector by the corresponding element of v.
Reimplemented in BlockVector< Number >, and parallel::distributed::BlockVector< Number >.
| void BlockVectorBase< VectorType >::equ | ( | const value_type | a, |
| const BlockVector2 & | V | ||
| ) |
U=a*V. Assignment.
| void BlockVectorBase< VectorType >::equ | ( | const value_type | a, |
| const BlockVectorBase< VectorType > & | V, | ||
| const value_type | b, | ||
| const BlockVectorBase< VectorType > & | W | ||
| ) |
U=a*V+b*W. Replacing by sum.
| void BlockVectorBase< VectorType >::update_ghost_values | ( | ) | const |
This function does nothing but is there for compatibility with the PETScWrappers::Vector class.
For the PETSc vector wrapper class, this function updates the ghost values of the PETSc vector. This is necessary after any modification before reading ghost values.
However, for the implementation of this class, it is immaterial and thus an empty function.
| std::size_t BlockVectorBase< VectorType >::memory_consumption | ( | ) | const |
Determine an estimate for the memory consumption (in bytes) of this object.
friend class internal::BlockVectorIterators::Iterator [friend] |
Make the iterator class a friend. We have to work around a compiler bug here again.
Definition at line 1151 of file block_vector_base.h.
friend class BlockVectorBase [friend] |
Definition at line 1157 of file block_vector_base.h.
std::vector<VectorType> BlockVectorBase< VectorType >::components [protected] |
Pointer to the array of components.
Definition at line 1134 of file block_vector_base.h.
Referenced by TrilinosWrappers::BlockVector::BlockVector(), TrilinosWrappers::MPI::BlockVector::BlockVector(), PETScWrappers::MPI::BlockVector::BlockVector(), PETScWrappers::BlockVector::BlockVector(), PETScWrappers::MPI::BlockVector::swap(), and PETScWrappers::BlockVector::swap().
BlockIndices BlockVectorBase< VectorType >::block_indices [protected] |
Object managing the transformation between global indices and indices within the different blocks.
Definition at line 1142 of file block_vector_base.h.
Referenced by TrilinosWrappers::BlockVector::BlockVector(), TrilinosWrappers::MPI::BlockVector::BlockVector(), PETScWrappers::MPI::BlockVector::BlockVector(), PETScWrappers::BlockVector::BlockVector(), PETScWrappers::MPI::BlockVector::swap(), and PETScWrappers::BlockVector::swap().
documentation generated on Fri Feb 3 2012 06:04:06 by
doxygen
1.7.2