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 1037 of file Schur.cpp.

Member Function Documentation

◆ invertMat()

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

Definition at line 1039 of file Schur.cpp.

1039  {
1041 
1042  const auto nb = m.size1();
1043 #ifndef NDEBUG
1044  if (nb != m.size2()) {
1045  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1046  "It should be square matrix %d != %d", nb, m.size2());
1047  }
1048 #endif
1049 
1050  inv.resize(nb, nb, false);
1051  inv.swap(m);
1052 
1053  VectorInt ipiv(nb);
1054  int info;
1055 
1056  info = lapack_dgetrf(nb, nb, &*inv.data().begin(), nb, &*ipiv.begin());
1057  if (info)
1058  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1059  "lapack error info = %d", info);
1060  info = lapack_dgetri(nb, &*inv.data().begin(), nb, &*ipiv.begin(),
1061  &*m.data().begin(), m.data().size());
1062  if (info)
1063  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1064  "lapack error info = %d", info);
1065 
1067  }

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