<h3>Specific improvements</h3>
<ol>
+ <li> Changed: PETSc and Trilinos vectors with ghost entries can now be reset to zero
+ using = 0.0;
+ <br>
+ (Timo Heister, 2014/10/14)
+ </li>
+
<li> New: The new function FiniteElement::get_associated_geometry_primitive() allows to
query whether a given degree of freedom is associated with a vertex, line,
quad, or hex.
VectorBase &
VectorBase::operator = (const TrilinosScalar s)
{
- // if we have ghost values, do not allow
- // writing to this vector at all.
- Assert (!has_ghost_elements(), ExcGhostsPresent());
-
Assert (numbers::is_finite(s), ExcNumberNotFinite());
const int ierr = vector->PutScalar(s);
VectorBase &
VectorBase::operator = (const PetscScalar s)
{
- Assert (!has_ghost_elements(), ExcGhostsPresent());
Assert (numbers::is_finite(s), ExcNumberNotFinite());
//TODO[TH]: assert(is_compressed())
- const int ierr = VecSet (vector, s);
+ int ierr = VecSet (vector, s);
AssertThrow (ierr == 0, ExcPETScError(ierr));
+ if (has_ghost_elements())
+ {
+ Vec ghost = PETSC_NULL;
+ ierr = VecGhostGetLocalForm(vector, &ghost);
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+ ierr = VecSet (ghost, s);
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+ ierr = VecGhostRestoreLocalForm(vector, &ghost);
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+ }
+
return *this;
}