Example #1
0
void MxGeoMultigridPrec::removeConstField(Epetra_MultiVector & x) const {
  //x.Comm().Barrier();
  Epetra_MultiVector ones(x);
  double dotProd, norm;
  ones.PutScalar(1);
  ones.Norm2(&norm);
  x.Dot(ones, &dotProd);
  //std::cout << "norm = " << norm << ", dotProd = " << dotProd << "\n";
  x.Update(-dotProd / norm / norm, ones, 1.);
  x.Dot(ones, &dotProd);
  //std::cout << "const vec part: " << dotProd << "\n";
}
Example #2
0
double MxGeoMultigridPrec::constPart(const Epetra_MultiVector & x) const {
  //x.Comm().Barrier();
  Epetra_MultiVector ones(x);
  double dotProd;
  ones.PutScalar(1);
  x.Dot(ones, &dotProd);
  return dotProd;
}