#ifdef DEAL_II_WITH_PETSC
+ namespace internal
+ {
+ template <typename PETSC_Number, typename Number>
+ void copy_petsc_vector (const PETSC_Number *petsc_start_ptr,
+ const PETSC_Number *petsc_end_ptr,
+ Number *ptr)
+ {
+ std::copy(petsc_start_ptr, petsc_end_ptr, ptr);
+ }
+
+ template <typename PETSC_Number, typename Number>
+ void copy_petsc_vector (const std::complex<PETSC_Number> *petsc_start_ptr,
+ const std::complex<PETSC_Number> *petsc_end_ptr,
+ std::complex<Number> *ptr)
+ {
+ std::copy(petsc_start_ptr, petsc_end_ptr, ptr);
+ }
+
+ template <typename PETSC_Number, typename Number>
+ void copy_petsc_vector (const std::complex<PETSC_Number> *petsc_start_ptr,
+ const std::complex<PETSC_Number> *petsc_end_ptr,
+ Number *ptr)
+ {
+ AssertThrow(false, ExcMessage("Tried to copy complex -> real"));
+ }
+ }
+
template <typename Number>
Vector<Number> &
Vector<Number>::operator = (const PETScWrappers::MPI::Vector &petsc_vec)
AssertThrow (ierr == 0, ExcPETScError(ierr));
const size_type vec_size = local_size();
- std::copy (start_ptr, start_ptr + vec_size, begin());
+ internal::copy_petsc_vector (start_ptr, start_ptr + vec_size, begin());
// restore the representation of the vector
ierr = VecRestoreArray (static_cast<const Vec &>(petsc_vec), &start_ptr);
// return a pointer to this object per normal c++ operator overloading
// semantics
return *this;
- }
+ }
#endif