v0.14.0
Static Public Member Functions | List of all members
MoFEM::SchurDSYSV Struct Reference

Static Public Member Functions

static auto invertMat (const SchurElemMats *row_ptr, MatrixDouble &inv, double eps)
 

Detailed Description

Definition at line 1147 of file Schur.cpp.

Member Function Documentation

◆ invertMat()

static auto MoFEM::SchurDSYSV::invertMat ( const SchurElemMats row_ptr,
MatrixDouble inv,
double  eps 
)
inlinestatic

Definition at line 1148 of file Schur.cpp.

1149  {
1151 
1152  auto &m = row_ptr->getMat();
1153 
1154  VectorInt ipiv;
1155  VectorDouble lapack_work;
1156  const int nb = m.size1();
1157 
1158  if (eps) {
1159  for (int cc = 0; cc != nb; ++cc) {
1160  m(cc, cc) += eps;
1161  }
1162  }
1163 
1164  inv.resize(nb, nb, false);
1165  inv.clear();
1166  auto ptr = &*inv.data().begin();
1167  for (int c = 0; c != nb; ++c, ptr += nb + 1)
1168  *ptr = -1;
1169  ipiv.resize(nb, false);
1170  lapack_work.resize(nb * nb, false);
1171  const auto info =
1172  lapack_dsysv('L', nb, nb, &*m.data().begin(), nb, &*ipiv.begin(),
1173  &*inv.data().begin(), nb, &*lapack_work.begin(), nb * nb);
1174  if (info != 0)
1175  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
1176  "Can not invert matrix info = %d", info);
1178  };

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
c
const double c
speed of light (cm/ns)
Definition: initial_diffusion.cpp:39
lapack_dsysv
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
MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition: definitions.h:34
MoFEM::Types::VectorInt
UBlasVector< int > VectorInt
Definition: Types.hpp:67
eps
static const double eps
Definition: check_base_functions_derivatives_on_tet.cpp:11
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
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