Go to the documentation of this file.
10 #include "ComputeResiduum.h"
12 #include "MathLib/LinAlg/LinAlg.h"
14 namespace ProcessLib
15 {
17  GlobalMatrix const& M, GlobalMatrix const& K,
18  GlobalVector const& b)
19 {
20  using namespace MathLib::LinAlg;
21  GlobalVector residuum;
22  matMult(M, xdot, residuum);
23  matMultAdd(K, x, residuum, residuum);
24  axpy(residuum, -1, b);
25  scale(residuum, -1);
26  return residuum;
27 }
28 } // namespace ProcessLib
Global vector based on Eigen vector.
Definition: EigenVector.h:28
void matMult(PETScMatrix const &A, PETScVector const &x, PETScVector &y)
Definition: LinAlg.cpp:142
void matMultAdd(PETScMatrix const &A, PETScVector const &v1, PETScVector const &v2, PETScVector &v3)
Definition: LinAlg.cpp:152
void scale(PETScVector &x, PetscScalar const a)
Definition: LinAlg.cpp:44
void axpy(PETScVector &y, PetscScalar const a, PETScVector const &x)
Definition: LinAlg.cpp:57
GlobalVector computeResiduum(GlobalVector const &x, GlobalVector const &xdot, GlobalMatrix const &M, GlobalMatrix const &K, GlobalVector const &b)