Routines to analyse the regular k-point mesh and determine the overlaps neccessary for a finite difference representation of the spread operator. These overlaps are defined by a set of vectors (b-vectors) which connect the Bloch states. See Eq. B1 in Appendix B of Marzari and Vanderbilt PRB 56 12847 (1997)
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private, | parameter | :: | nsupcell | = | 5 | Size of supercell (of recip cell) in which to search for k-point shells |
integer, | private | :: | lmn(3,(2*nsupcell+1)**3) | Order in which to search the cells (ordered in dist from origin) |
|||
real(kind=dp), | private | :: | bvec_inp(3,num_nnmax,max_shells) | The input b-vectors (only used in the rare case they are read from file) |
A reproducible maxloc function so b-vectors come in the same order each time
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | dist((2*nsupcell+1)**3) | Distances from the origin of the unit cells in the supercell. |
Main routine to calculate the b-vectors
Writes nnkp file (list of overlaps needed)
Release memory from the kmesh module
We look for kpoint neighbours in a large supercell of reciprocal unit cells. Done sequentially this is very slow. Here we order the cells by the distance from the origin. Doing the search in this order gives a dramatic speed up
Returns the b-vectors for a given shell and kpoint.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | multi | |||
integer, | intent(in) | :: | kpt | |||
real(kind=dp), | intent(in) | :: | shell_dist | |||
real(kind=dp), | intent(out) | :: | bvector(3,multi) |
Find the correct set of shells to satisfy B1 The stratagy is: 1) Take the bvectors from the next shell 2) Reject them if they are parallel to exisiting b vectors 3) Test to see if we satisfy B1, if not add another shell and repeat
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | multi(search_shells) | |||
real(kind=dp), | intent(in) | :: | dnn(search_shells) | |||
real(kind=dp), | intent(out) | :: | bweight(max_shells) |
Find the B1 weights for a set of shells specified by the user
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | multi(search_shells) | |||
real(kind=dp), | intent(in) | :: | dnn(search_shells) | |||
real(kind=dp), | intent(out) | :: | bweight(max_shells) |
Find the B1 weights for a set of b-vectors given in a file. This routine is only activated via a devel_flag and is not intended for regular use.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(inout) | :: | multi(search_shells) | |||
real(kind=dp), | intent(in) | :: | dnn(search_shells) | |||
real(kind=dp), | intent(out) | :: | bweight(max_shells) |