FEDEM Solver  R8.0
Source code of the dynamics solver
Data Types | Functions/Subroutines
matextensionmodule Module Reference

System matrix extension module. More...

Data Types

interface  cstransform
 Performs a triple matrix multiplication. More...
 
interface  cspremult
 Performs a matrix-matrix multiplication. More...
 
interface  csgetsub12
 Extracts and off-diagonal submatrix from the system matrix. More...
 

Functions/Subroutines

subroutine cstransformmat (aMat, tMat, bMat, ierr)
 Performs a triple matrix multiplication. More...
 
subroutine cstransformvec (aMat, v, bVal, ierr)
 Performs a vector-matrix-vector multiplication. More...
 
subroutine cspremultmat (aMat, bMat, cMat, iflag, ierr)
 Performs a matrix-matrix multiplication. More...
 
subroutine cspremultmatrix (aMat, bMat, ierr)
 Performs a matrix-matrix multiplication. More...
 
subroutine cspremultvec (aMat, bVec, cVec, iflag, ierr)
 Performs a matrix-vector multiplication. More...
 
subroutine cspremultvector (aMat, bVec, ierr)
 Performs a matrix-vector multiplication. More...
 
subroutine, public csaddmat (aMat, bMat, alpha, ierr)
 Performs the matrix operation A = A + α B. More...
 
subroutine, public cscopymat (aMat, bMat, ierr)
 Performs the matrix operation A = B. More...
 
subroutine, public csgetsub11 (sysMat, meqn1, subMat11, ierr)
 Extracts the 11 sub-matrix from a system matrix. More...
 
subroutine csgetsub12dense (sysMat, meqn1, meqn2, subMat12, ierr)
 Extracts the 12 sub-matrix from a system matrix. More...
 
subroutine csgetsub12sparse (sysMat, subMat12, ierr)
 Extracts the 12 sub-matrix from a system matrix. More...
 
subroutine, public csgetsub22 (sysMat, meqn2, subMat22, ierr)
 Extracts the 22 sub-matrix from a system matrix. More...
 
subroutine, public csgetdiag (samData, sysMat, dt, dr, ierr)
 Extracts characteristic measures for a system matrix. More...
 

Detailed Description

System matrix extension module.

This module contains subroutines for performing various operations on system matrices, such as matrix-matrix multiplication, matrix-vector multiplications, and extraction of sub-matrices from the system matrix. The module defines an interface between the FEDEM solver applications and the various linear algebra packages that are being used.

Function/Subroutine Documentation

◆ csaddmat()

subroutine, public matextensionmodule::csaddmat ( type(sysmatrixtype), intent(inout)  aMat,
type(sysmatrixtype), intent(in)  bMat,
real(dp), intent(in)  alpha,
integer, intent(out)  ierr 
)

Performs the matrix operation A = A + α B.

Parameters
aMatSystem matrix A on compact (sparse) form
[in]bMatSystem matrix B on compact (sparse) form
[in]alphaScaling factor α
[out]ierrError flag
Author
Knut Morten Okstad
Date
May 2009

◆ cscopymat()

subroutine, public matextensionmodule::cscopymat ( type(sysmatrixtype), intent(inout)  aMat,
type(sysmatrixtype), intent(in)  bMat,
integer, intent(out)  ierr 
)

Performs the matrix operation A = B.

Parameters
aMatSystem matrix A on compact (sparse) form
[in]bMatSystem matrix B on compact (sparse) form
[out]ierrError flag
Author
Knut Morten Okstad
Date
May 2009
Here is the caller graph for this function:

◆ csgetdiag()

subroutine, public matextensionmodule::csgetdiag ( type(samtype), intent(in)  samData,
type(sysmatrixtype), intent(inout)  sysMat,
real(dp), dimension(3), intent(out)  dt,
real(dp), dimension(3), intent(out)  dr,
integer, intent(out)  ierr 
)

Extracts characteristic measures for a system matrix.

Parameters
[in]samDataData for managing system matrix assembly
[in]sysMatThe system matrix to extract data from
[out]dtMin, mean and max translational diagonal coefficients
[out]drMin, mean and max rotational diagonal coefficients
[out]ierrError flag

The minimum, mean and maximum, translational and rotational, diagonal coefficents are extracted from the given system matrix.

Author
Knut Morten Okstad
Date
Mar 2004
Here is the caller graph for this function:

◆ csgetsub11()

subroutine, public matextensionmodule::csgetsub11 ( type(sysmatrixtype), intent(inout)  sysMat,
integer, dimension(:), intent(in)  meqn1,
real(dp), dimension(:,:), intent(out)  subMat11,
integer, intent(out)  ierr 
)

Extracts the 11 sub-matrix from a system matrix.

Parameters
[in]sysMatThe system matrix to extract the sub-matrix from
[in]meqn1Matrix of status 1 equation numbers
[out]subMat11Extracted sub-matrix
[out]ierrError flag

The system matrix sysMat is stored on compact (sparse) form, but is logically composed of four submatrices, like

    sysMat = | sub11 sub12 |
             | sub21 sub22 |

The sub-matrix sub11 is returned as a dense square matrix.

Author
Knut Morten Okstad
Date
Apr 2011
Here is the caller graph for this function:

◆ csgetsub12dense()

subroutine matextensionmodule::csgetsub12dense ( type(sysmatrixtype), intent(inout)  sysMat,
integer, dimension(:), intent(in)  meqn1,
integer, dimension(:), intent(in)  meqn2,
real(dp), dimension(:,:), intent(out)  subMat12,
integer, intent(out)  ierr 
)

Extracts the 12 sub-matrix from a system matrix.

Parameters
[in]sysMatThe system matrix to extract the sub-matrix from
[in]meqn1Matrix of status 1 equation numbers
[in]meqn2Matrix of status 2 equation numbers
[out]subMat12Extracted sub-matrix
[out]ierrError flag

The system matrix sysMat is stored on compact (sparse) form, but is logically composed of four submatrices, like

    sysMat = | sub11 sub12 |
             | sub21 sub22 |

The sub-matrix sub12 is returned as a dense rectangular matrix.

Author
Bjorn Haugen
Date
Oct 1998
Author
Knut Morten Okstad
Date
Jan 2003

◆ csgetsub12sparse()

subroutine matextensionmodule::csgetsub12sparse ( type(sysmatrixtype), intent(inout)  sysMat,
type(sparsematrixtype), intent(out)  subMat12,
integer, intent(out)  ierr 
)

Extracts the 12 sub-matrix from a system matrix.

Parameters
[in]sysMatThe system matrix to extract the sub-matrix from
[out]subMat12Extracted sub-matrix
[out]ierrError flag

The system matrix sysMat is stored on compact (sparse) form, but is logically composed of four submatrices, like

    sysMat = | sub11 sub12 |
             | sub21 sub22 |

The sub-matrix sub12 is returned as a sparse matrix.

Author
Bjorn Haugen
Date
Jan 1999
Author
Knut Morten Okstad
Date
Jan 2003

◆ csgetsub22()

subroutine, public matextensionmodule::csgetsub22 ( type(sysmatrixtype), intent(inout)  sysMat,
integer, dimension(:), intent(in)  meqn2,
real(dp), dimension(:,:), intent(out)  subMat22,
integer, intent(out)  ierr 
)

Extracts the 22 sub-matrix from a system matrix.

Parameters
[in]sysMatThe system matrix to extract the sub-matrix from
[in]meqn2Matrix of status 2 equation numbers
[out]subMat22Extracted sub-matrix
[out]ierrError flag

The system matrix sysMat is stored on compact (sparse) form, but is logically composed of four submatrices, like

    sysMat = | sub11 sub12 |
             | sub21 sub22 |

The sub-matrix sub22 is returned as a dense square matrix.

Author
Bjorn Haugen
Date
Jan 1999
Author
Knut Morten Okstad
Date
Jan 2003
Here is the caller graph for this function:

◆ cspremultmat()

subroutine matextensionmodule::cspremultmat ( type(sysmatrixtype), intent(inout)  aMat,
real(dp), dimension(:,:), intent(in)  bMat,
real(dp), dimension(:,:), intent(out), target  cMat,
integer, intent(in)  iflag,
integer, intent(out)  ierr 
)

Performs a matrix-matrix multiplication.

Parameters
[in]aMatSystem matrix A
[in]bMatRectangular dense matrix B
[out]cMatResulting matrix C
[in]iflagOperation flag (see below)
[out]ierrError flag

The matrix multiplication C = A B is performed, where A is on compact (sparse) form whereas C and B are dense rectangular matrices. The value on iflag determines the sign on the resulting matrix, as follows:

  • iflag = 0 : C = A B (where B and C may be the same array)
  • iflag = +1 : C = A B (B and C cannot be the same array)
  • iflag = -1 : C = -A B
  • iflag = +2 : C = C + A B
  • iflag = -2 : C = C - A B
Author
Bjorn Haugen
Date
Oct 1998
Author
Knut Morten Okstad
Date
Jan 2003
Here is the caller graph for this function:

◆ cspremultmatrix()

subroutine matextensionmodule::cspremultmatrix ( type(sysmatrixtype), intent(inout)  aMat,
real(dp), dimension(:,:), intent(inout), target  bMat,
integer, intent(out)  ierr 
)

Performs a matrix-matrix multiplication.

Parameters
[in]aMatSystem matrix A
bMatRectangular dense matrix B
[out]ierrError flag

The matrix multiplication B = A B is performed, where A is on compact (sparse) form and B is a dense rectangular matrix.

Author
Knut Morten Okstad
Date
Jan 2018

◆ cspremultvec()

subroutine matextensionmodule::cspremultvec ( type(sysmatrixtype), intent(inout)  aMat,
real(dp), dimension(:), intent(in)  bVec,
real(dp), dimension(:), intent(out), target  cVec,
integer, intent(in)  iflag,
integer, intent(out)  ierr 
)

Performs a matrix-vector multiplication.

Parameters
[in]aMatSystem matrix A
[in]bVecSystem vector b
[out]cVecResulting matrix c
[in]iflagOperation flag (see below)
[out]ierrError flag

The matrix-vector multiplication c = A b is performed, where A is on compact (sparse) form whereas c and b are vectors. The value on iflag determines the sign on the resulting vector, as follows:

  • iflag = +1 : c = A b
  • iflag = -1 : c = -A b
  • iflag = +2 : c = c + A b
  • iflag = -2 : c = c - A b
Author
Bjorn Haugen
Date
Oct 1998
Author
Knut Morten Okstad
Date
Jan 2003
Here is the caller graph for this function:

◆ cspremultvector()

subroutine matextensionmodule::cspremultvector ( type(sysmatrixtype), intent(inout)  aMat,
real(dp), dimension(:), intent(inout), target  bVec,
integer, intent(out)  ierr 
)

Performs a matrix-vector multiplication.

Parameters
[in]aMatSystem matrix A
bVecSystem vector b
[out]ierrError flag

The matrix-vector multiplication b = A b is performed, where A is on compact (sparse) form and b is a vector.

Author
Knut Morten Okstad
Date
Jan 2018

◆ cstransformmat()

subroutine matextensionmodule::cstransformmat ( type(sysmatrixtype), intent(inout)  aMat,
real(dp), dimension(:,:), intent(in)  tMat,
real(dp), dimension(:,:), intent(out)  bMat,
integer, intent(out)  ierr 
)
private

Performs a triple matrix multiplication.

Parameters
[in]aMatSystem matrix A
[in]tMatTransformation matrix T
[out]bMatResulting matrix B
[out]ierrError flag

The matrix multiplication B = T T A T is performed, where A is on compact (sparse) form and T is a dense rectangular matrix.

Author
Bjorn Haugen
Date
Oct 1998
Author
Knut Morten Okstad
Date
Jan 2003

◆ cstransformvec()

subroutine matextensionmodule::cstransformvec ( type(sysmatrixtype), intent(inout)  aMat,
real(dp), dimension(:), intent(in), target  v,
real(dp), intent(out)  bVal,
integer, intent(out)  ierr 
)

Performs a vector-matrix-vector multiplication.

Parameters
[in]aMatSystem matrix A
[in]vSystem vector
[out]bValResulting value
[out]ierrError flag

The multiplication b = v T A v is performed, where A is on compact (sparse) form and v is a vector. The result b is s scalar quantity.

Author
Knut Morten Okstad
Date
Jul 2003