Meshing
divERGe strictly operates on regular momentum meshes along the reciprocal
lattice vectors. In the Model, a coarse and a fine momentum mesh can be
set (diverge_model_t.nk and diverge_model_t.nkf). To
access the generated meshes, use the functions provided in the Internals
section. To generate meshes or reciprocal lattice vectors, use the functions
given here.
-
struct diverge_lattice_t
[source] struct for lattice vectors, required only to be used as return value
-
diverge_lattice_t diverge_model_generate_meshes(double *kmesh, double *kfmesh, const index_t nk[3], const index_t nkf[3], double lattice[3][3])
[source] mesh generation helper function, useful for your own models
- Parameters:
kmesh (double*) – array to store the coarse momentum mesh in, dimension (nk[0],nk[1],nk[2],3).
kfmesh (double*) – array to store the fine momentum mesh in, dimension (nk[0]*nkf[0],nk[1]*nkf[1],nk[2]*nkf[2],3).
- Reutrns diverge_lattice_t:
the reciprocal lattice vectors
-
void diverge_model_generate_mom_basis(double *lattice, double *kbasis)
[source] use lattice vectors to generate reciprocal lattice vectors. corrects for left-handed coordinate systems.
- Parameters:
lattice (double[3][3]) – lattice vectors in C ordering (see
diverge_model_t.lattice), input & output.kbasis (double[3][3]) – reciprocal lattice vectors in C ordering, output.
-
index_t *diverge_kmesh_to_bands(diverge_model_t *m, index_t **indices, index_t *n_indices)
[source] finds fine mesh points (as indices) that lie on the segments that define the irreducible path. Useful for, e.g., generation of the Hamiltonian (or self-energy) along the irreducible path, or outputting a susceptibility. Written such that the runtime is O(nk * n_ibz_path). Requires a previous call to
diverge_model_internals_common()in order to prepare the momentum meshes.- Parameters:
m (diverge_model_t) – the model to use (with bandstructure path defined in
diverge_model_t.ibz_pathanddiverge_model_t.n_ibz_path)indices (index_t*) – pointer to result array that is allocated and filled with the indices that lie on the ibz path. indices refer to fine mesh.
n_indices (index_t) – pointer to length of result array
- Returns:
The number of points per segment in an array. both the returned array as well as the
*indicesarray must be free’d manually.
Example:
diverge_kmesh_to_bands()ordiverge_kmesh_to_bands_crs()can be used as follows:diverge_model_t* m; // fill m with appropriate content diverge_model_internals_common( m ); index_t* pts; index_t n_pts; index_t* n_per_segment = diverge_kmesh_to_bands( m, &pts, &n_pts ); // do something with pts, n_pts, and n_per_segment. free( pts ); free( n_per_segment );
-
index_t *diverge_kmesh_to_bands_crs(diverge_model_t *m, index_t **indices, index_t *n_indices)
[source] same as
diverge_kmesh_to_bands(), but for the coarse mesh.
-
double diverge_kmesh_to_bands_set_zero(double zero)
[source] set floating point ‘zero’ value for kmesh to bands, defaults to
DIVERGE_EPS_MESH. Returns previous value. Does not update value ifqnan_isnan(zero)(cf.qnan_isnan()).