IFEM  90A354
Typedefs | Functions
SPRMatrix.C File Reference

Representation of the system matrix on the SPR-format. More...

#include "SPRMatrix.h"
#include "SAM.h"
#include <numeric>
#include <fstream>
Include dependency graph for SPRMatrix.C:

Typedefs

using Int_Vec = std::vector< Int_ >
 Convenience type alias.
 

Functions

void sprprp_ (const Int_ *madof, const Int_ *minex, const Int_ *mpmnpc, const Int_ *mmnpc, const Int_ *mpmceq, const Int_ *mmceq, const Int_ *msc, const Int_ &nspar, const Int_ &lpu, const Int_ *mpar, Int_ *mspar, const Int_ *meqn, Int_ *iWork, Int_ &ierr)
 Prepares the control information for the sparse assembly process. More...
 
void sprsas_ (const Int_ *mpar, const Int_ *mpmnpc, const Int_ *mmnpc, const Int_ *madof, const Int_ *msc, const Int_ *mpmceq, const Int_ *mmceq, const Int_ *meqn, Int_ *mspar, Int_ *msica, Int_ *iWork, const Int_ &nspar, const Int_ &lpu, Int_ &ierr)
 Computes the SPR-version of the connectivity array mmnpc. More...
 
void sprrnm_ (Int_ *mspar, Int_ *msica, Int_ *iWork, const Int_ &lpu, Int_ &ierr)
 Reorders the equations by means of the SPR-node partition. More...
 
void sprtrs_ (Int_ *mspar, Int_ *msica, Int_ *mtrees, const Int_ *meqn, const Int_ &nspar, const Int_ &nmsica, const Int_ &ntrees, const Int_ &ndof, const Int_ &niwork, Int_ *iWork, Real *rinfo, const Int_ &lpu, Int_ &ierr)
 Analyses the sparsity pattern of the system matrix. More...
 
void sprsmb_ (Int_ *mspar, Int_ *msica, Int_ *mtrees, Int_ *msifa, const Int_ *meqn, Int_ *iWork, const Int_ &lpu, Int_ &ierr)
 Performs the symbolic factorization of the system matrix. More...
 
void sprpmp_ (const Int_ *msica, const Int_ *mtrees, const Int_ *meqn, const Int_ *mpar, Int_ *mspar, Int_ *mvarnc)
 Finalizes the SPR control arrays msica, mtrees and msifa. More...
 
void spradm_ (const Real *eK, const Real *ttcc, const Int_ *mpar, const Int_ *mspar, const Int_ *madof, const Int_ *meqn, const Int_ *mpmnpc, const Int_ *mmnpc, const Int_ *mpmceq, const Int_ *mmceq, const Int_ *msica, const Int_ *mtrees, const Int_ *msifa, const Int_ *mvarnc, Real *values, Real *sysRHS, Int_ *work, const Int_ &iel, const Int_ &nedof, const Int_ &lpu, const Int_ &nrhs, Int_ &ierr)
 Assembles an element matrix EM into the system matrix SM. More...
 
void sprdad_ (const Int_ *mpar, const Int_ *mtrees, const Int_ *msifa, Real *values, const Real &sigma, const Int_ &lpu, Int_ &ierr)
 Adds a scalar value into the diagonal of the system matrix. More...
 
void sprprm_ (const Real *A, const Real *B, Real *C, Real *rWork, const Int_ *mspar, const Int_ *mtrees, const Int_ *msifa, const Int_ &m, const Int_ &n, const Int_ &ksa, const Int_ &iflag, const Int_ &lpu, Int_ &ierr)
 Performs a matrix-matrix multiplication. More...
 
void sprsol_ (const Int_ &iop, const Int_ *mspar, const Int_ *mtrees, const Int_ *msifa, Real *value, Real *B, const Int_ &ldB, const Int_ &nrhs, Real *tol, Int_ *iWork, Real *rWork, const Int_ &lpu, Int_ &ierr)
 Solves the linear equation system Ax=b. More...
 
void sprlax_ (Real *A, Real *B, const Real *tol, const Int_ *mparA, const Int_ *mtreeA, const Int_ *msifA, const Int_ *mparB, const Int_ *mtreeB, const Int_ *msifB, const Int_ &iop, Real *val, Real *vec, Real *rWork, Int_ *iWork, const Real &shift, const Int_ &n, const Int_ &nv, const Int_ &maxl, const Int_ &lpu, const Int_ &ipsw, Int_ &ierr)
 Solves the generalized eigenproblem Ax=λBx. More...
 
void sprprn_ (const Real *L, const Int_ *mspar, const Int_ *mtrees, const Int_ *msifa, const Int_ &lpu, Int_ &ierr)
 Prints the matrix content to the specified Fortran unit number. More...
 
void sprcnv_ (const Real *L, Real *A, const Int_ *mspar, const Int_ *mtrees, const Int_ *msifa, const Int_ &m, const Int_ &ksa, const Int_ &lpu, Int_ &ierr)
 Converts the matrix to a full matrix. More...
 
int openftnfile_ (const char *fname, const ssize_t nchar)
 Opens a temporary file for Fortran print.
 
void closeftnfile_ (const int &iunit)
 Closes a Fortran file.
 
template<class T >
T * copyArr (const T *array, int n)
 Generic function for copying a C-array.
 

Detailed Description

Representation of the system matrix on the SPR-format.

Date
Jan 4 2008
Author
Knut Morten Okstad / SINTEF

Function Documentation

◆ spradm_()

void spradm_ ( const Real eK,
const Real ttcc,
const Int_ *  mpar,
const Int_ *  mspar,
const Int_ *  madof,
const Int_ *  meqn,
const Int_ *  mpmnpc,
const Int_ *  mmnpc,
const Int_ *  mpmceq,
const Int_ *  mmceq,
const Int_ *  msica,
const Int_ *  mtrees,
const Int_ *  msifa,
const Int_ *  mvarnc,
Real values,
Real sysRHS,
Int_ *  work,
const Int_ &  iel,
const Int_ &  nedof,
const Int_ &  lpu,
const Int_ &  nrhs,
Int_ &  ierr 
)

Assembles an element matrix EM into the system matrix SM.

This is a FORTRAN-77 subroutine in the SAM library.

See also
SAM library documentation.

Referenced by SPRMatrix::assemble().

◆ sprcnv_()

void sprcnv_ ( const Real L,
Real A,
const Int_ *  mspar,
const Int_ *  mtrees,
const Int_ *  msifa,
const Int_ &  m,
const Int_ &  ksa,
const Int_ &  lpu,
Int_ &  ierr 
)

Converts the matrix to a full matrix.

This is a FORTRAN-77 subroutine in the SAM library.

See also
SAM library documentation.

Referenced by SPRMatrix::convert().

◆ sprdad_()

void sprdad_ ( const Int_ *  mpar,
const Int_ *  mtrees,
const Int_ *  msifa,
Real values,
const Real sigma,
const Int_ &  lpu,
Int_ &  ierr 
)

Adds a scalar value into the diagonal of the system matrix.

This is a FORTRAN-77 subroutine in the SAM library.

See also
SAM library documentation.

Referenced by SPRMatrix::add().

◆ sprlax_()

void sprlax_ ( Real A,
Real B,
const Real tol,
const Int_ *  mparA,
const Int_ *  mtreeA,
const Int_ *  msifA,
const Int_ *  mparB,
const Int_ *  mtreeB,
const Int_ *  msifB,
const Int_ &  iop,
Real val,
Real vec,
Real rWork,
Int_ *  iWork,
const Real shift,
const Int_ &  n,
const Int_ &  nv,
const Int_ &  maxl,
const Int_ &  lpu,
const Int_ &  ipsw,
Int_ &  ierr 
)

Solves the generalized eigenproblem Ax=λBx.

This is a FORTRAN-77 subroutine in the SAM library.

See also
SAM library documentation.

Referenced by SPRMatrix::solveEig().

◆ sprpmp_()

void sprpmp_ ( const Int_ *  msica,
const Int_ *  mtrees,
const Int_ *  meqn,
const Int_ *  mpar,
Int_ *  mspar,
Int_ *  mvarnc 
)

Finalizes the SPR control arrays msica, mtrees and msifa.

This is a FORTRAN-77 subroutine in the SAM library.

See also
SAM library documentation.

Referenced by SPRMatrix::initAssembly().

◆ sprprm_()

void sprprm_ ( const Real A,
const Real B,
Real C,
Real rWork,
const Int_ *  mspar,
const Int_ *  mtrees,
const Int_ *  msifa,
const Int_ &  m,
const Int_ &  n,
const Int_ &  ksa,
const Int_ &  iflag,
const Int_ &  lpu,
Int_ &  ierr 
)

Performs a matrix-matrix multiplication.

This is a FORTRAN-77 subroutine in the SAM library.

See also
SAM library documentation.

Referenced by SPRMatrix::multiply().

◆ sprprn_()

void sprprn_ ( const Real L,
const Int_ *  mspar,
const Int_ *  mtrees,
const Int_ *  msifa,
const Int_ &  lpu,
Int_ &  ierr 
)

Prints the matrix content to the specified Fortran unit number.

This is a FORTRAN-77 subroutine in the SAM library.

See also
SAM library documentation.

Referenced by SPRMatrix::write().

◆ sprprp_()

void sprprp_ ( const Int_ *  madof,
const Int_ *  minex,
const Int_ *  mpmnpc,
const Int_ *  mmnpc,
const Int_ *  mpmceq,
const Int_ *  mmceq,
const Int_ *  msc,
const Int_ &  nspar,
const Int_ &  lpu,
const Int_ *  mpar,
Int_ *  mspar,
const Int_ *  meqn,
Int_ *  iWork,
Int_ &  ierr 
)

Prepares the control information for the sparse assembly process.

This is a FORTRAN-77 subroutine in the SAM library.

See also
SAM library documentation.

Referenced by SPRMatrix::initAssembly().

◆ sprrnm_()

void sprrnm_ ( Int_ *  mspar,
Int_ *  msica,
Int_ *  iWork,
const Int_ &  lpu,
Int_ &  ierr 
)

Reorders the equations by means of the SPR-node partition.

This is a FORTRAN-77 subroutine in the SAM library.

See also
SAM library documentation.

Referenced by SPRMatrix::initAssembly().

◆ sprsas_()

void sprsas_ ( const Int_ *  mpar,
const Int_ *  mpmnpc,
const Int_ *  mmnpc,
const Int_ *  madof,
const Int_ *  msc,
const Int_ *  mpmceq,
const Int_ *  mmceq,
const Int_ *  meqn,
Int_ *  mspar,
Int_ *  msica,
Int_ *  iWork,
const Int_ &  nspar,
const Int_ &  lpu,
Int_ &  ierr 
)

Computes the SPR-version of the connectivity array mmnpc.

This is a FORTRAN-77 subroutine in the SAM library.

See also
SAM library documentation.

Referenced by SPRMatrix::initAssembly().

◆ sprsmb_()

void sprsmb_ ( Int_ *  mspar,
Int_ *  msica,
Int_ *  mtrees,
Int_ *  msifa,
const Int_ *  meqn,
Int_ *  iWork,
const Int_ &  lpu,
Int_ &  ierr 
)

Performs the symbolic factorization of the system matrix.

This is a FORTRAN-77 subroutine in the SAM library.

See also
SAM library documentation.

Referenced by SPRMatrix::initAssembly().

◆ sprsol_()

void sprsol_ ( const Int_ &  iop,
const Int_ *  mspar,
const Int_ *  mtrees,
const Int_ *  msifa,
Real value,
Real B,
const Int_ &  ldB,
const Int_ &  nrhs,
Real tol,
Int_ *  iWork,
Real rWork,
const Int_ &  lpu,
Int_ &  ierr 
)

Solves the linear equation system Ax=b.

This is a FORTRAN-77 subroutine in the SAM library.

See also
SAM library documentation.

Referenced by SPRMatrix::solve().

◆ sprtrs_()

void sprtrs_ ( Int_ *  mspar,
Int_ *  msica,
Int_ *  mtrees,
const Int_ *  meqn,
const Int_ &  nspar,
const Int_ &  nmsica,
const Int_ &  ntrees,
const Int_ &  ndof,
const Int_ &  niwork,
Int_ *  iWork,
Real rinfo,
const Int_ &  lpu,
Int_ &  ierr 
)

Analyses the sparsity pattern of the system matrix.

This is a FORTRAN-77 subroutine in the SAM library.

See also
SAM library documentation.

Referenced by SPRMatrix::initAssembly().