occ
Loading...
Searching...
No Matches
occ::crystal::HKL Struct Reference

A struct representing a lattice vector triplet (h, k, l) in a crystal lattice. More...

#include <hkl.h>

Public Member Functions

double d (const Mat3 &lattice) const
 Calculates the magnitude of the lattice vector represented by this HKL object.
 
Vec3 vector () const
 
bool operator== (const HKL &rhs) const
 
HKL operator- (const HKL &rhs) const
 
bool operator< (const HKL &rhs) const
 
bool operator> (const HKL &rhs) const
 
HKL operator+ (const HKL &rhs) const
 
HKLoperator+= (const HKL &rhs)
 
HKLoperator-= (const HKL &rhs)
 

Static Public Member Functions

static HKL maximum ()
 The maximum representable HKL structure.
 
static HKL minimum ()
 The minimum representable HKL structure.
 
static HKL floor (const Vec3 &vec, double tolerance=1e-8)
 
static HKL ceil (const Vec3 &vec)
 
static HKL from_vector (const Vec3 &vec)
 

Public Attributes

int h {0}
 
int k {0}
 
int l {0}
 

Detailed Description

A struct representing a lattice vector triplet (h, k, l) in a crystal lattice.

The HKL struct is used to represent a triplet of integers (h, k, l) that defines a lattice vector in a crystal lattice. The triplet is typically used to index the reciprocal lattice of the crystal lattice, with h, k, and l being the Miller indices of the lattice vector in the reciprocal lattice.

The HKL struct provides methods to calculate the magnitude of the lattice vector using the lattice parameters of the crystal lattice, and to compare HKL objects using the magnitude of the lattice vectors.

Member Function Documentation

◆ ceil()

static HKL occ::crystal::HKL::ceil ( const Vec3 vec)
static

◆ d()

double occ::crystal::HKL::d ( const Mat3 lattice) const

Calculates the magnitude of the lattice vector represented by this HKL object.

The magnitude of the lattice vector is calculated using the lattice parameters of the crystal lattice, as follows:

\[ d = \sqrt{h^2 a^2 + k^2 b^2 + l^2 c^2 + 2 hk ab \cos \gamma + 2 hl ac \cos \beta + 2 kl bc \cos \alpha} \]

where (h, k, l) are the Miller indices of the lattice vector, and (a, b, c) and ( \(\alpha\), \(\beta\), \(\gamma\)) are the lattice parameters of the crystal lattice.

Parameters
latticeThe lattice parameters of the crystal lattice, represented as a 3x3 matrix. The matrix must have the lattice vectors as columns, in the order (a, b, c).
Returns
The magnitude of the lattice vector represented by this HKL object, as a floating-point value.

◆ floor()

static HKL occ::crystal::HKL::floor ( const Vec3 vec,
double  tolerance = 1e-8 
)
static

◆ from_vector()

static HKL occ::crystal::HKL::from_vector ( const Vec3 vec)
static

◆ maximum()

static HKL occ::crystal::HKL::maximum ( )
inlinestatic

The maximum representable HKL structure.

◆ minimum()

static HKL occ::crystal::HKL::minimum ( )
inlinestatic

The minimum representable HKL structure.

◆ operator+()

HKL occ::crystal::HKL::operator+ ( const HKL rhs) const
inline

◆ operator+=()

HKL & occ::crystal::HKL::operator+= ( const HKL rhs)
inline

◆ operator-()

HKL occ::crystal::HKL::operator- ( const HKL rhs) const
inline

◆ operator-=()

HKL & occ::crystal::HKL::operator-= ( const HKL rhs)
inline

◆ operator<()

bool occ::crystal::HKL::operator< ( const HKL rhs) const
inline

◆ operator==()

bool occ::crystal::HKL::operator== ( const HKL rhs) const
inline

◆ operator>()

bool occ::crystal::HKL::operator> ( const HKL rhs) const
inline

◆ vector()

Vec3 occ::crystal::HKL::vector ( ) const

Member Data Documentation

◆ h

int occ::crystal::HKL::h {0}

◆ k

int occ::crystal::HKL::k {0}

◆ l

int occ::crystal::HKL::l {0}

The documentation for this struct was generated from the following file: