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

Module with subroutines for manipulation of integer and real matrices. More...

Data Types

interface  writeobject
 Standard routine for writing an object to file. More...
 
interface  diagmatmul
 Matrix multiplication involving diagonal matrices. More...
 
interface  matmul34
 Matrix multiplication involving 3×4 position matrices. More...
 
interface  dyadic_product
 Dyadic product between two vectors. More...
 

Functions/Subroutines

real(dp) function, dimension(3) cross_product (y, z)
 Returns the cross product between the vectors y and z. More...
 
real(dp) function, dimension(size(x), size(x)), private travmulv (x)
 Returns the dyadic vector product xTx. More...
 
real(dp) function, dimension(size(x), size(y)), private traumulv (x, y)
 Returns the dyadic vector product xTy. More...
 
subroutine diagtransform (D, A, T, ierr)
 Performs the transformation T = ATDA where D is a diagonal matrix. More...
 
subroutine, private diagmatmulmat (D, A, B, iflag, ierr)
 Performs the matrix multiplication B = c1B + c2DA. More...
 
subroutine, private diagmatmulvec (D, X, Y, iflag, ierr)
 Performs the matrix-vector multiplication Y = c1Y + c2DX. More...
 
real(dp) function, dimension(3, 4), private matmul34mat (a, b)
 Returns the matrix product ab. More...
 
real(dp) function, dimension(3), private matmul34vec (a, b)
 Returns the matrix-vector product ab. More...
 
real(dp) function, dimension(2, 2) invert22 (a, lpu, ierr)
 Returns the inverse of the 2×2 matrix a. More...
 
real(dp) function, dimension(3, 3) invert33 (a, lpu, ierr)
 Returns the inverse of the 3×3 matrix a. More...
 
real(dp) function, dimension(3, 4) invert34 (a)
 Returns the inverse of the 3×4 transformation matrix a. More...
 
real(dp) function, dimension(3, 4) trans3p (P1, P2, P3, lpu, ierr)
 Returns a 3×4 transformation matrix calculated from 3 points. More...
 
real(dp) function, dimension(3, 3) trans1v (V1, lpu, ierr)
 Returns a 3×3 transformation matrix based on the given X-direction vector V1. More...
 
subroutine, private writeintarray (array, lpu, text)
 Writes out and integer array in a formatted way. More...
 
subroutine writeint8array (array, lpu, text)
 Writes out an integer array in a formatted way. More...
 
subroutine, private writerealarray (array, lpu, text, nellIn, eps)
 Writes out a single precision array in a formatted way. More...
 
subroutine, private writerealmatrix (array, lpu, text, nellIn, eps)
 Writes out a 2D single precision array in a formatted way. More...
 
subroutine, private writedoublearray (array, lpu, text, nellIn, eps)
 Writes out a double precision array in a formatted way. More...
 
subroutine, private writedoublematrix (array, lpu, text, nellIn, eps)
 Writes out a 2D double precision array in a formatted way. More...
 
subroutine unify (A)
 Unifies the given matrix A. More...
 
integer function, dimension(:,:), pointer matrixpointtoarray_int (array, rows, columns)
 Returns a matrix pointer to an integer array. More...
 
real(dp) function, dimension(:,:), pointer matrixpointtoarray_real (array, rows, columns)
 Returns a matrix pointer to a real array. More...
 

Detailed Description

Module with subroutines for manipulation of integer and real matrices.

This module contains various utility subroutines (and functions) for manipulation of matrices, such as specialiced multiplication routines, printing to file, etc.

Karl Erik Thoresen

Date
27 Sep 1998

Function/Subroutine Documentation

◆ cross_product()

real(dp) function, dimension(3) manipmatrixmodule::cross_product ( real(dp), dimension(3), intent(in)  y,
real(dp), dimension(3), intent(in)  z 
)

Returns the cross product between the vectors y and z.

Author
Karl Erik Thoresen
Date
Jan 2000

◆ diagmatmulmat()

subroutine, private manipmatrixmodule::diagmatmulmat ( real(dp), dimension(:), intent(in)  D,
real(dp), dimension(:,:), intent(in)  A,
real(dp), dimension(:,:), intent(out)  B,
integer, intent(in)  iflag,
integer, intent(out)  ierr 
)
private

Performs the matrix multiplication B = c1B + c2DA.

D is a diagonal matrix, whereas B and A are full matrices. The value of the parameters c1 and c2 are determined from the input variable iflag, as follows:

  • iflag = 1 : c1 = 0, c2 = 1
  • iflag = -1 : c1 = 0, c2 = -1
  • iflag = 2 : c1 = 1, c2 = 1
  • iflag = -2 : c1 = 1, c2 = -1
Author
Knut Morten Okstad
Date
Jan 2003

◆ diagmatmulvec()

subroutine, private manipmatrixmodule::diagmatmulvec ( real(dp), dimension(:), intent(in)  D,
real(dp), dimension(:), intent(in)  X,
real(dp), dimension(:), intent(out)  Y,
integer, intent(in)  iflag,
integer, intent(out)  ierr 
)
private

Performs the matrix-vector multiplication Y = c1Y + c2DX.

D is a diagonal matrix, whereas Y and X are vectors. The value of the parameters c1 and c2 are determined from the input variable iflag, as follows:

  • iflag = 1 : c1 = 0, c2 = 1
  • iflag = -1 : c1 = 0, c2 = -1
  • iflag = 2 : c1 = 1, c2 = 1
  • iflag = -2 : c1 = 1, c2 = -1
Author
Knut Morten Okstad
Date
Jan 2003

◆ diagtransform()

subroutine manipmatrixmodule::diagtransform ( real(dp), dimension(:), intent(in)  D,
real(dp), dimension(:,:), intent(in)  A,
real(dp), dimension(:,:), intent(out)  T,
integer, intent(out)  ierr 
)

Performs the transformation T = ATDA where D is a diagonal matrix.

Author
Knut Morten Okstad
Date
Aug 2001

◆ invert22()

real(dp) function, dimension(2,2) manipmatrixmodule::invert22 ( real(dp), dimension(2,2), intent(in)  a,
integer, intent(in), optional  lpu,
integer, intent(out), optional  ierr 
)

Returns the inverse of the 2×2 matrix a.

Author
Knut Morten Okstad
Date
Nov 2000

◆ invert33()

real(dp) function, dimension(3,3) manipmatrixmodule::invert33 ( real(dp), dimension(3,3), intent(in)  a,
integer, intent(in), optional  lpu,
integer, intent(out), optional  ierr 
)

Returns the inverse of the 3×3 matrix a.

Author
Knut Morten Okstad
Date
Nov 2000

◆ invert34()

real(dp) function, dimension(3,4) manipmatrixmodule::invert34 ( real(dp), dimension(3,4), intent(in)  a)

Returns the inverse of the 3×4 transformation matrix a.

The matrix a is assumed to have the implicit dimension 4×4 with the 4th line being equal to [0 0 0 1].

Author
Knut Morten Okstad
Date
Nov 2000

◆ matmul34mat()

real(dp) function, dimension(3,4), private manipmatrixmodule::matmul34mat ( real(dp), dimension(3,4), intent(in)  a,
real(dp), dimension(3,4), intent(in)  b 
)
private

Returns the matrix product ab.

a and b are both 3×4 matrices with the assumed dimension 4×4, and the 4th row being [0 0 0 1].

Author
Karl Erik Thoresen
Date
Feb 1999

◆ matmul34vec()

real(dp) function, dimension(3), private manipmatrixmodule::matmul34vec ( real(dp), dimension(3,4), intent(in)  a,
real(dp), dimension(3), intent(in)  b 
)
private

Returns the matrix-vector product ab.

a is a 3×4 matrices with the assumed dimension 4×4 and the 4th row being [0 0 0 1], whereas b is a vector with size 3 and assumed size 4.

Author
Karl Erik Thoresen
Date
Feb 1999

◆ matrixpointtoarray_int()

integer function, dimension(:,:), pointer manipmatrixmodule::matrixpointtoarray_int ( integer, dimension(rows,columns), intent(in), target  array,
integer, intent(in)  rows,
integer, intent(in)  columns 
)

Returns a matrix pointer to an integer array.

array can be a one-dimensional array as actual argument, but is a matrix as dummy argument.

◆ matrixpointtoarray_real()

real(dp) function, dimension(:,:), pointer manipmatrixmodule::matrixpointtoarray_real ( real(dp), dimension(rows,columns), intent(in), target  array,
integer, intent(in)  rows,
integer, intent(in)  columns 
)

Returns a matrix pointer to a real array.

array can be a one-dimensional array as actual argument, but is a matrix as dummy argument.

◆ trans1v()

real(dp) function, dimension(3,3) manipmatrixmodule::trans1v ( real(dp), dimension(3), intent(in)  V1,
integer, intent(in), optional  lpu,
integer, intent(out), optional  ierr 
)

Returns a 3×3 transformation matrix based on the given X-direction vector V1.

Author
Knut Morten Okstad
Date
28 Jun 2002

◆ trans3p()

real(dp) function, dimension(3,4) manipmatrixmodule::trans3p ( real(dp), dimension(3), intent(in)  P1,
real(dp), dimension(3), intent(in)  P2,
real(dp), dimension(3), intent(in)  P3,
integer, intent(in), optional  lpu,
integer, intent(out), optional  ierr 
)

Returns a 3×4 transformation matrix calculated from 3 points.

Author
Knut Morten Okstad
Date
12 Jan 2001

◆ traumulv()

real(dp) function, dimension(size(x),size(y)), private manipmatrixmodule::traumulv ( real(dp), dimension(:), intent(in)  x,
real(dp), dimension(:), intent(in)  y 
)
private

Returns the dyadic vector product xTy.

Author
Knut Morten Okstad
Date
Jun 2004

◆ travmulv()

real(dp) function, dimension(size(x),size(x)), private manipmatrixmodule::travmulv ( real(dp), dimension(:), intent(in)  x)
private

Returns the dyadic vector product xTx.

Author
Karl Erik Thoresen
Date
Aug 1999

◆ unify()

subroutine manipmatrixmodule::unify ( real(dp), dimension(:,:), intent(inout)  A)

Unifies the given matrix A.

If A is not square, the greatest possible square matrix will be unified and the rest will be zeroed.

◆ writedoublearray()

subroutine, private manipmatrixmodule::writedoublearray ( real(dp), dimension(:), intent(in)  array,
integer, intent(in)  lpu,
character(*), intent(in), optional  text,
integer, intent(in), optional  nellIn,
real(dp), intent(in), optional  eps 
)
private

Writes out a double precision array in a formatted way.

Parameters
[in]arrayThe array to print out
[in]lpuFile unit number to print to
[in]textHeading to be printed before the array elements
[in]nellInMax number of values to print per line
[in]epsZero tolerance, truncate terms with smaller absolute value

◆ writedoublematrix()

subroutine, private manipmatrixmodule::writedoublematrix ( real(dp), dimension(:,:), intent(in)  array,
integer, intent(in)  lpu,
character(*), intent(in), optional  text,
integer, intent(in), optional  nellIn,
real(dp), intent(in), optional  eps 
)
private

Writes out a 2D double precision array in a formatted way.

Parameters
[in]arrayThe array to print out
[in]lpuFile unit number to print to
[in]textHeading to be printed before the matrix elements
[in]nellInMax number of values to print per line
[in]epsZero tolerance, truncate terms with smaller absolute value

◆ writeint8array()

subroutine manipmatrixmodule::writeint8array ( integer(i8), dimension(:), intent(in)  array,
integer, intent(in)  lpu,
character(*), intent(in), optional  text 
)

Writes out an integer array in a formatted way.

Parameters
[in]arrayThe array to print out
[in]lpuFile unit number to print to
[in]textHeading to be printed before the matrix values

◆ writeintarray()

subroutine, private manipmatrixmodule::writeintarray ( integer, dimension(:), intent(in)  array,
integer, intent(in)  lpu,
character(*), intent(in), optional  text 
)
private

Writes out and integer array in a formatted way.

Parameters
[in]arrayThe array to print out
[in]lpuFile unit number to print to
[in]textHeading to be printed before the matrix values

◆ writerealarray()

subroutine, private manipmatrixmodule::writerealarray ( real(sp), dimension(:), intent(in)  array,
integer, intent(in)  lpu,
character(*), intent(in), optional  text,
integer, intent(in), optional  nellIn,
real(sp), intent(in), optional  eps 
)
private

Writes out a single precision array in a formatted way.

Parameters
[in]arrayThe array to print out
[in]lpuFile unit number to print to
[in]textHeading to be printed before the array elements
[in]nellInMax number of values to print per line
[in]epsZero tolerance, truncate terms with smaller absolute value

◆ writerealmatrix()

subroutine, private manipmatrixmodule::writerealmatrix ( real(sp), dimension(:,:), intent(in)  array,
integer, intent(in)  lpu,
character(*), intent(in), optional  text,
integer, intent(in), optional  nellIn,
real(sp), intent(in), optional  eps 
)
private

Writes out a 2D single precision array in a formatted way.

Parameters
[in]arrayThe array to print out
[in]lpuFile unit number to print to
[in]textHeading to be printed before the matrix elements
[in]nellInMax number of values to print per line
[in]epsZero tolerance, truncate terms with smaller absolute value