Contains routines for evaluating B.dW in the SDE for Brownian Dynamics simulation.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=4), | private | :: | meth |
Method to use for generating Brownian terms. Possible values are 'CHOL' or 'LANC'. |
|||
| integer, | private | :: | sizm |
Size of the mobility matrix |
|||
| integer, | private | :: | s |
Number of Brownian vectors to be generated; equivalent to block size in the block Lanczos algorithm. |
|||
| integer, | private | :: | dimk_min | = | 2 |
Minimum dimension of KSP |
|
| integer, | private | :: | dimk_max |
Maximum dimension of KSP |
|||
| real(kind=rp), | private | :: | ethres | = | 1.0e-3_rp |
Error threshold for KSP-based method. |
|
| real(kind=rp), | private, | dimension(:,:), allocatable | :: | bdw_old |
( |
||
| real(kind=rp), | private, | dimension(:,:), allocatable | :: | lncv |
( |
||
| real(kind=rp), | private, | dimension(:), allocatable | :: | eigvlh |
( |
||
| real(kind=rp), | private, | dimension(:,:), allocatable | :: | eigvch |
( |
||
| real(kind=rp), | private, | dimension(:,:), allocatable | :: | w |
( |
||
| real(kind=rp), | private, | dimension(:), allocatable | :: | h_d |
( |
||
| real(kind=rp), | private, | dimension(:), allocatable | :: | h_sd |
( |
||
| real(kind=rp), | private, | dimension(:), allocatable | :: | tau |
( |
||
| real(kind=rp), | private, | dimension(:,:), allocatable | :: | matr |
( |
||
| real(kind=rp), | private, | dimension(:,:), allocatable | :: | h_bd |
( |
||
| real(kind=rp), | private, | dimension(:,:), allocatable | :: | h_bsd |
( |
||
| real(kind=rp), | private, | dimension(:,:), allocatable | :: | h_bnd |
( |
||
| real(kind=rp), | private, | dimension(:,:), allocatable | :: | tmp |
( |
||
| real(kind=rp), | private, | dimension(:), allocatable | :: | work |
Workspace array for LAPACK routines. |
||
| integer, | private, | dimension(:), allocatable | :: | iwork |
Workspace array for LAPACK routines. |
Performs initial setup.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
Size of the mobility matrix. |
||
| integer, | intent(in) | :: | nblks |
Number of B.dW vectors to generate for the same mobility matrix.
|
||
| character(len=4), | intent(in) | :: | mth |
Method for calculating the Brownian terms. |
||
| integer, | intent(in), | optional | :: | f |
For KSP-based method, maximum number of iterations.
Must be present if |
|
| real(kind=rp), | intent(in), | optional | :: | e |
For KSP-based method, error threshold for convergence.
Must be present if |
Performs cleanup.
Main driver routine for calculating B.dW.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rp), | intent(inout), | dimension(:,:) | :: | mob |
( |
|
| real(kind=rp), | intent(inout), | dimension(:,:) | :: | bdw |
( |
|
| integer, | intent(out) | :: | ierr |
Error flag. |
||
| logical, | intent(out), | optional | :: | lconv |
If |
|
| integer, | intent(out), | optional | :: | f |
If |
Implements Lanczos algorithm for calculating B.dW.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rp), | intent(in), | dimension(:,:) | :: | mob |
( |
|
| real(kind=rp), | intent(inout), | dimension(:,:) | :: | bdw |
( |
|
| logical, | intent(out) | :: | lconv |
Returns true if converged, false otherwise. |
||
| integer, | intent(out) | :: | f |
The number of iterations performed. |
||
| integer, | intent(out) | :: | ierr |
Error flag. |
Implements block Lanczos algorithm for calculating B.dW.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rp), | intent(in), | dimension(:,:) | :: | mob |
( |
|
| real(kind=rp), | intent(inout), | dimension(:,:) | :: | bdw |
( |
|
| logical, | intent(out) | :: | lconv |
Returns true if converged, false otherwise. |
||
| integer, | intent(out) | :: | f |
The number of iterations performed. |
||
| integer, | intent(out) | :: | ierr |
Error flag. |
Calculates B.dW using Cholesky decomposition.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rp), | intent(inout), | dimension(:,:) | :: | mob |
( |
|
| real(kind=rp), | intent(inout), | dimension(:,:) | :: | bdw |
( |
|
| integer, | intent(out) | :: | ierr |
Error flag. |
Calculates standard normally distributed random vectors.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rp), | intent(out), | dimension(:,:), target | :: | dw |
( |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rp), | intent(in), | dimension(:,:) | :: | mob |
( |
|
| real(kind=rp), | intent(inout), | dimension(:,:) | :: | bdw |
( |
|
| logical, | intent(out) | :: | lconv |
Returns true if converged, false otherwise. |
||
| integer, | intent(out) | :: | f |
The number of iterations performed. |
||
| integer, | intent(out) | :: | ierr |
Error flag. |