17 #ifndef __deal2__block_vector_h
18 #define __deal2__block_vector_h
21 #include <deal.II/base/config.h>
23 #include <deal.II/lac/block_indices.h>
24 #include <deal.II/lac/block_vector_base.h>
29 DEAL_II_NAMESPACE_OPEN
32 #ifdef DEAL_II_WITH_TRILINOS
33 namespace TrilinosWrappers
60 template <
typename Number>
82 typedef typename BaseClass::pointer pointer;
83 typedef typename BaseClass::const_pointer const_pointer;
84 typedef typename BaseClass::reference reference;
85 typedef typename BaseClass::const_reference const_reference;
86 typedef typename BaseClass::size_type size_type;
109 explicit BlockVector (
const unsigned int num_blocks = 0,
110 const size_type block_size = 0);
120 #ifndef DEAL_II_EXPLICIT_CONSTRUCTOR_BUG
141 template <
typename OtherNumber>
147 #ifdef DEAL_II_WITH_TRILINOS
165 BlockVector (
const std::vector<size_type> &block_sizes);
192 template <
typename InputIterator>
194 const InputIterator first,
195 const InputIterator
end);
215 void compress (::VectorOperation::values operation
216 =::VectorOperation::unknown);
238 template <
class Number2>
249 #ifdef DEAL_II_WITH_TRILINOS
278 void reinit (
const unsigned int num_blocks,
279 const size_type block_size = 0,
280 const bool fast =
false);
313 void reinit (
const std::vector<size_type> &N,
314 const bool fast=
false);
331 const bool fast=
false);
359 template <
typename Number2>
361 const bool fast=
false);
383 template <
class BlockVector2>
384 void scale (
const BlockVector2 &v);
422 void print (
const char *format = 0)
const;
427 void print (std::ostream &out,
428 const unsigned int precision = 3,
429 const bool scientific =
true,
430 const bool across =
true)
const;
476 template <
typename Number>
477 template <
typename InputIterator>
479 const InputIterator first,
480 const InputIterator end)
486 InputIterator start = first;
489 InputIterator end = start;
490 std::advance (end, static_cast<signed int>(n[b]));
491 std::copy (start, end, this->block(b).begin());
494 Assert (start == end, ExcIteratorRangeDoesNotMatchVectorSize());
499 template <
typename Number>
507 BaseClass::operator = (s);
513 template <
typename Number>
519 BaseClass::operator = (v);
525 template <
typename Number>
530 BaseClass::operator = (v);
536 template <
typename Number>
537 template <
typename Number2>
543 BaseClass::operator = (v);
547 template <
typename Number>
551 for (
size_type i=0; i<this->n_blocks(); ++i)
552 this->components[i].compress(operation);
557 template <
typename Number>
563 for (
size_type i=0; i<this->n_blocks(); ++i)
564 this->components[i] *= factor;
569 template <
typename Number>
570 template <
class BlockVector2>
573 BaseClass::scale (v);
587 template <
typename Number>
595 DEAL_II_NAMESPACE_CLOSE
BlockIndices block_indices
BaseClass::value_type value_type
BlockVector & operator=(const value_type s)
void block_write(std::ostream &out) const
DeclException0(ExcIteratorRangeDoesNotMatchVectorSize)
Auxiliary class aiding in the handling of block structures like in BlockVector or FESystem...
bool is_finite(const double x)
void swap(BlockVector< Number > &u, BlockVector< Number > &v)
void reinit(const unsigned int num_blocks, const size_type block_size=0, const bool fast=false)
BlockVectorBase< Vector< Number > > BaseClass
void compress() DEAL_II_DEPRECATED
#define Assert(cond, exc)
BlockCompressedSparsityPattern CompressedBlockSparsityPattern DEAL_II_DEPRECATED
BlockType::real_type real_type
void swap(BlockVector< Number > &v)
::ExceptionBase & ExcNumberNotFinite()
BlockVector(const unsigned int num_blocks=0, const size_type block_size=0)
BaseClass::BlockType BlockType
void scale(const value_type factor) DEAL_II_DEPRECATED
void print(const char *format=0) const
void block_read(std::istream &in)