|
FEDEM Solver
R8.0
Source code of the dynamics solver
|
Module for general rectangular matrices with disk storage,. More...
Data Types | |
| type | diskmatrixtype |
| Data type representing a rectangular matrix with disk storage. More... | |
Functions/Subroutines | |
| integer function | dmgetswapsize (n1, n2, autoRamSizeRatio) |
| Returns requested size of one swap section from command-line option. More... | |
| subroutine | dmnullify (this) |
| Initializes a disk matrix object. More... | |
| subroutine | dmwrite (this, lpu, name) |
| Writes out the content of a disk matrix. More... | |
| subroutine | dmopen (this, fileName, fileChkSum, nRows, nCols, status, err, nColSwap, swapSize, wantTag) |
| Opens a disk matrix file for Read/Write or ReadOnly operations. More... | |
| subroutine | dmsetreadonly (this, err, isReadOnly) |
| Toggles between Read/Write and ReadOnly. More... | |
| integer(i8) function | dmsize (this, iDim) |
| Returns the size of the given disk matrix. More... | |
| subroutine | dmclose (this, err) |
| Closes the disk matrix file and releases the associated swap array. More... | |
| subroutine, private | dmgetaddress (this, rInd, cInd, section, index, err) |
| Gets swap section number and local array index for matrix element. More... | |
| subroutine, private | dmswap (this, newSection, err) |
| Writes current section to disk and reads a new one into core. More... | |
| subroutine, private | dmsingledoublecast (this, ielSwap, nelSwap, toSingle) |
| Casts the in-core matrix elements to/from single precision. More... | |
| subroutine | dmsetvalue (this, value, rInd, cInd, err) |
| Assigns a value to a matrix element. More... | |
| real(dp) function | dmgetvalue (this, rInd, cInd, err) |
| Returns the value of a matrix element. More... | |
| real(dp) function, dimension(:,:), pointer | dmgetswapsecptr (this, cInd, err) |
| Returns a pointer to a matrix containing a swap section. More... | |
| real(dp) function, dimension(:), pointer | dmgetcolptr (this, cInd, err) |
| Returns a pointer to column cInd of the given disk matrix. More... | |
| subroutine | dmgetcol (this, cInd, col, err) |
| Gets a column of the given disk matrix. More... | |
| subroutine | dmgetrow (this, rInd, row, err) |
| Gets a row of the given disk matrix. More... | |
| subroutine | dmmattimesvec (this, xVec, yVec, err, doInitialize) |
| Multiplies a disk matrix with a given vector. More... | |
| subroutine | dmmattranstimesvec (this, xVec, yVec, err) |
| Multiplies the transpose of a disk matrix with a given vector. More... | |
| subroutine | dmfindabsmaxrowvalues (this, maxRowVal, err) |
| Finds the absolute maximum value for each row in a disk matrix. More... | |
Variables | |
| integer, parameter | dmold_p = 0 |
| ReadOnly matrix. More... | |
| integer, parameter | dmnsp_p = 1 |
| Write matrix in single precision. More... | |
| integer, parameter | dmndp_p = 2 |
| Write matrix in double precision. More... | |
Module for general rectangular matrices with disk storage,.
This module contains a data type and associated utility routines for representing a general rectangular matrix stored on a disk file. The matrix is stored column-wise on disk and it is therefore adviced to access the matrix in a column-wise fashion to obtain optimal speed.
| subroutine diskmatrixmodule::dmclose | ( | type(diskmatrixtype), intent(inout) | this, |
| integer, intent(out) | err | ||
| ) |
Closes the disk matrix file and releases the associated swap array.
| this | The diskmatrixmodule::diskmatrixtype object to close | |
| [out] | err | Error indicator |


| subroutine diskmatrixmodule::dmfindabsmaxrowvalues | ( | type(diskmatrixtype), intent(inout) | this, |
| real(dp), dimension(:), intent(out) | maxRowVal, | ||
| integer, intent(out) | err | ||
| ) |
Finds the absolute maximum value for each row in a disk matrix.
| this | The diskmatrixmodule::diskmatrixtype object to address | |
| [out] | maxRowVal | Absolute maximum row values |
| [out] | err | Error indicator |


|
private |
Gets swap section number and local array index for matrix element.
| [in] | this | The diskmatrixmodule::diskmatrixtype object to address |
| [in] | rInd | Row index of matrix element to get address of |
| [in] | cInd | Column index of matrix element to get address of |
| [out] | section | Index of swap section containing the matrix element |
| [out] | index | Array index within that swap section for matrix element |
| [out] | err | Error indicator |

| subroutine diskmatrixmodule::dmgetcol | ( | type(diskmatrixtype), intent(inout) | this, |
| integer, intent(in) | cInd, | ||
| real(dp), dimension(:), intent(out) | col, | ||
| integer, intent(out) | err | ||
| ) |
Gets a column of the given disk matrix.
| this | The diskmatrixmodule::diskmatrixtype object to return for | |
| [in] | cInd | Column index to return for |
| [out] | col | Content of the matrix column |
| [out] | err | Error indicator |

| real(dp) function, dimension(:), pointer diskmatrixmodule::dmgetcolptr | ( | type(diskmatrixtype), intent(inout) | this, |
| integer, intent(in) | cInd, | ||
| integer, intent(out) | err | ||
| ) |
Returns a pointer to column cInd of the given disk matrix.
| this | The diskmatrixmodule::diskmatrixtype object to return for | |
| [in] | cInd | Column index to return pointer for |
| [out] | err | Error indicator |


| subroutine diskmatrixmodule::dmgetrow | ( | type(diskmatrixtype), intent(inout) | this, |
| integer, intent(in) | rInd, | ||
| real(dp), dimension(:), intent(out) | row, | ||
| integer, intent(out) | err | ||
| ) |
Gets a row of the given disk matrix.
| this | The diskmatrixmodule::diskmatrixtype object to return for | |
| [in] | rInd | Row index to return for |
| [out] | row | Content of the matrix row |
| [out] | err | Error indicator |

| real(dp) function, dimension(:,:), pointer diskmatrixmodule::dmgetswapsecptr | ( | type(diskmatrixtype), intent(inout) | this, |
| integer, intent(in) | cInd, | ||
| integer, intent(out) | err | ||
| ) |
Returns a pointer to a matrix containing a swap section.
| this | The diskmatrixmodule::diskmatrixtype object to return for | |
| [in] | cInd | Column index for start of swap section to return for |
| [out] | err | Error indicator |
The pointer to the entire swap section starting at column cInd of the given disk matrix. The function can be used for speedy random access of the matrix elements.


| integer function diskmatrixmodule::dmgetswapsize | ( | integer, intent(in), optional | n1, |
| integer, intent(in), optional | n2, | ||
| real(sp), intent(in), optional | autoRamSizeRatio | ||
| ) |
Returns requested size of one swap section from command-line option.
| [in] | n1 | Optional number of matrix rows (for note message only) |
| [in] | n2 | Optional number of matrix columns (for note message only) |
| [in] | autoRamSizeRatio | If present and .true., compute max swap size based on currently available physical memory |

| real(dp) function diskmatrixmodule::dmgetvalue | ( | type(diskmatrixtype), intent(inout) | this, |
| integer, intent(in) | rInd, | ||
| integer, intent(in) | cInd, | ||
| integer, intent(out) | err | ||
| ) |
Returns the value of a matrix element.
| this | The diskmatrixmodule::diskmatrixtype object to return for | |
| [in] | rInd | Row index of matrix element to return |
| [in] | cInd | Column index of matrix element to return |
| [out] | err | Error indicator |

| subroutine diskmatrixmodule::dmmattimesvec | ( | type(diskmatrixtype), intent(inout) | this, |
| real(dp), dimension(:), intent(in) | xVec, | ||
| real(dp), dimension(:), intent(inout) | yVec, | ||
| integer, intent(out) | err, | ||
| logical, intent(in), optional | doInitialize | ||
| ) |
Multiplies a disk matrix with a given vector.
| this | The diskmatrixmodule::diskmatrixtype object (A) to multiply | |
| [in] | xVec | The vector (x) to multiply matrix A with |
| yVec | The resulting vector (y) | |
| [out] | err | Error indicator |
| [in] | doInitialize | If not present or .true., the existing content of yVec is discarded |
One of of the following operations are performed y = A*x y = y + A*x depending on the value of doInitialize.


| subroutine diskmatrixmodule::dmmattranstimesvec | ( | type(diskmatrixtype), intent(inout) | this, |
| real(dp), dimension(:), intent(in) | xVec, | ||
| real(dp), dimension(:), intent(out) | yVec, | ||
| integer, intent(out) | err | ||
| ) |
Multiplies the transpose of a disk matrix with a given vector.
| this | The diskmatrixmodule::diskmatrixtype object (A) to multiply | |
| [in] | xVec | The vector (x) to multiply matrix A with |
| yVec | The resulting vector (y) | |
| [out] | err | Error indicator |
The following operation is performed y = A^t*x

| subroutine diskmatrixmodule::dmnullify | ( | type(diskmatrixtype), intent(out) | this | ) |
Initializes a disk matrix object.
| [out] | this | The diskmatrixmodule::diskmatrixtype object to be initialized |

| subroutine diskmatrixmodule::dmopen | ( | type(diskmatrixtype), intent(out) | this, |
| character(len=*), intent(in) | fileName, | ||
| integer, intent(inout) | fileChkSum, | ||
| integer, intent(in) | nRows, | ||
| integer, intent(in) | nCols, | ||
| integer, intent(in) | status, | ||
| integer, intent(out) | err, | ||
| integer, intent(in), optional | nColSwap, | ||
| integer, intent(in), optional | swapSize, | ||
| character(len=*), intent(in), optional | wantTag | ||
| ) |
Opens a disk matrix file for Read/Write or ReadOnly operations.
| [out] | this | The diskmatrixmodule::diskmatrixtype object to open |
| [in] | fileName | Name of file to read/write matrix content from/to |
| fileChkSum | Check-sum value of the FE part associated with this | |
| [in] | nRows | Number of matrix rows |
| [in] | nCols | Number of matrix columns |
| [in] | status | File opening mode, either diskmatrixmodule::dmold_p, diskmatrixmodule::dmnsp_p or diskmatrixmodule::dmndp_p |
| [out] | err | Error indicator |
| [in] | nColSwap | Optional number of matrix columns per swap section |
| [in] | swapSize | Optional size of swap section in double precision words |
| [in] | wantTag | Expected file tag for ReadOnly matrices |


| subroutine diskmatrixmodule::dmsetreadonly | ( | type(diskmatrixtype), intent(inout) | this, |
| integer, intent(out) | err, | ||
| logical, intent(in), optional | isReadOnly | ||
| ) |
Toggles between Read/Write and ReadOnly.
| this | The diskmatrixmodule::diskmatrixtype object to toggle for | |
| [out] | err | Error indicator |
| [in] | isReadOnly | If present and .false., switch to ReadWrite, otherwise toggle to ReadOnly |
If switching to ReadOnly, the present in-core section is first written to file.


| subroutine diskmatrixmodule::dmsetvalue | ( | type(diskmatrixtype), intent(inout) | this, |
| real(dp), intent(in) | value, | ||
| integer, intent(in) | rInd, | ||
| integer, intent(in) | cInd, | ||
| integer, intent(out) | err | ||
| ) |
Assigns a value to a matrix element.
| this | The diskmatrixmodule::diskmatrixtype object to assign | |
| [in] | value | The value to be assigned |
| [in] | rInd | Row index of matrix element to assign |
| [in] | cInd | Column index of matrix element to assign |
| [out] | err | Error indicator |


|
private |
Casts the in-core matrix elements to/from single precision.
| this | The diskmatrixmodule::diskmatrixtype object to cast for | |
| [in] | ielSwap | Index to first element in swap section |
| [in] | nelSwap | Number of elements in swap section to cast for |
| [in] | toSingle | If .true., cast from double to single precision, otherwise from single to double precision |
It is assumed that the single-precision buffer array diskmatrixmodule::diskmatrixtype::vals is not larger than one column.

| integer(i8) function diskmatrixmodule::dmsize | ( | type(diskmatrixtype), intent(in) | this, |
| integer, intent(in), optional | iDim | ||
| ) |
Returns the size of the given disk matrix.
| [in] | this | The diskmatrixmodule::diskmatrixtype object to get size of |
| [in] | iDim | Which size parameter to return:
|

|
private |
Writes current section to disk and reads a new one into core.
| [in] | this | The diskmatrixmodule::diskmatrixtype object to swap for |
| [in] | newSection | Index of the swap section to read into core |
| [out] | err | Error indicator |


| subroutine diskmatrixmodule::dmwrite | ( | type(diskmatrixtype), intent(inout) | this, |
| integer, intent(in) | lpu, | ||
| character(len=*), intent(in) | name | ||
| ) |
Writes out the content of a disk matrix.
| [in] | this | The diskmatrixmodule::diskmatrixtype object to write out |
| [in] | lpu | File unit number to write to |
| [in] | name | Matrix identifier |

| integer, parameter diskmatrixmodule::dmndp_p = 2 |
Write matrix in double precision.
| integer, parameter diskmatrixmodule::dmnsp_p = 1 |
Write matrix in single precision.
| integer, parameter diskmatrixmodule::dmold_p = 0 |
ReadOnly matrix.