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> 32 #ifdef DEAL_II_WITH_TRILINOS 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;
440 void block_write (std::ostream &out)
const;
457 void block_read (std::istream &in);
476 template <
typename Number>
477 template <
typename InputIterator>
479 const InputIterator first,
480 const InputIterator
end)
486 InputIterator start = first;
487 for (size_type b=0; b<n.size(); ++b)
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>
513 template <
typename Number>
525 template <
typename Number>
536 template <
typename Number>
537 template <
typename Number2>
547 template <
typename Number>
551 for (size_type i=0; i<this->
n_blocks(); ++i)
557 template <
typename Number>
563 for (size_type i=0; i<this->
n_blocks(); ++i)
569 template <
typename Number>
570 template <
class BlockVector2>
587 template <
typename Number>
595 DEAL_II_NAMESPACE_CLOSE
BaseClass::value_type value_type
Auxiliary class aiding in the handling of block structures like in BlockVector or FESystem...
void swap(BlockVector &v)
unsigned int n_blocks() const
bool is_finite(const double x)
void swap(BlockVector< Number > &u, BlockVector< Number > &v)
void scale(const BlockVector2 &v)
BlockVectorBase< Vector< Number > > BaseClass
BlockVector & operator=(const value_type s)
void reinit(const std::vector< Epetra_Map > &partitioning, const bool fast=false)
BlockIndices block_indices
DeclException0(ExcIteratorRangeDoesNotMatchVectorSize)
#define Assert(cond, exc)
BlockType::real_type real_type
void print(std::ostream &out, const unsigned int precision=3, const bool scientific=true, const bool across=true) const
BlockCompressedSparsityPattern CompressedBlockSparsityPattern DEAL_II_DEPRECATED
std::vector< Vector > components
void swap(BlockVector< Number > &v)
::ExceptionBase & ExcNumberNotFinite()
void compress() DEAL_II_DEPRECATED
BaseClass::BlockType BlockType
BlockType & block(const unsigned int i)
BlockVectorBase & operator=(const value_type s)