19#include <petscsystypes.h>
43template <
typename MatrixOrVector>
44void copy(MatrixOrVector
const& x, MatrixOrVector& y)
50template <
typename MatrixOrVector>
51void scale(MatrixOrVector& x,
double const a)
57template <
typename MatrixOrVector>
58void aypx(MatrixOrVector& y,
double const a, MatrixOrVector
const& x)
64template <
typename MatrixOrVector>
65void axpy(MatrixOrVector& y,
double const a, MatrixOrVector
const& x)
71template <
typename MatrixOrVector>
72void axpby(MatrixOrVector& y,
double const a,
double const b,
73 MatrixOrVector
const& x)
79template <
typename MatrixOrVector>
81 MatrixOrVector
const& y);
84template <
typename MatrixOrVector>
85double norm1(MatrixOrVector
const& x);
88template <
typename MatrixOrVector>
89double norm2(MatrixOrVector
const& x);
92template <
typename MatrixOrVector>
95template <
typename MatrixOrVector>
111template <
typename Matrix>
122template <
typename Matrix,
typename Vector>
123void matMult(Matrix
const& A, Vector
const& x, Vector& y)
135template <
typename Matrix,
typename Vector>
136void matMultAdd(Matrix
const& A, Vector
const& v1, Vector
const& v2, Vector& v3)
163void set(PETScVector& x, PetscScalar
const a);
165void copy(PETScVector
const& x, PETScVector& y);
167void scale(PETScVector& x, PetscScalar
const a);
170void aypx(PETScVector& y, PetscScalar
const a, PETScVector
const& x);
173void axpy(PETScVector& y, PetscScalar
const a, PETScVector
const& x);
176void axpby(PETScVector& y, PetscScalar
const a, PetscScalar
const b,
177 PETScVector
const& x);
181void copy(PETScMatrix
const& A, PETScMatrix& B);
184void scale(PETScMatrix& A, PetscScalar
const a);
187void aypx(PETScMatrix& Y, PetscScalar
const a, PETScMatrix
const& X);
190void axpy(PETScMatrix& Y, PetscScalar
const a, PETScMatrix
const& X);
195void matMult(PETScMatrix
const& A, PETScVector
const& x, PETScVector& y);
198void matMultAdd(PETScMatrix
const& A, PETScVector
const& v1,
199 PETScVector
const& v2, PETScVector& v3);
204 PETScVector
const& b, PETScVector& new_b);
237void set(EigenVector& x,
double const a);
239void copy(EigenVector
const& x, EigenVector& y);
241void scale(EigenVector& x,
double const a);
244void aypx(EigenVector& y,
double const a, EigenVector
const& x);
247void axpy(EigenVector& y,
double const a, EigenVector
const& x);
250void axpby(EigenVector& y,
double const a,
double const b,
251 EigenVector
const& x);
255void copy(EigenMatrix
const& A, EigenMatrix& B);
258void scale(EigenMatrix& A,
double const a);
261void aypx(EigenMatrix& Y,
double const a, EigenMatrix
const& X);
264void axpy(EigenMatrix& Y,
double const a, EigenMatrix
const& X);
269void matMult(EigenMatrix
const& A, EigenVector
const& x, EigenVector& y);
272void matMultAdd(EigenMatrix
const& A, EigenVector
const& v1,
273 EigenVector
const& v2, EigenVector& v3);
277 EigenVector
const& b, EigenVector& new_b);
298template <
typename VectorType>
304 OGS_FATAL(
"An invalid norm type has been passed");
315 if (norm_x > std::numeric_limits<double>::epsilon())
317 return norm_diff / norm_x;
321 if (norm_diff < std::numeric_limits<double>::epsilon())
327 return norm_diff / std::numeric_limits<double>::epsilon();
Declaration of class PETScVector, which provides an interface to PETSc vector routines.
double norm(MatrixOrVector const &x, MathLib::VecNormType type)
void linearSysNormalize(PETScMatrix const &, PETScMatrix &, PETScVector const &, PETScVector &)
void finalizeAssembly(PETScMatrix &A)
double norm1(PETScVector const &x)
double normMax(PETScVector const &x)
void copy(PETScVector const &x, PETScVector &y)
void componentwiseDivide(PETScVector &w, PETScVector const &x, PETScVector const &y)
void setLocalAccessibleVector(PETScVector const &x)
void set(PETScVector &x, PetscScalar const a)
void matMult(PETScMatrix const &A, PETScVector const &x, PETScVector &y)
double computeRelativeNorm(VectorType const &x, VectorType const &y, MathLib::VecNormType norm_type)
void matMultAdd(PETScMatrix const &A, PETScVector const &v1, PETScVector const &v2, PETScVector &v3)
double norm2(PETScVector const &x)
void scale(PETScVector &x, PetscScalar const a)
void aypx(PETScVector &y, PetscScalar const a, PETScVector const &x)
void axpy(PETScVector &y, PetscScalar const a, PETScVector const &x)
void axpby(PETScVector &y, PetscScalar const a, PetscScalar const b, PETScVector const &x)