v0.14.0
Static Public Member Functions | List of all members
MoFEM::SchurDGESV Struct Reference

Static Public Member Functions

static auto invertMat (MatrixDouble &m, MatrixDouble &inv)
 

Detailed Description

Definition at line 964 of file Schur.cpp.

Member Function Documentation

◆ invertMat()

static auto MoFEM::SchurDGESV::invertMat ( MatrixDouble m,
MatrixDouble inv 
)
inlinestatic

Definition at line 966 of file Schur.cpp.

966  {
968 
969  const auto nb = m.size1();
970 #ifndef NDEBUG
971  if (nb != m.size2()) {
972  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
973  "It should be square matrix %d != %d", nb, m.size2());
974  }
975 #endif
976 
977  inv.resize(nb, nb, false);
978  inv.swap(m);
979 
980  VectorInt ipiv(nb);
981  int info;
982 
983  info = lapack_dgetrf(nb, nb, &*inv.data().begin(), nb, &*ipiv.begin());
984  if (info)
985  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
986  "lapack error info = %d", info);
987  info = lapack_dgetri(nb, &*inv.data().begin(), nb, &*ipiv.begin(),
988  &*m.data().begin(), m.data().size());
989  if (info)
990  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
991  "lapack error info = %d", info);
992 
994  }

The documentation for this struct was generated from the following file:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
lapack_dgetri
static __CLPK_integer lapack_dgetri(__CLPK_integer n, __CLPK_doublereal *a, __CLPK_integer lda, __CLPK_integer *ipiv, __CLPK_doublereal *work, __CLPK_integer lwork)
Definition: lapack_wrap.h:185
lapack_dgetrf
static __CLPK_integer lapack_dgetrf(__CLPK_integer m, __CLPK_integer n, __CLPK_doublereal *a, __CLPK_integer lda, __CLPK_integer *ipiv)
Definition: lapack_wrap.h:157
MoFEM::Types::VectorInt
UBlasVector< int > VectorInt
Definition: Types.hpp:67
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453