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

Module for general rectangular matrices with disk storage,. More...

Data Types

type  diskmatrixtype
 Data type representing a rectangular matrix with disk storage. More...
 
interface  dmmattimesvec
 Multiplies a disk matrix with a given vector. More...
 

Functions/Subroutines

integer function dmgetswapsize ()
 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 ReadOnly operations. 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 dmsinglecast (this, ielSwap, nelSwap)
 Casts the in-core matrix elements from double to single precision. More...
 
real(sp) function dmgetvalue (this, rInd, cInd, err)
 Returns the value of a matrix element. More...
 
real(sp) function, dimension(:,:), pointer dmgetswapsecptr (this, cInd, err)
 Returns a pointer to a matrix containing a swap section. More...
 
real(sp) 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, private dmmattimesvec_sp (this, xVec, yVec, err, doInitialize)
 Multiplies a disk matrix with a given single precision vector. More...
 
subroutine, private dmmattimesvec_dp (this, xVec, yVec, err, doInitialize)
 Multiplies a disk matrix with a given double precision 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...
 

Detailed Description

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. This module is single-precision limited version of diskmatrixmodule. It supports ReadOnly matrices only.

Function/Subroutine Documentation

◆ dmclose()

subroutine sdiskmatrixmodule::dmclose ( type(diskmatrixtype), intent(inout)  this,
integer, intent(out)  err 
)

Closes the disk matrix file and releases the associated swap array.

Parameters
thisThe sdiskmatrixmodule::diskmatrixtype object to close
[out]errError indicator
Author
Knut Morten Okstad
Date
1 Dec 2000
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dmfindabsmaxrowvalues()

subroutine sdiskmatrixmodule::dmfindabsmaxrowvalues ( type(diskmatrixtype), intent(inout)  this,
real(sp), dimension(:), intent(out)  maxRowVal,
integer, intent(out)  err 
)

Finds the absolute maximum value for each row in a disk matrix.

Parameters
thisThe sdiskmatrixmodule::diskmatrixtype object to address
[out]maxRowValAbsolute maximum row values
[out]errError indicator
Author
Bjorn Haugen
Date
25 Mar 2003
Here is the call graph for this function:

◆ dmgetaddress()

subroutine, private sdiskmatrixmodule::dmgetaddress ( type(diskmatrixtype), intent(inout)  this,
integer, intent(in)  rInd,
integer, intent(in)  cInd,
integer, intent(out)  section,
integer, intent(out)  index,
integer, intent(out)  err 
)
private

Gets swap section number and local array index for matrix element.

Parameters
[in]thisThe sdiskmatrixmodule::diskmatrixtype object to address
[in]rIndRow index of matrix element to get address of
[in]cIndColumn index of matrix element to get address of
[out]sectionIndex of swap section containing the matrix element
[out]indexArray index within that swap section for matrix element
[out]errError indicator
Author
Bjorn Haugen
Date
10 Feb 1999
Here is the caller graph for this function:

◆ dmgetcol()

subroutine sdiskmatrixmodule::dmgetcol ( type(diskmatrixtype), intent(inout)  this,
integer, intent(in)  cInd,
real(sp), dimension(:), intent(out)  col,
integer, intent(out)  err 
)

Gets a column of the given disk matrix.

Parameters
thisThe sdiskmatrixmodule::diskmatrixtype object to return for
[in]cIndColumn index to return for
[out]colContent of the matrix column
[out]errError indicator
Author
Bjorn Haugen
Date
10 Feb 1999
Here is the call graph for this function:

◆ dmgetcolptr()

real(sp) function, dimension(:), pointer sdiskmatrixmodule::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.

Parameters
thisThe sdiskmatrixmodule::diskmatrixtype object to return for
[in]cIndColumn index to return pointer for
[out]errError indicator
Note
This function circumvents all protection and should be used with extreme caution and only for ReadOnly purposes when speed is essential. Calls to other dm... routines can also change the contents of the memory being pointed to.
Author
Bjorn Haugen and Karl Erik Thoresen
Date
5 May 1999
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dmgetrow()

subroutine sdiskmatrixmodule::dmgetrow ( type(diskmatrixtype), intent(inout)  this,
integer, intent(in)  rInd,
real(sp), dimension(:), intent(out)  row,
integer, intent(out)  err 
)

Gets a row of the given disk matrix.

Parameters
thisThe sdiskmatrixmodule::diskmatrixtype object to return for
[in]rIndRow index to return for
[out]rowContent of the matrix row
[out]errError indicator
Author
Bjorn Haugen
Date
10 Feb 1999
Here is the call graph for this function:

◆ dmgetswapsecptr()

real(sp) function, dimension(:,:), pointer sdiskmatrixmodule::dmgetswapsecptr ( type(diskmatrixtype), intent(inout)  this,
integer, intent(in)  cInd,
integer, intent(out)  err 
)

Returns a pointer to a matrix containing a swap section.

Parameters
thisThe sdiskmatrixmodule::diskmatrixtype object to return for
[in]cIndColumn index for start of swap section to return for
[out]errError 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.

Author
Knut Morten Okstad
Date
13 Sep 2004
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dmgetswapsize()

integer function sdiskmatrixmodule::dmgetswapsize

Returns requested size of one swap section from command-line option.

Author
Knut Morten Okstad
Date
31 Jan 2002
Here is the caller graph for this function:

◆ dmgetvalue()

real(sp) function sdiskmatrixmodule::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.

Parameters
thisThe sdiskmatrixmodule::diskmatrixtype object to return for
[in]rIndRow index of matrix element to return
[in]cIndColumn index of matrix element to return
[out]errError indicator
Author
Bjorn Haugen
Date
10 Feb 1999
Here is the call graph for this function:

◆ dmmattimesvec_dp()

subroutine, private sdiskmatrixmodule::dmmattimesvec_dp ( type(diskmatrixtype), intent(inout)  this,
real(dp), dimension(:), intent(in)  xVec,
real(sp), dimension(:), intent(inout)  yVec,
integer, intent(out)  err,
logical, intent(in), optional  doInitialize 
)
private

Multiplies a disk matrix with a given double precision vector.

Parameters
thisThe sdiskmatrixmodule::diskmatrixtype object (A) to multiply
[in]xVecThe vector (x) to multiply matrix A with
yVecThe resulting vector (y)
[out]errError indicator
[in]doInitializeIf 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.

Author
Bjorn Haugen
Date
10 Feb 1999

◆ dmmattimesvec_sp()

subroutine, private sdiskmatrixmodule::dmmattimesvec_sp ( type(diskmatrixtype), intent(inout)  this,
real(sp), dimension(:), intent(in)  xVec,
real(sp), dimension(:), intent(inout)  yVec,
integer, intent(out)  err,
logical, intent(in), optional  doInitialize 
)
private

Multiplies a disk matrix with a given single precision vector.

Parameters
thisThe sdiskmatrixmodule::diskmatrixtype object (A) to multiply
[in]xVecThe vector (x) to multiply matrix A with
yVecThe resulting vector (y)
[out]errError indicator
[in]doInitializeIf 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.

Author
Bjorn Haugen
Date
10 Feb 1999

◆ dmmattranstimesvec()

subroutine sdiskmatrixmodule::dmmattranstimesvec ( type(diskmatrixtype), intent(inout)  this,
real(sp), dimension(:), intent(in)  xVec,
real(sp), dimension(:), intent(out)  yVec,
integer, intent(out)  err 
)

Multiplies the transpose of a disk matrix with a given vector.

Parameters
thisThe sdiskmatrixmodule::diskmatrixtype object (A) to multiply
[in]xVecThe vector (x) to multiply matrix A with
yVecThe resulting vector (y)
[out]errError indicator

The following operation is performed y = A^t*x

Author
Bjorn Haugen
Date
10 Feb 1999
Here is the call graph for this function:

◆ dmnullify()

subroutine sdiskmatrixmodule::dmnullify ( type(diskmatrixtype), intent(out)  this)

Initializes a disk matrix object.

Parameters
[out]thisThe sdiskmatrixmodule::diskmatrixtype object to be initialized
Author
Knut Morten Okstad
Date
14 Feb 2002
Here is the caller graph for this function:

◆ dmopen()

subroutine sdiskmatrixmodule::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 ReadOnly operations.

Parameters
[out]thisThe sdiskmatrixmodule::diskmatrixtype object to open
[in]fileNameName of file to read/write matrix content from/to
fileChkSumCheck-sum value of the FE part associated with this
[in]nRowsNumber of matrix rows
[in]nColsNumber of matrix columns
[in]statusFile opening mode, must be diskmatrixmodule::dmold_p
[out]errError indicator
[in]nColSwapOptional number of matrix columns per swap section
[in]swapSizeOptional size of swap section in double precision words
[in]wantTagExpected file tag for ReadOnly matrices
Author
Knut Morten Okstad
Date
1 Jun 2001
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dmsinglecast()

subroutine, private sdiskmatrixmodule::dmsinglecast ( type(diskmatrixtype), intent(inout)  this,
integer, intent(in)  ielSwap,
integer, intent(in)  nelSwap 
)
private

Casts the in-core matrix elements from double to single precision.

Parameters
thisThe sdiskmatrixmodule::diskmatrixtype object to cast for
[in]ielSwapIndex to first element in swap section
[in]nelSwapNumber of elements in swap section to cast for

It is assumed that the double-precision buffer array sdiskmatrixmodule::diskmatrixtype::vald is not larger than one column.

Author
Knut Morten Okstad
Date
19 May 2005
Here is the caller graph for this function:

◆ dmsize()

integer(i8) function sdiskmatrixmodule::dmsize ( type(diskmatrixtype), intent(in)  this,
integer, intent(in), optional  iDim 
)

Returns the size of the given disk matrix.

Parameters
[in]thisThe sdiskmatrixmodule::diskmatrixtype object to address
[in]iDimWhich size parameter to return:
  • if not present, return the total size (nrows×ncols)
  • 1: number of matrix rows (nrows)
  • 2: number of matrix columns (ncols)
  • for any other value: return the number of columns in swap array
Author
Bjorn Haugen
Date
29 Jan 1999
Here is the caller graph for this function:

◆ dmswap()

subroutine, private sdiskmatrixmodule::dmswap ( type(diskmatrixtype), intent(inout)  this,
integer, intent(in)  newSection,
integer, intent(out)  err 
)
private

Writes current section to disk and reads a new one into core.

Parameters
[in]thisThe sdiskmatrixmodule::diskmatrixtype object to swap for
[in]newSectionIndex of the swap section to read into core
[out]errError indicator
Author
Knut Morten Okstad
Date
1 Dec 2000
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dmwrite()

subroutine sdiskmatrixmodule::dmwrite ( type(diskmatrixtype), intent(inout)  this,
integer, intent(in)  lpu,
character(len=*), intent(in)  name 
)

Writes out the content of a disk matrix.

Parameters
[in]thisThe sdiskmatrixmodule::diskmatrixtype object to write out
[in]lpuFile unit number to write to
[in]nameMatrix identifier
Author
Knut Morten Okstad
Date
18 Mar 2003