16 #include <deal.II/lac/trilinos_block_vector.h> 18 #ifdef DEAL_II_WITH_TRILINOS 20 # include <deal.II/lac/trilinos_block_sparse_matrix.h> 23 DEAL_II_NAMESPACE_OPEN
33 #ifndef DEAL_II_WITH_64BIT_INDICES 34 int n_global_elements (
const Epetra_BlockMap &map)
36 return map.NumGlobalElements();
39 long long int n_global_elements (
const Epetra_BlockMap &map)
41 return map.NumGlobalElements64();
69 for (size_type i=0; i<this->
n_blocks(); ++i)
79 #ifdef DEAL_II_WITH_CXX11 96 for (size_type i=0; i<this->
n_blocks(); ++i)
111 const bool omit_zeroing_entries)
113 const size_type no_blocks = input_maps.size();
114 std::vector<size_type> block_sizes (no_blocks);
116 for (size_type i=0; i<no_blocks; ++i)
118 block_sizes[i] = n_global_elements(input_maps[i]);
125 for (size_type i=0; i<
n_blocks(); ++i)
135 const MPI_Comm &communicator,
136 const bool omit_zeroing_entries)
138 const size_type no_blocks = parallel_partitioning.size();
139 std::vector<size_type> block_sizes (no_blocks);
141 for (size_type i=0; i<no_blocks; ++i)
143 block_sizes[i] = parallel_partitioning[i].size();
150 for (size_type i=0; i<
n_blocks(); ++i)
151 components[i].
reinit(parallel_partitioning[i], communicator, omit_zeroing_entries);
158 const std::vector<IndexSet> &ghost_values,
159 const MPI_Comm &communicator,
160 const bool vector_writable)
162 const size_type no_blocks = parallel_partitioning.size();
163 std::vector<size_type> block_sizes (no_blocks);
165 for (size_type i=0; i<no_blocks; ++i)
167 block_sizes[i] = parallel_partitioning[i].size();
174 for (size_type i=0; i<
n_blocks(); ++i)
176 communicator, vector_writable);
184 const bool omit_zeroing_entries)
190 for (size_type i=0; i<
n_blocks(); ++i)
201 std::vector<size_type> block_sizes (num_blocks, 0);
206 for (size_type i=0; i<this->
n_blocks(); ++i)
230 for (size_type i=0; i<this->n_blocks(); ++i)
231 components[i].import_nonlocal_data_for_fe(m.
block(i,i), v.
block(i));
239 const unsigned int precision,
240 const bool scientific,
241 const bool across)
const 243 for (size_type i=0; i<this->
n_blocks(); ++i)
246 out <<
'C' << i <<
':';
248 out <<
"Component " << i << std::endl;
249 this->
components[i].print(out, precision, scientific, across);
271 const bool omit_zeroing_entries)
273 size_type no_blocks = input_maps.size();
274 std::vector<size_type> block_sizes (no_blocks);
276 for (size_type i=0; i<no_blocks; ++i)
277 block_sizes[i] = n_global_elements(input_maps[i]);
284 for (size_type i=0; i<
n_blocks(); ++i)
294 const MPI_Comm &communicator,
295 const bool omit_zeroing_entries)
297 size_type no_blocks = partitioning.size();
298 std::vector<size_type> block_sizes (no_blocks);
300 for (size_type i=0; i<no_blocks; ++i)
301 block_sizes[i] = partitioning[i].
size();
308 for (size_type i=0; i<
n_blocks(); ++i)
318 const bool omit_zeroing_entries)
324 for (size_type i=0; i<
n_blocks(); ++i)
339 for (size_type i=0; i<
n_blocks(); ++i)
348 std::vector<size_type> block_sizes (num_blocks, 0);
353 for (size_type i=0; i<
n_blocks(); ++i)
363 const bool omit_zeroing_entries)
369 for (size_type i=0; i<
n_blocks(); ++i)
392 std::vector<size_type> block_sizes (v.
n_blocks(), 0);
398 for (size_type i=0; i<this->
n_blocks(); ++i)
409 const unsigned int precision,
410 const bool scientific,
411 const bool across)
const 413 for (size_type i=0; i<this->
n_blocks(); ++i)
416 out <<
'C' << i <<
':';
418 out <<
"Component " << i << std::endl;
419 this->
components[i].print(out, precision, scientific, across);
426 DEAL_II_NAMESPACE_CLOSE
BaseClass::value_type value_type
BlockIndices block_indices
unsigned int n_block_cols() const
const BlockIndices & get_block_indices() const
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
void reinit(const unsigned int n_blocks, const size_type n_elements_per_block)
BaseClass::value_type value_type
void reinit(const std::vector< Epetra_Map > ¶llel_partitioning, const bool omit_zeroing_entries=false) 1
BlockVector & operator=(const value_type s)
std::vector< Vector > components
BlockVector & operator=(const value_type s)
unsigned int n_blocks() const
void reinit(const std::vector< Epetra_Map > &partitioning, const bool omit_zeroing_entries=false)
void import_nonlocal_data_for_fe(const TrilinosWrappers::BlockSparseMatrix &m, const BlockVector &v)
BlockType & block(const unsigned int row, const unsigned int column)
void swap(BlockVector &v)
unsigned int n_block_rows() const
BlockType & block(const unsigned int i)
BlockVectorBase & operator=(const value_type s)
void print(std::ostream &out, const unsigned int precision=3, const bool scientific=true, const bool across=true) const
void print(std::ostream &out, const unsigned int precision=3, const bool scientific=true, const bool across=true) const