17 #ifndef __deal2__petsc_vector_h 18 #define __deal2__petsc_vector_h 21 #include <deal.II/base/config.h> 23 #ifdef DEAL_II_WITH_PETSC 25 # include <deal.II/base/subscriptor.h> 26 # include <deal.II/lac/exceptions.h> 27 # include <deal.II/lac/petsc_vector_base.h> 28 # include <deal.II/lac/petsc_parallel_vector.h> 29 # include <deal.II/lac/vector.h> 95 explicit Vector (
const size_type n);
103 template <
typename Number>
104 explicit Vector (const ::Vector<Number> &v);
116 explicit Vector (
const Vec &v);
188 template <
typename number>
208 void reinit (
const size_type N,
209 const bool fast =
false);
222 const bool fast =
false);
257 template <
typename number>
311 #if DEAL_II_PETSC_VERSION_LT(3,2,0) 312 ierr = VecDestroy (
vector);
314 ierr = VecDestroy (&
vector);
328 #if DEAL_II_PETSC_VERSION_LT(2,2,0) 329 ierr = VecConvertMPIToSeqAll (static_cast<const Vec &>(v),
337 ierr = VecScatterCreateToAll (static_cast<const Vec &>(v), &ctx, &
vector);
340 #if ((PETSC_VERSION_MAJOR == 2) && \ 341 ((PETSC_VERSION_MINOR < 3) || \ 342 ((PETSC_VERSION_MINOR == 3) && \ 343 (PETSC_VERSION_SUBMINOR < 3)))) 344 ierr = VecScatterBegin (static_cast<const Vec &>(v),
vector,
345 INSERT_VALUES, SCATTER_FORWARD, ctx);
348 ierr = VecScatterEnd (static_cast<const Vec &>(v),
vector,
349 INSERT_VALUES, SCATTER_FORWARD, ctx);
353 ierr = VecScatterBegin (ctx,static_cast<const Vec &>(v),
vector,
354 INSERT_VALUES, SCATTER_FORWARD);
357 ierr = VecScatterEnd (ctx, static_cast<const Vec &>(v),
vector,
358 INSERT_VALUES, SCATTER_FORWARD);
363 #if DEAL_II_PETSC_VERSION_LT(3,2,0) 364 ierr = VecScatterDestroy (ctx);
366 ierr = VecScatterDestroy (&ctx);
376 template <
typename number>
424 for (size_type i=0; i<v.size(); ++i)
427 compress (::VectorOperation::insert);
435 DEAL_II_NAMESPACE_CLOSE
437 #endif // DEAL_II_WITH_PETSC
types::global_dof_index size_type
#define AssertThrow(cond, exc)
Vector & operator=(const Vector &v)
VectorBase & operator=(const PetscScalar s)
static const bool supports_distributed_data
void compress() DEAL_II_DEPRECATED
unsigned int global_dof_index
void reinit(const size_type N, const bool fast=false)
void create_vector(const size_type n)
void swap(Vector &u, Vector &v)