FEDEM Solver
R8.0
Source code of the dynamics solver
|
Module with data types and utility subroutines for system matrices. More...
Data Types | |
type | skylinestoragetype |
Data type for skyline matrix storage. More... | |
type | sparsestoragetype |
Data type for sparse matrix storage (SPR solver). More... | |
type | gsfstoragetype |
Data type for sparse matrix storage (GSF solver). More... | |
type | pardisostoragetype |
Data type for sparse matrix storage (PARDISO solver). More... | |
type | sysmatrixtype |
Data type for a system coefficient matrix. More... | |
interface | reallocate |
Reallocates a data object. More... | |
interface | check |
Performs consistency checking of a data object. More... | |
interface | writeobject |
Standard routine for writing an object to file. More... | |
Functions/Subroutines | |
logical function | isallocated (this) |
Checks if a system matrix object is allocated or not. More... | |
subroutine | nullifysysmatrix (this) |
Initializes a system matrix object. More... | |
subroutine | sharematrixstructure (this, that, needsFactorization, newType, ierr) |
Lets one system matrix object share the data structure of another. More... | |
subroutine | allocatesysmatrix (sysMat, ierr, lpu, chName) |
Allocates storage for a system matrix. More... | |
subroutine | deallocatesysmatrix (this, ierr) |
Deallocates all dynamic arrays for a system matrix object. More... | |
subroutine, private | reallocatesysmat (label, this, newAlloc, ierr) |
Allocates, reallocates or deallocates a system matrix object. More... | |
subroutine, private | reallocateskyline (label, this, newAlloc, ierr) |
Allocates, reallocates or deallocates a skyline storage object. More... | |
subroutine, private | reallocatesparse (label, this, nspar, ierr) |
Allocates, reallocates or deallocates a sparse storage object. More... | |
subroutine, private | reallocategsf (label, this, newAlloc, ierr) |
Allocates, reallocates or deallocates a GSF storage object. More... | |
subroutine, private | reallocatepardiso (label, this, newAlloc, ierr) |
Allocates, reallocates or deallocates a Pardiso storage object. More... | |
subroutine, private | checksysmatstorage (sysMat, mpar, lpu, ierr) |
Performs consistency checking of a system matrix storage structure. More... | |
subroutine, private | checkskylinestorage (skyline, mpar, lpu, ierr) |
Performs consistency checking of the skyline data structure. More... | |
subroutine, private | checksparsestorage (sparse, mpar, lpu, ierr) |
Performs consistency checking of the sparse data structure. More... | |
subroutine, private | checkpardisostorage (sparse, lpu, ierr) |
Performs consistency checking of the sparse data structure. More... | |
subroutine, private | checkgsfstorage (gsf, lpu, ierr) |
Performs consistency checking of the GSF data structure. More... | |
integer function | checkgsfinfo (INFO, gsf) |
Inspects the GSF error flag and outputs the error messages, if any. More... | |
subroutine | convertsysmat (this, fullMat, ndim, startRow, ksa, ierr) |
Converts the given system matrix into a full rectangular matrix. More... | |
subroutine, private | writesysmat (this, mpar, io, text, nelL, complexity) |
Standard routine for writing an object to file. More... | |
subroutine | writesysmat2 (this, io, text, complexity) |
Standard routine for writing an object to file. More... | |
subroutine, private | writeskymat (matrix, skyline, io, nelLin, complexity) |
Writes out a skyline matrix, column by column. More... | |
subroutine, private | writesparsemat (matrix, sparse, io, nelLin, complexity) |
Writes out a sparse matrix, row by row. More... | |
subroutine, private | writesparsestructure (this, io, complexity, label) |
Standard routine for writing an object to file. More... | |
subroutine, private | writepardisomat (matrix, sparse, io, nelLin, complexity) |
Writes out a sparse matrix, row by row. More... | |
subroutine | extractdiagonal (this, diag, ierr) |
Extracts the diagonal elements from the given system matrix. More... | |
subroutine | savesysmat (this, name, nWord, iFile, ierr) |
Saves the given system matrix to temporary file. More... | |
subroutine | restoresysmat (this, name, nWord, iFile, ierr) |
Restores the given system matrix from temporary file. More... | |
subroutine | asmsparse (EM, MEEN, MEQN, MPMCEQ, MMCEQ, TTCC, A, IA, JA, B, ierr) |
Adds matrix elements corresponding to free and constrained DOFs. More... | |
Variables | |
integer, parameter | nbp_p = 8 |
Number of bytes in a pointer variable. More... | |
integer, parameter | diagonalmatrix_p = 0 |
Diagonal format. More... | |
integer, parameter | skylinematrix_p = 1 |
Skyline format. More... | |
integer, parameter | sparsematrix_p = 2 |
Sparse format using SPR solver. More... | |
integer, parameter | densematrix_p = 3 |
Dense format using LAPACK solver. More... | |
integer, parameter | outofcore_p = 4 |
Sparse format using GSF solver. More... | |
integer, parameter | pardiso_p = 5 |
Sparse format using PARDISO. More... | |
character(len=18), dimension(0:5), parameter | matrixtype_p = (/ 'diagonal matrix ', 'skyline matrix ', 'sparse matrix ', 'dense matrix ', 'out of core matrix', 'sparse matrix ' /) |
System matrix type springs. More... | |
integer(ik), parameter | nspar_p = 60_ik |
Size of control array MSPAR. More... | |
type(error_flag), pointer, save | gsfinfo |
Error flag for the GSF solver. More... | |
Module with data types and utility subroutines for system matrices.
This module contains data types representing system matrices with various storage schemes, and associated utility subroutines for data access. In order of increased memory usage, the following formats are covered:
subroutine sysmatrixtypemodule::allocatesysmatrix | ( | type(sysmatrixtype), intent(inout) | sysMat, |
integer, intent(inout) | ierr, | ||
integer, intent(in), optional | lpu, | ||
character(len=*), intent(in), optional | chName | ||
) |
Allocates storage for a system matrix.
sysMat | The sysmatrixtypemodule::sysmatrixtype object to allocate for | |
ierr | Error flag | |
[in] | lpu | File unit number for res-file output |
[in] | chName | Heading for storage requirement print |
The storage requirement is optionally written out to lpu
subroutine sysmatrixtypemodule::asmsparse | ( | real(dp), dimension(:,:), intent(in) | EM, |
integer, dimension(:), intent(in) | MEEN, | ||
integer, dimension(:), intent(in) | MEQN, | ||
integer, dimension(:), intent(in) | MPMCEQ, | ||
integer, dimension(:), intent(in) | MMCEQ, | ||
real(dp), dimension(:), intent(in) | TTCC, | ||
real(dp), dimension(:), intent(inout) | A, | ||
integer, dimension(:), intent(in) | IA, | ||
integer, dimension(:), intent(in) | JA, | ||
real(dp), dimension(:), intent(inout), optional | B, | ||
integer, intent(out) | ierr | ||
) |
Adds matrix elements corresponding to free and constrained DOFs.
[in] | EM | The element matrix to add |
[in] | MEEN | Matrix of element equation numbers |
[in] | MEQN | Matrix of equation numbers |
[in] | MPMCEQ | Matrix of pointers to constraint equations |
[in] | MMCEQ | Matrix of constraint equations |
[in] | TTCC | Table of constraint equation coefficients |
A | System matrix coefficients | |
[in] | IA | Index to to the start of each column in A |
[in] | JA | Row indices of A |
B | Right-hand-side vector | |
[out] | IERR | Error flag |
The elements corresponding to free and constrained DOFs of the element matrix EM is added to the sparse system matrix {A,IA,JA} and the associated right-hand-side vector B.
integer function sysmatrixtypemodule::checkgsfinfo | ( | type(error_flag), pointer | INFO, |
type(gsfstoragetype), intent(in), optional | gsf | ||
) |
Inspects the GSF error flag and outputs the error messages, if any.
[in] | gsf | The sysmatrixtypemodule::gsfstoragetype to check |
INFO | Error handling object from the GSF package |
|
private |
Performs consistency checking of the GSF data structure.
[in] | gsf | The sysmatrixtypemodule::gsfstoragetype to check |
[in] | lpu | File unit number for res-file output |
[out] | ierr | Error flag |
|
private |
Performs consistency checking of the sparse data structure.
[in] | sparse | The sysmatrixtypemodule::pardisostoragetype to check |
[in] | lpu | File unit number for res-file output |
[out] | ierr | Error flag |
|
private |
Performs consistency checking of the skyline data structure.
[in] | skyline | The sysmatrixtypemodule::skylinestoragetype to check |
[in] | mpar | Matrix of parameters |
[in] | lpu | File unit number for res-file output |
[out] | ierr | Error flag |
|
private |
Performs consistency checking of the sparse data structure.
[in] | sparse | The sysmatrixtypemodule::sparsestoragetype to check |
[in] | mpar | Matrix of parameters |
[in] | lpu | File unit number for res-file output |
[out] | ierr | Error flag |
|
private |
Performs consistency checking of a system matrix storage structure.
[in] | sysMat | The sysmatrixtypemodule::sysmatrixtype object to check |
[in] | mpar | Matrix of parameters |
[in] | lpu | File unit number for res-file output |
[out] | ierr | Error flag |
subroutine sysmatrixtypemodule::convertsysmat | ( | type(sysmatrixtype), intent(in) | this, |
real(dp), dimension(:,:), intent(out) | fullMat, | ||
integer, intent(in) | ndim, | ||
integer, intent(in) | startRow, | ||
integer, intent(in) | ksa, | ||
integer, intent(out) | ierr | ||
) |
Converts the given system matrix into a full rectangular matrix.
[in] | this | The sysmatrixtypemodule::sysmatrixtype object to convert |
[out] | fullMat | Rectangular matrix representation of this |
[in] | ndim | Max dimension on fullMat |
[in] | startRow | First row in fullMat to insert reactangular matrix |
[in] | ksa | Sign of converted matrix |
[out] | ierr | Error flag |
subroutine sysmatrixtypemodule::deallocatesysmatrix | ( | type(sysmatrixtype), intent(inout) | this, |
integer, intent(inout), optional | ierr | ||
) |
Deallocates all dynamic arrays for a system matrix object.
this | The sysmatrixtypemodule::sysmatrixtype object to deallocate |
ierr | Error flag |
subroutine sysmatrixtypemodule::extractdiagonal | ( | type(sysmatrixtype), intent(inout) | this, |
real(dp), dimension(:), intent(out) | diag, | ||
integer, intent(out) | ierr | ||
) |
Extracts the diagonal elements from the given system matrix.
this | The sysmatrixtypemodule::sysmatrixtype object to extract from | |
[out] | diag | Diagonal elements of the matrix |
[out] | ierr | Error flag |
logical function sysmatrixtypemodule::isallocated | ( | type(sysmatrixtype), intent(in) | this | ) |
Checks if a system matrix object is allocated or not.
[in] | this | The sysmatrixtypemodule::sysmatrixtype object to check |
subroutine sysmatrixtypemodule::nullifysysmatrix | ( | type(sysmatrixtype), intent(out) | this | ) |
Initializes a system matrix object.
[out] | this | The sysmatrixtypemodule::sysmatrixtype object to nullify |
|
private |
Allocates, reallocates or deallocates a GSF storage object.
[in] | label | Text label used for logging of dynamic memory use |
this | The sysmatrixtypemodule::gsfstoragetype object to allocate | |
[in] | newAlloc | If .true., a new system matrix is allocated |
ierr | Error flag |
If reallocated, the existing contents is lost.
|
private |
Allocates, reallocates or deallocates a Pardiso storage object.
[in] | label | Text label used for logging of dynamic memory use |
this | The sysmatrixtypemodule::pardisostoragetype object to allocate | |
[in] | newAlloc | If .true., a new system matrix is allocated |
ierr | Error flag |
If reallocated, the existing contents is lost.
|
private |
Allocates, reallocates or deallocates a skyline storage object.
[in] | label | Text label used for logging of dynamic memory use |
this | The sysmatrixtypemodule::skylinestoragetype object to allocate | |
[in] | newAlloc | If .true., a new system matrix is allocated |
ierr | Error flag |
If reallocated, the existing contents is lost.
|
private |
Allocates, reallocates or deallocates a sparse storage object.
[in] | label | Text label used for logging of dynamic memory use |
this | The sysmatrixtypemodule::sparsestoragetype object to allocate | |
[in] | nspar | Size of the control array mspar |
ierr | Error flag |
If reallocated, the existing contents is lost.
|
private |
Allocates, reallocates or deallocates a system matrix object.
[in] | label | Text label used for logging of dynamic memory use |
this | The sysmatrixtypemodule::sysmatrixtype object to allocate | |
newAlloc | If .true., a new system matrix is allocated | |
ierr | Error flag |
If reallocated, the existing contents is lost.
subroutine sysmatrixtypemodule::restoresysmat | ( | type(sysmatrixtype), intent(inout) | this, |
character(len=*), intent(in) | name, | ||
integer(i8), intent(in) | nWord, | ||
integer, intent(inout) | iFile, | ||
integer, intent(out) | ierr | ||
) |
Restores the given system matrix from temporary file.
this | The sysmatrixtypemodule::sysmatrixtype object to restore | |
[in] | name | Name tag of matrix |
[in] | nWord | Number of real words in the matrix to restore |
[in] | iFile | File handle to restore from |
[out] | ierr | Error flag |
subroutine sysmatrixtypemodule::savesysmat | ( | type(sysmatrixtype), intent(in) | this, |
character(len=*), intent(in) | name, | ||
integer(i8), intent(in) | nWord, | ||
integer, intent(out) | iFile, | ||
integer, intent(out) | ierr | ||
) |
Saves the given system matrix to temporary file.
this | The sysmatrixtypemodule::sysmatrixtype object to save | |
[in] | name | Name tag of matrix |
[in] | nWord | Number of real words in the matrix to save |
[out] | iFile | Handle of the file the matrix is written to |
[out] | ierr | Error flag |
subroutine sysmatrixtypemodule::sharematrixstructure | ( | type(sysmatrixtype), intent(out) | this, |
type(sysmatrixtype), intent(in) | that, | ||
logical, intent(in), optional | needsFactorization, | ||
integer, intent(in), optional | newType, | ||
integer, intent(out), optional | ierr | ||
) |
Lets one system matrix object share the data structure of another.
[out] | this | The sysmatrixtypemodule::sysmatrixtype object to share data structures from |
[in] | that | The sysmatrixtypemodule::sysmatrixtype object to initialize data structures from |
[in] | needsFactorization | If .true., this is going to be factorized |
[in] | newType | Matrix type of this |
[out] | ierr | Error flag |
|
private |
Writes out a sparse matrix, row by row.
[in] | matrix | The values of the sparse matrix |
[in] | sparse | sysmatrixtypemodule::pardisostoragetype object associated with the matrix |
[in] | io | File unit number to write to |
[in] | nelLin | Number of lines per matrix to write |
[in] | complexity | If present, the value indicates the amount of print |
|
private |
Writes out a skyline matrix, column by column.
[in] | matrix | The values of the skyline matrix |
[in] | skyline | sysmatrixtypemodule::skylinestoragetype object associated with the matrix |
[in] | io | File unit number to write to |
[in] | nelLin | Number of lines per matrix to write |
[in] | complexity | If present, the value indicates the amount of print |
|
private |
Writes out a sparse matrix, row by row.
[in] | matrix | The values of the sparse matrix |
[in] | sparse | sysmatrixtypemodule::sparsestoragetype object associated with the matrix |
[in] | io | File unit number to write to |
[in] | nelLin | Number of lines per matrix to write |
[in] | complexity | If present, the value indicates the amount of print |
|
private |
Standard routine for writing an object to file.
[in] | this | The sysmatrixtypemodule::sparsestoragetype object to write |
[in] | io | File unit number to write to |
[in] | complexity | If present, the value indicates the amount of print |
[in] | label | If present, print out as matrix label |
|
private |
Standard routine for writing an object to file.
this | The sysmatrixtypemodule::sysmatrixtype object to write | |
[in] | mpar | Matrix of parameters |
[in] | io | File unit number to write to |
[in] | text | If present, write as heading |
[in] | nelL | Number of matrix elements to write per line |
[in] | complexity | If present, the value indicates the amount of print |
subroutine sysmatrixtypemodule::writesysmat2 | ( | type(sysmatrixtype), intent(in) | this, |
integer, intent(in) | io, | ||
character(len=*), intent(in), optional | text, | ||
integer, intent(in), optional | complexity | ||
) |
Standard routine for writing an object to file.
this | The sysmatrixtypemodule::sysmatrixtype object to write | |
[in] | io | File unit number to write to |
[in] | text | If present, write as heading |
[in] | complexity | If present, the value indicates the amount of print |
This subroutine only writes the data structure for sparse matrix.
integer, parameter sysmatrixtypemodule::densematrix_p = 3 |
Dense format using LAPACK solver.
integer, parameter sysmatrixtypemodule::diagonalmatrix_p = 0 |
Diagonal format.
type(error_flag), pointer, save sysmatrixtypemodule::gsfinfo |
Error flag for the GSF solver.
character(len=18), dimension(0:5), parameter sysmatrixtypemodule::matrixtype_p = (/ 'diagonal matrix ', 'skyline matrix ', 'sparse matrix ', 'dense matrix ', 'out of core matrix', 'sparse matrix ' /) |
System matrix type springs.
integer parameter sysmatrixtypemodule::nbp_p = 8 |
Number of bytes in a pointer variable.
integer(ik), parameter sysmatrixtypemodule::nspar_p = 60_ik |
Size of control array MSPAR.
integer, parameter sysmatrixtypemodule::outofcore_p = 4 |
Sparse format using GSF solver.
integer, parameter sysmatrixtypemodule::pardiso_p = 5 |
Sparse format using PARDISO.
integer, parameter sysmatrixtypemodule::skylinematrix_p = 1 |
Skyline format.
integer, parameter sysmatrixtypemodule::sparsematrix_p = 2 |
Sparse format using SPR solver.