17 #ifndef __deal2__trilinos_parallel_block_vector_h
18 #define __deal2__trilinos_parallel_block_vector_h
21 #include <deal.II/base/config.h>
23 #ifdef DEAL_II_WITH_TRILINOS
25 # include <deal.II/lac/trilinos_vector.h>
26 # include <deal.II/lac/block_indices.h>
27 # include <deal.II/lac/block_vector_base.h>
28 # include <deal.II/lac/exceptions.h>
92 typedef BaseClass::pointer pointer;
93 typedef BaseClass::const_pointer const_pointer;
94 typedef BaseClass::reference reference;
95 typedef BaseClass::const_reference const_reference;
96 typedef BaseClass::size_type size_type;
115 explicit BlockVector (
const std::vector<Epetra_Map> ¶llel_partitioning);
127 explicit BlockVector (
const std::vector<IndexSet> ¶llel_partitioning,
128 const MPI_Comm &communicator = MPI_COMM_WORLD);
135 BlockVector (
const std::vector<IndexSet> ¶llel_partitioning,
136 const std::vector<IndexSet> &ghost_values,
137 const MPI_Comm &communicator);
187 operator = (const ::TrilinosWrappers::BlockVector &V);
209 template <
typename Number>
225 void reinit (
const std::vector<Epetra_Map> ¶llel_partitioning,
226 const bool fast =
false);
240 void reinit (
const std::vector<IndexSet> ¶llel_partitioning,
241 const MPI_Comm &communicator = MPI_COMM_WORLD,
242 const bool fast =
false);
247 void reinit (
const std::vector<IndexSet> &partitioning,
248 const std::vector<IndexSet> &ghost_values,
249 const MPI_Comm &communicator = MPI_COMM_WORLD);
279 const bool fast =
false);
292 void reinit (
const size_type num_blocks);
406 void print (std::ostream &out,
407 const unsigned int precision = 3,
408 const bool scientific =
true,
409 const bool across =
true)
const;
436 reinit (parallel_partitioning,
false);
443 const MPI_Comm &communicator)
445 reinit (parallel_partitioning, communicator,
false);
451 const std::vector<IndexSet> &ghost_values,
452 const MPI_Comm &communicator)
454 reinit(parallel_partitioning, ghost_values, communicator);
474 for (size_type i=0; i<this->
n_blocks(); ++i)
484 bool compressed =
true;
485 for (
unsigned int row=0; row<
n_blocks(); ++row)
486 if (
block(row).is_compressed() ==
false)
501 ::VectorOperation::values last_action_ =
502 ::VectorOperation::unknown;
503 if (last_action == Add)
504 last_action_ = ::VectorOperation::add;
505 else if (last_action == Insert)
506 last_action_ = ::VectorOperation::insert;
515 template <
typename Number>
521 std::vector<size_type> block_sizes (v.n_blocks(), 0);
527 for (size_type i=0; i<this->
n_blocks(); ++i)
540 bool ghosted=
block(0).has_ghost_elements();
542 for (
unsigned int i=0; i<this->
n_blocks(); ++i)
555 for (
unsigned int row=0; row<
n_blocks(); ++row)
582 DEAL_II_NAMESPACE_CLOSE
584 #endif // DEAL_II_WITH_TRILINOS
BaseClass::value_type value_type
void import_nonlocal_data_for_fe(const TrilinosWrappers::BlockSparseMatrix &m, const BlockVector &v)
unsigned int n_blocks() const
#define AssertThrow(cond, exc)
bool is_compressed() const
BlockVectorBase< Vector > BaseClass
BlockIndices block_indices
#define Assert(cond, exc)
void reinit(const unsigned int n_blocks, const size_type n_elements_per_block)
BlockCompressedSparsityPattern CompressedBlockSparsityPattern DEAL_II_DEPRECATED
std::vector< Vector > components
BlockVector & operator=(const value_type s)
virtual void swap(Vector< Number > &v)
void print(std::ostream &out, const unsigned int precision=3, const bool scientific=true, const bool across=true) const
void swap(BlockVector &v)
void compress() DEAL_II_DEPRECATED
::ExceptionBase & ExcNotImplemented()
BaseClass::BlockType BlockType
::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
void reinit(const std::vector< Epetra_Map > ¶llel_partitioning, const bool fast=false)
::ExceptionBase & ExcInternalError()
void swap(BlockVector &u, BlockVector &v)
BlockType & block(const unsigned int i)
bool has_ghost_elements() const
DeclException0(ExcIteratorRangeDoesNotMatchVectorSize)