AbstractMeshes

This module provides the abstract type of meshes defined in this package.

BrillouinZoneMeshes.AbstractMeshesModule
module 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.

source
BrillouinZoneMeshes.AbstractMeshes.AbstractMeshType
abstract 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
source
Base.getindexMethod
function 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: mesh
  • Coords: traits of coordinate type, omitted by default
  • i/inds...: index of mesh point in linear or cartesian index
source
BrillouinZoneMeshes.AbstractMeshes.locateMethod
function 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 mesh
  • x: cartesian pos to locate
source
BrillouinZoneMeshes.AbstractMeshes.volumeMethod
function 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: mesh
  • i: index of mesh point, if ommited return volume of whole mesh
source