AbstractMeshes
This module provides the abstract type of meshes defined in this package.
BrillouinZoneMeshes.AbstractMeshes
— Modulemodule AbstractMeshes
This sub-module defines abstract type "AbstractMesh", from which all concrete types of meshes in this package derive. All functions expected by a sub-type of "AbstractMesh" are defined in this file, including AbstractArray interface requirements and functions like "locate" and "volume". If the implementation of a function is type-specific, the function defined in this file will return error.
BrillouinZoneMeshes.AbstractMeshes.AbstractMesh
— Typeabstract type AbstractMesh{T,DIM} <: AbstractArray{SVector{T,DIM},DIM}
Parent type of all meshes in this package.
The default return value of AbstractMesh should be a SVector{T,DIM}, which is assumed to be the cartesian coordinates of the mesh points, even if the mesh it self is polar. Other representations of mesh points such as polar coordinates and fractional coordinates could be provided via getindex with traits.
Required Fields:
size
: the size of the mesh as a tuple of integers
Base.getindex
— Methodfunction Base.getindex(mesh::AbstractMesh, ...)
Return mesh point at given index of the mesh. Index could be given as linear index or cartesian index. By default return cartesian coordinates of the point, other representations could be obtained by traits:"mesh[FracCoords, i]".
Parameters:
mesh
: meshCoords
: traits of coordinate type, omitted by defaulti/inds...
: index of mesh point in linear or cartesian index
BrillouinZoneMeshes.AbstractMeshes.locate
— Methodfunction AbstractMeshes.locate(mesh, x)
locate mesh point in mesh that is nearest to x. Useful for Monte-Carlo algorithm. Could also be used for zeroth order interpolation. Mesh specific implementation required.
Parameters
mesh
: aimed meshx
: cartesian pos to locate
BrillouinZoneMeshes.AbstractMeshes.volume
— Methodfunction AbstractMeshes.volume(mesh, i)
volume represented by mesh point i. When i is omitted return volume of the whole mesh. Mesh specific implementation required.
Parameters:
mesh
: meshi
: index of mesh point, if ommited return volume of whole mesh