*/
explicit VectorBase(const Vec &v);
- /**
- * The copy assignment operator is deleted to avoid accidental usage with
- * unexpected behavior.
- */
- VectorBase &
- operator=(const VectorBase &) = delete;
-
/**
* Destructor.
*/
void
compress(const VectorOperation::values operation);
+ /**
+ * The copy assignment operator.
+ */
+ VectorBase &
+ operator=(const VectorBase &);
+
/**
* Set all components of the vector to the given number @p s. Simply pass
* this down to the individual block objects, but we still need to declare
+ VectorBase &
+ VectorBase::operator=(const VectorBase &v)
+ {
+ Assert(size() == v.size(), ExcDimensionMismatch(size(), v.size()));
+
+ PetscErrorCode ierr = VecCopy(v, vector);
+ AssertThrow(ierr == 0, ExcPETScError(ierr));
+
+ return *this;
+ }
+
+
+
VectorBase &
VectorBase::operator=(const PetscScalar s)
{
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams