v0.16.3
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
MoFEM::SchurDSYSV Struct Reference

Static Public Member Functions

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

Detailed Description

Definition at line 1230 of file Schur.cpp.

Member Function Documentation

◆ invertMat()

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

Definition at line 1232 of file Schur.cpp.

1232 {
1234
1235 const auto nb = m.size1();
1236#ifndef NDEBUG
1237 if (nb != m.size2()) {
1238 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1239 "It should be square matrix %zu != %zu", nb, m.size2());
1240 }
1241#endif
1242
1243 inv.resize(nb, nb, false);
1244 inv.swap(m);
1245 m.resize(2 * nb, 2 * nb, false);
1246
1247 VectorInt ipiv(nb);
1248 int info;
1249
1250 // FIXME: add lapack_dsytrf and lapack_dsytri
1251
1252 info = lapack_dgetrf(nb, nb, &*inv.data().begin(), nb, &*ipiv.begin());
1253 if (info)
1254 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1255 "lapack error info = %d", info);
1256 info = lapack_dgetri(nb, &*inv.data().begin(), nb, &*ipiv.begin(),
1257 &*m.data().begin(), m.data().size());
1258 if (info)
1259 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1260 "lapack error info = %d", info);
1261
1263 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
static __CLPK_integer lapack_dgetrf(__CLPK_integer m, __CLPK_integer n, __CLPK_doublereal *a, __CLPK_integer lda, __CLPK_integer *ipiv)
static __CLPK_integer lapack_dgetri(__CLPK_integer n, __CLPK_doublereal *a, __CLPK_integer lda, __CLPK_integer *ipiv, __CLPK_doublereal *work, __CLPK_integer lwork)
UBlasVector< int > VectorInt
Definition Types.hpp:67
FTensor::Index< 'm', 3 > m

The documentation for this struct was generated from the following file: