*/
virtual const MPI_Comm &get_mpi_communicator () const;
- /**
- * Return the square of the norm of the vector $v$ with respect to the
- * norm induced by this matrix, i.e. $\left(v,Mv\right)$. This is useful,
- * e.g. in the finite element context, where the $L_2$ norm of a function
- * equals the matrix norm with respect to the mass matrix of the vector
- * representing the nodal values of the finite element function.
- *
- * Obviously, the matrix needs to be quadratic for this operation.
- *
- * The implementation of this function is not as efficient as the one in
- * the @p MatrixBase class used in deal.II (i.e. the original one, not the
- * PETSc wrapper class) since PETSc doesn't support this operation and
- * needs a temporary vector.
- */
- PetscScalar matrix_norm_square (const VectorBase &v) const;
-
- /**
- * Compute the matrix scalar product $\left(u,Mv\right)$.
- *
- * The implementation of this function is not as efficient as the one in
- * the @p MatrixBase class used in deal.II (i.e. the original one, not the
- * PETSc wrapper class) since PETSc doesn't support this operation and
- * needs a temporary vector.
- */
- PetscScalar matrix_scalar_product (const VectorBase &u,
- const VectorBase &v) const;
-
/**
* Return the number of rows of this matrix.
*/
# include <deal.II/lac/petsc_full_matrix.h>
# include <deal.II/lac/petsc_sparse_matrix.h>
# include <deal.II/lac/petsc_parallel_sparse_matrix.h>
-# include <deal.II/lac/petsc_vector.h>
+# include <deal.II/lac/petsc_vector_base.h>
DEAL_II_NAMESPACE_OPEN
PetscScalar
MatrixBase::matrix_norm_square (const VectorBase &v) const
{
- Vector tmp(v.size());
- vmult (tmp, v);
+ VectorBase tmp(v);
+ vmult(tmp, v);
return tmp*v;
}
MatrixBase::matrix_scalar_product (const VectorBase &u,
const VectorBase &v) const
{
- Vector tmp(v.size());
- vmult (tmp, v);
+ VectorBase tmp(u);
+ vmult(tmp, v);
return u*tmp;
}
# include <deal.II/lac/exceptions.h>
# include <deal.II/lac/petsc_compatibility.h>
-# include <deal.II/lac/petsc_vector.h>
+# include <deal.II/lac/petsc_vector_base.h>
# include <deal.II/lac/sparsity_pattern.h>
# include <deal.II/lac/dynamic_sparsity_pattern.h>
template void
SparseMatrix::do_reinit (const DynamicSparsityPattern &,
const bool);
-
- PetscScalar
- SparseMatrix::matrix_norm_square (const VectorBase &v) const
- {
- Vector tmp (v.size());
- vmult (tmp, v);
- return tmp*v;
- }
-
- PetscScalar
- SparseMatrix::matrix_scalar_product (const VectorBase &u,
- const VectorBase &v) const
- {
- Vector tmp (v.size());
- vmult (tmp, v);
- return u*tmp;
- }
}