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

Static Public Member Functions

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

Detailed Description

Definition at line 470 of file Schur.cpp.

Member Function Documentation

◆ invertMat()

static auto MoFEM::SCHUR_DGESV::invertMat ( MatrixDouble m,
MatrixDouble inv,
double  eps 
)
inlinestatic

Definition at line 471 of file Schur.cpp.

471 {
473 VectorInt ipiv;
474 const auto nb = m.size1();
475#ifndef NDEBUG
476 if (nb != m.size2()) {
477 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
478 "It should be square matrix");
479 }
480#endif
481
482 if (eps) {
483 for (int cc = 0; cc != nb; ++cc) {
484 m(cc, cc) += eps;
485 }
486 }
487
488 inv.resize(nb, nb, false);
489 inv.clear();
490 for (int c = 0; c != nb; ++c)
491 inv(c, c) = -1;
492 ipiv.resize(nb, false);
493 const auto info = lapack_dgesv(nb, nb, &*m.data().begin(), nb,
494 &*ipiv.begin(), &*inv.data().begin(), nb);
495 if (info != 0)
496 SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
497 "Can not invert matrix info = %d", info);
499 };
static const double eps
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition: definitions.h:34
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
FTensor::Index< 'm', SPACE_DIM > m
const double c
speed of light (cm/ns)
static __CLPK_integer lapack_dgesv(__CLPK_integer n, __CLPK_integer nrhs, __CLPK_doublereal *a, __CLPK_integer lda, __CLPK_integer *ipiv, __CLPK_doublereal *b, __CLPK_integer ldb)
Definition: lapack_wrap.h:176
UBlasVector< int > VectorInt
Definition: Types.hpp:67

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