FEDEM Solver
R8.0
Source code of the dynamics solver
|
Module with subroutines for solution of linear equation systems. More...
Data Types | |
interface | cssolve |
Solves the linear system of equations Ax = B. More... | |
Functions/Subroutines | |
subroutine, private | cssolvea (iop, iopSing, sysMat, rhs, lpu, ierr, eqnInErr, meqnInErr, tolFactorize, scaleOnSing, neq1) |
Solves the linear system of equations Ax = B. More... | |
subroutine, private | cssolveb (iop, iopSing, sysMat, rhs, nrhs, lpu, ierr, eqnInErr, meqnInErr, tolFactorize, scaleOnSing, neq1) |
Solves the linear system of equations Ax = B. More... | |
subroutine | cssolvesupel (iopSing, sysMat, sysRhs, supElMat, supElRhs, meqn1, meqn2, nrhs, lpu, ierr, Bmatrix, eqnInErr, meqnInErr, tolFactorize, scaleOnSing) |
Performs the superelement reduction for the equation system. More... | |
subroutine | cslanczoseigensolve (aMat, bMat, mip, mop, meqn1, neq, nEigVal, nEigVec, tolerance, shift, eigValues, eigVectors, ipsw, lpu, meqnInErr, ierr) |
Solves the eigenvalue problem (A + λB) * u = 0. More... | |
subroutine | csexpand (samData, sveq, svdof, S1, S2) |
Expands and rearranges a solution vector. More... | |
Variables | |
real(dp), parameter, private | epsilon_p = 1.0e-12_dp |
Default tolerance. More... | |
Module with subroutines for solution of linear equation systems.
This module contains subroutines for solving the linear system of equations that arise in Fedem solver applications. This includes both direct solution for a set of right-hand-side vectors, the reduction of a system of equations such that only external DOFs are retained, as well as eigenvalue solutions. The module defines an interface between the Fedem solver applications and the various 3rd-party linear algebra packages that are being used.
subroutine solextensionmodule::csexpand | ( | type(samtype), intent(in) | samData, |
real(dp), dimension(:), intent(in) | sveq, | ||
real(dp), dimension(:), intent(out) | svdof, | ||
real(dp), intent(in), optional | S1, | ||
real(dp), intent(in), optional | S2 | ||
) |
Expands and rearranges a solution vector.
[in] | samData | Assembly management data |
[in] | sveq | Solution vector expressed in equation order |
[out] | svdof | Solution vector expressed in nodal point DOF order |
[in] | S1 | Scaling factor for the free DOFs (default 1.0) |
[in] | S2 | Scaling factor for the specified DOFs (default equal to S1) |
This subroutine expands and rearranges a system vector expressed in equation order, into a vector corresponding to nodal point order.
subroutine solextensionmodule::cslanczoseigensolve | ( | type(sysmatrixtype), intent(inout) | aMat, |
type(sysmatrixtype), intent(inout) | bMat, | ||
integer, dimension(:), intent(in) | mip, | ||
integer, dimension(:), intent(out) | mop, | ||
integer, dimension(:), intent(in) | meqn1, | ||
integer, intent(in) | neq, | ||
integer, intent(in) | nEigVal, | ||
integer, intent(in) | nEigVec, | ||
real(dp), dimension(3), intent(inout) | tolerance, | ||
real(dp), intent(in) | shift, | ||
real(dp), dimension(:), intent(out) | eigValues, | ||
real(dp), dimension(:,:), intent(out) | eigVectors, | ||
integer, intent(in) | ipsw, | ||
integer, intent(in) | lpu, | ||
integer(ik), dimension(:), intent(out) | meqnInErr, | ||
integer, intent(out) | ierr | ||
) |
Solves the eigenvalue problem (A + λB) * u = 0.
aMat | System matrix A | |
bMat | System matrix B | |
[in] | mip | Matrix of input parameters, see LANCZ2 or SPRLAN in SAM |
[out] | mop | Matrix of output parameters, see LANCZ2 or SPRLAN |
[in] | meqn1 | Matrix of status 1 (internal) equation numbers |
[in] | neq | Size of the equation system to solve |
[in] | nEigVal | Number of eigenvalues to return |
[in] | nEigVec | Number of eigenvectors to return |
[in] | tolerance | Array of tolerances, see LANCZ2 or SPRLAN |
[in] | shift | Shift value |
[out] | eigValues | Computed eigenvalues |
[out] | eigVectors | Computed eigenvectors |
[in] | ipsw | Print switch for debug output |
[in] | lpu | File unit number for res-file output |
[out] | meqnInErr | Equation numbers of all singularities detected |
[out] | ierr | Error flag |
|
private |
Solves the linear system of equations Ax = B.
This version accepts the right-hand-side vectors rhs to be provided as a 2D neq×nrhs matrix instead of a 1D array.
|
private |
Solves the linear system of equations Ax = B.
[in] | iop | Calculation option (see below) |
[in] | iopSing | Singularity handling options (see below) |
sysMat | The coefficient matrix A | |
rhs | The right-hand-side vector(s) B, solution on output | |
[in] | nrhs | Number of right-hand-side vectors |
[in] | lpu | File unit number for res-file output |
[out] | ierr | Error flag |
[out] | eqnInErr | Equation number of the first singularity detected |
[out] | meqnInErr | Equation numbers of all singularities detected |
[in] | tolFactorize | Singularity tolerance |
[in] | scaleOnSing | Scaling factor for singular pivot elements |
[in] | neq1 | Number of equations to solve for |
Basic equations: Ax = B, LDL'x = B, LDy = B, L'x = y. The value on the input argument iop defines which solution step to do:
The singularity handling flag iopSing is interpreted as follows:
subroutine solextensionmodule::cssolvesupel | ( | integer, intent(in) | iopSing, |
type(sysmatrixtype), intent(inout) | sysMat, | ||
real(dp), dimension(:,:), intent(in) | sysRhs, | ||
real(dp), dimension(:,:), intent(out) | supElMat, | ||
real(dp), dimension(:,:), intent(out), target | supElRhs, | ||
integer, dimension(:), intent(in) | meqn1, | ||
integer, dimension(:), intent(in) | meqn2, | ||
integer, intent(in) | nrhs, | ||
integer, intent(in) | lpu, | ||
integer, intent(out) | ierr, | ||
type(diskmatrixtype), intent(inout), optional | Bmatrix, | ||
integer(ik), intent(out), optional | eqnInErr, | ||
integer(ik), dimension(:), intent(out), optional | meqnInErr, | ||
real(dp), intent(in), optional | tolFactorize, | ||
real(dp), intent(in), optional | scaleOnSing | ||
) |
Performs the superelement reduction for the equation system.
[in] | iopSing | Singularity handling options (see below) |
sysMat | The system stiffness matrix | |
[in] | sysRhs | The system right-hand-side vector(s) |
[out] | supElMat | The reduced stiffness matrix, K |
[out] | supElRhs | The reduced right-hand-side vector(s), f |
[in] | meqn1 | Matrix of status 1 (internal) equation numbers |
[in] | meqn2 | Matrix of status 2 (external) equation numbers |
[in] | nrhs | Number of right-hand-side vectors |
[in] | lpu | File unit number for res-file output |
[out] | ierr | Error flag |
[out] | Bmatrix | Displacement recovery matrix |
[out] | eqnInErr | Equation number of the first singularity detected |
[out] | meqnInErr | Equation numbers of all singularities detected |
[in] | tolFactorize | Singularity tolerance |
[in] | scaleOnSing | Scaling factor for singular pivot elements |
A static condensation of the internal (i) degrees of freedom is performed, retaining only the external (e) degrees of freedom, i.e.,
|Kii Kie|*|vi| = |fi| ====> K*ve = f |Kei Kee| |ve| |fe| (sysMat) (sysRhs)
where
K = Kee - Kei*(Kii^-1)*Kie (returned in supElMat) f = fe - Kei*(Kii^-1)*fi (returned in supElRhs)
If the Bmatrix is present, it is also returned
B = -(Kii^-1)*Kie
The singularity handling flag iopSing is interpreted as follows:
|
private |
Default tolerance.