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

Static Public Member Functions

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

Detailed Description

Definition at line 510 of file Schur.cpp.

Member Function Documentation

◆ invertMat()

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

Definition at line 511 of file Schur.cpp.

511 {
513 VectorInt ipiv;
514 VectorDouble lapack_work;
515 const int nb = m.size1();
516
517 if (eps) {
518 for (int cc = 0; cc != nb; ++cc) {
519 m(cc, cc) += eps;
520 }
521 }
522
523 inv.resize(nb, nb, false);
524 inv.clear();
525 auto ptr = &*inv.data().begin();
526 for (int c = 0; c != nb; ++c, ptr += nb + 1)
527 *ptr = -1;
528 ipiv.resize(nb, false);
529 lapack_work.resize(nb * nb, false);
530 const auto info =
531 lapack_dsysv('L', nb, nb, &*m.data().begin(), nb, &*ipiv.begin(),
532 &*inv.data().begin(), nb, &*lapack_work.begin(), nb * nb);
533 if (info != 0)
534 SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
535 "Can not invert matrix info = %d", info);
537 };
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
#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_dsysv(char uplo, __CLPK_integer n, __CLPK_integer nrhs, __CLPK_doublereal *a, __CLPK_integer lda, __CLPK_integer *ipiv, __CLPK_doublereal *b, __CLPK_integer ldb, __CLPK_doublereal *work, __CLPK_integer lwork)
Definition: lapack_wrap.h:220
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
UBlasVector< int > VectorInt
Definition: Types.hpp:67

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