|
FEDEM Solver
R8.0
Source code of the dynamics solver
|
Module for management of general sparse matrices. More...
Data Types | |
| type | sparsematrixtype |
| Data type representing a rectangular sparse matrix. More... | |
Functions/Subroutines | |
| subroutine | smnullify (this) |
| Initializes a sparse matrix object. More... | |
| subroutine | smallocate (this, nRows, nCols, useInitSize, err) |
| Allocates a sparse matrix object. More... | |
| subroutine | smsetmatrix (this, mRow, mCol, values, err) |
| Initializes a sparse matrix with the given data. More... | |
| integer function | smsize (this, iDim) |
| Returns the dimension of a sparse matrix. More... | |
| subroutine | smdeallocate (this) |
| Deallocates a sparse matrix. More... | |
| subroutine | smtranspose (this) |
| Transposes a sparse matrix. More... | |
| subroutine | smsetvalue (this, value, rInd, cInd, err, lpu) |
| Assigns a matrix element. More... | |
| real(dp) function | smgetvalue (this, rInd, cInd) |
| Returns a matrix element. More... | |
| real(dp) function, dimension(this%nrows) | smgetcol (this, cInd) |
| Returns a matrix column. More... | |
| real(dp) function, dimension(this%ncols) | smgetrow (this, rInd) |
| Returns a matrix row. More... | |
| subroutine | smmattimesvec (this, xVec, yVec, err) |
| Multiplies a sparse matrix with a vector. More... | |
| subroutine | smmattranstimesvec (this, xVec, yVec, err) |
| Multiplies the transpose of a sparse matrix with a vector. More... | |
| subroutine | smshrinktofit (this, err) |
| Reallocates a sparse matrix to exactly fit its dimensions. More... | |
| subroutine | smwrite (this, name, lpu, writeMatrixElms) |
| Writes out the size parameters for a sparse matrix. More... | |
| subroutine, private | smgrow (this, err, lpu) |
| Expands the allocated space for a sparse matrix by a fixed amount. More... | |
Variables | |
| integer, parameter, private | initsize_p = 10000 |
| Initial allocated size for a new sparse matrix. More... | |
| real(dp), parameter, private | growfactor_p = 1.5_dp |
| Relative size increment when the matrix is too small. More... | |
Module for management of general sparse matrices.
This module contains a data type and associated utility routines for representing a general sparse matrix stored on classic coordinate form.
| subroutine sparsematrixmodule::smallocate | ( | type(sparsematrixtype), intent(out) | this, |
| integer, intent(in) | nRows, | ||
| integer, intent(in) | nCols, | ||
| logical, intent(in) | useInitSize, | ||
| integer, intent(out) | err | ||
| ) |
Allocates a sparse matrix object.
| [out] | this | The sparsematrixmodule::sparsematrixtype object to be allocated |
| [in] | nRows | Number of matrix rows |
| [in] | nCols | Number of matrix columns |
| [in] | useInitSize | If .true., perform initial allocation using the sparsematrixmodule::initsize_p value as number of non-zeroes |
| [out] | err | Error indicator |

| subroutine sparsematrixmodule::smdeallocate | ( | type(sparsematrixtype), intent(inout) | this | ) |
Deallocates a sparse matrix.
| this | The sparsematrixmodule::sparsematrixtype object to deallocate |

| real(dp) function, dimension(this%nrows) sparsematrixmodule::smgetcol | ( | type(sparsematrixtype), intent(in) | this, |
| integer, intent(in) | cInd | ||
| ) |
Returns a matrix column.
| [in] | this | The sparsematrixmodule::sparsematrixtype object to return the column for |
| [in] | cInd | Index of the matrix column to return |
| real(dp) function, dimension(this%ncols) sparsematrixmodule::smgetrow | ( | type(sparsematrixtype), intent(in) | this, |
| integer, intent(in) | rInd | ||
| ) |
Returns a matrix row.
| [in] | this | The sparsematrixmodule::sparsematrixtype object to return the row for |
| [in] | rInd | Index of the matrix row to return |
| real(dp) function sparsematrixmodule::smgetvalue | ( | type(sparsematrixtype), intent(in) | this, |
| integer, intent(in) | rInd, | ||
| integer, intent(in) | cInd | ||
| ) |
Returns a matrix element.
| [in] | this | The sparsematrixmodule::sparsematrixtype object to return the element for |
| [in] | rInd | Row index of the matrix element to return |
| [in] | cInd | Column index of the matrix element to return |
|
private |
Expands the allocated space for a sparse matrix by a fixed amount.
| this | The sparsematrixmodule::sparsematrixtype object to expand | |
| [out] | err | Error indicator |
| [in] | lpu | Optional file unit number logging the rellocation |
The number of times n to call this subroutine to grow a matrix to size x with a given growfactor is:
n = log(x) / log(growfactor)

| subroutine sparsematrixmodule::smmattimesvec | ( | type(sparsematrixtype), intent(in) | this, |
| real(dp), dimension(:), intent(in) | xVec, | ||
| real(dp), dimension(:), intent(out) | yVec, | ||
| integer, intent(out) | err | ||
| ) |
Multiplies a sparse matrix with a vector.
| [in] | this | The sparsematrixmodule::sparsematrixtype object (A) being the left-hand-size of the multiplication operation |
| [in] | xVec | The right-hand-side vector (x) of the multiplication |
| [out] | yVec | The resulting vector (y) |
| [out] | err | Error indicator |
Performs the operation y = A * x .
| subroutine sparsematrixmodule::smmattranstimesvec | ( | type(sparsematrixtype), intent(in) | this, |
| real(dp), dimension(:), intent(in) | xVec, | ||
| real(dp), dimension(:), intent(out) | yVec, | ||
| integer, intent(out) | err | ||
| ) |
Multiplies the transpose of a sparse matrix with a vector.
| [in] | this | The sparsematrixmodule::sparsematrixtype object (A) being the left-hand-size of the multiplication operation |
| [in] | xVec | The right-hand-side vector (x) of the multiplication |
| [out] | yVec | The resulting vector (y) |
| [out] | err | Error indicator |
Performs the operation y = At * x .

| subroutine sparsematrixmodule::smnullify | ( | type(sparsematrixtype), intent(out) | this | ) |
Initializes a sparse matrix object.
| [out] | this | The sparsematrixmodule::sparsematrixtype object to be initialized |

| subroutine sparsematrixmodule::smsetmatrix | ( | type(sparsematrixtype), intent(inout) | this, |
| integer, dimension(:), pointer | mRow, | ||
| integer, dimension(:), pointer | mCol, | ||
| real(dp), dimension(:), pointer | values, | ||
| integer, intent(out) | err | ||
| ) |
Initializes a sparse matrix with the given data.
| this | The sparsematrixmodule::sparsematrixtype object to initialize | |
| [in] | mRow | Row indices of the non-zero entries |
| [in] | mCol | Column indices of the non-zero entries |
| [in] | values | All non-zero entries of the matrix |
| [out] | err | Error indicator |

| subroutine sparsematrixmodule::smsetvalue | ( | type(sparsematrixtype), intent(inout) | this, |
| real(dp), intent(in) | value, | ||
| integer, intent(in) | rInd, | ||
| integer, intent(in) | cInd, | ||
| integer, intent(out) | err, | ||
| integer, intent(in), optional | lpu | ||
| ) |
Assigns a matrix element.
| this | The sparsematrixmodule::sparsematrixtype object to receive the new matrix element | |
| [in] | value | The new matrix element value |
| [in] | rInd | Row index of the new matrix element |
| [in] | cInd | Column index of the new matrix element |
| [out] | err | Error indicator |
| [in] | lpu | Optional file unit number for error- and other messages |

| subroutine sparsematrixmodule::smshrinktofit | ( | type(sparsematrixtype), intent(inout) | this, |
| integer, intent(out) | err | ||
| ) |
Reallocates a sparse matrix to exactly fit its dimensions.
| this | The sparsematrixmodule::sparsematrixtype object to reallocate | |
| [out] | err | Error indicator |

| integer function sparsematrixmodule::smsize | ( | type(sparsematrixtype), intent(in) | this, |
| integer, intent(in), optional | iDim | ||
| ) |
Returns the dimension of a sparse matrix.
| [in] | this | The sparsematrixmodule::sparsematrixtype object to return the dimension of |
| [in] | iDim | Which dimension to return the size for:
|

| subroutine sparsematrixmodule::smtranspose | ( | type(sparsematrixtype), intent(inout) | this | ) |
Transposes a sparse matrix.
| this | The sparsematrixmodule::sparsematrixtype object to transpose |
| subroutine sparsematrixmodule::smwrite | ( | type(sparsematrixtype), intent(in) | this, |
| character(len=*), intent(in) | name, | ||
| integer, intent(in) | lpu, | ||
| logical, intent(in), optional | writeMatrixElms | ||
| ) |
Writes out the size parameters for a sparse matrix.
| [in] | this | The sparsematrixmodule::sparsematrixtype object to write size parameters for |
| [in] | name | Matrix identifier |
| [in] | lpu | File unit number to write to |
| [in] | writeMatrixElms | If .true., write out the matrix elements as well |

|
private |
Relative size increment when the matrix is too small.
|
private |
Initial allocated size for a new sparse matrix.