v0.15.0
Loading...
Searching...
No Matches
MoFEM::SchurDSYSV Struct Reference

Static Public Member Functions

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

Detailed Description

Definition at line 1001 of file Schur.cpp.

Member Function Documentation

◆ invertMat()

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

Definition at line 1003 of file Schur.cpp.

1003 {
1005
1006 const auto nb = m.size1();
1007#ifndef NDEBUG
1008 if (nb != m.size2()) {
1009 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1010 "It should be square matrix %ld != %ld", nb, m.size2());
1011 }
1012#endif
1013
1014 inv.resize(nb, nb, false);
1015 inv.swap(m);
1016 m.resize(2 * nb, 2 * nb, false);
1017
1018 VectorInt ipiv(nb);
1019 int info;
1020
1021 // FIXME: add lapack_dsytrf and lapack_dsytri
1022
1023 info = lapack_dgetrf(nb, nb, &*inv.data().begin(), nb, &*ipiv.begin());
1024 if (info)
1025 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1026 "lapack error info = %d", info);
1027 info = lapack_dgetri(nb, &*inv.data().begin(), nb, &*ipiv.begin(),
1028 &*m.data().begin(), m.data().size());
1029 if (info)
1030 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1031 "lapack error info = %d", info);
1032
1034 }
#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)
FTensor::Index< 'm', 3 > m

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