19 #include <gsl/gsl_linalg.h>
30 :
Lattice3D(lattice.m_a, lattice.m_b, lattice.m_c)
53 return direction.unit();
79 int max_X = std::lround(
m_a.mag() * dq /
M_TWOPI);
80 int max_Y = std::lround(
m_b.mag() * dq /
M_TWOPI);
81 int max_Z = std::lround(
m_c.mag() * dq /
M_TWOPI);
83 std::vector<R3> result;
84 for (
int index_X = -max_X; index_X <= max_X; ++index_X) {
85 for (
int index_Y = -max_Y; index_Y <= max_Y; ++index_Y) {
86 for (
int index_Z = -max_Z; index_Z <= max_Z; ++index_Z) {
87 I3 coords = I3(index_X, index_Y, index_Z) + nearest_coords;
90 R3 latticePoint = coords.x() *
m_ra + coords.y() *
m_rb + coords.z() *
m_rc;
91 if ((latticePoint - q).mag() <= dq)
92 result.push_back(latticePoint);
Defines M_PI and some more mathematical constants.
Defines classes ISelectionRule, SimpleSelectionRule.
Declares class RotMatrix.
Abstract base class for selection rules.
virtual ISelectionRule * clone() const =0
A Bravais lattice, characterized by three basis vectors, and optionally an ISelectionRule.
I3 nearestReciprocalLatticeVectorCoordinates(R3 q) const
Returns the nearest reciprocal lattice point from a given vector.
Lattice3D rotated(const RotMatrix &rotMatrix) const
Creates rotated lattice.
double unitCellVolume() const
Returns the volume of the unit cell.
R3 m_rc
Cache of basis vectors in reciprocal space.
R3 getMillerDirection(double h, double k, double l) const
Returns normalized direction corresponding to the given Miller indices.
void computeReciprocalVectors() const
void setSelectionRule(const ISelectionRule &selection_rule)
Sets a selection rule for the reciprocal vectors.
R3 m_c
Basis vectors in real space.
std::unique_ptr< ISelectionRule > m_selection_rule
void reciprocalLatticeBasis(R3 &ra, R3 &rb, R3 &rc) const
Returns the reciprocal basis vectors.
std::vector< R3 > reciprocalLatticeVectorsWithinRadius(R3 q, double dq) const
Returns a list of reciprocal lattice vectors within distance dq of a vector q.
Lattice3D(R3 a, R3 b, R3 c)
Rotation matrix in three dimensions. Represents group SO(3). Internal parameterization based on quate...
T transformed(const T &v) const
Return transformed vector v.