20 #include <gsl/gsl_linalg.h>
23 : m_a(a), m_b(b), m_c(c)
30 :
INode(), m_a(lattice.m_a), m_b(lattice.m_b), m_c(lattice.m_c)
70 return direction.
unit();
101 std::vector<kvector_t> ret;
102 for (
int index_X = -max_X; index_X <= max_X; ++index_X) {
103 for (
int index_Y = -max_Y; index_Y <= max_Y; ++index_Y) {
104 for (
int index_Z = -max_Z; index_Z <= max_Z; ++index_Z) {
105 ivector_t coords(index_X + nearest_coords[0], index_Y + nearest_coords[1],
106 index_Z + nearest_coords[2]);
110 if ((latticePoint - q).mag() <= dq)
111 ret.push_back(latticePoint);
Defines M_PI and some more mathematical constants.
Defines classes ISelectionRule, SimpleSelectionRule.
Defines class RealParameter.
auto dot(const BasicVector3D< U > &v) const
Returns dot product of vectors (antilinear in the first [=self] argument).
BasicVector3D< T > unit() const
Returns unit vector in direction of this. Throws for null vector.
double mag() const
Returns magnitude of the vector.
auto cross(const BasicVector3D< U > &v) const
Returns cross product of vectors (linear in both arguments).
Base class for tree-like structures containing parameterized objects.
void registerVector(const std::string &base_name, kvector_t *p_vec, const std::string &units="nm")
static std::string XComponentName(const std::string &base_name)
RealParameter * parameter(const std::string &name) const
Returns parameter with given 'name'.
void setName(const std::string &name)
Abstract base class for selection rules.
virtual ISelectionRule * clone() const =0
A Bravais lattice, characterized by three basis vectors, and optionally an ISelectionRule.
double unitCellVolume() const
Returns the volume of the unit cell.
ivector_t getNearestReciprocalLatticeVectorCoordinates(const kvector_t q) const
Returns the nearest reciprocal lattice point from a given vector.
void computeReciprocalVectors() const
kvector_t m_rc
Cache of basis vectors in reciprocal space.
kvector_t m_c
Basis vectors in real space.
void setSelectionRule(const ISelectionRule &selection_rule)
Sets a selection rule for the reciprocal vectors.
Lattice3D transformed(const Transform3D &transform) const
Creates transformed lattice.
void getReciprocalLatticeBasis(kvector_t &ra, kvector_t &rb, kvector_t &rc) const
Returns the reciprocal basis vectors.
kvector_t getMillerDirection(double h, double k, double l) const
Returns normalized direction corresponding to the given Miller indices.
std::unique_ptr< ISelectionRule > m_selection_rule
std::vector< kvector_t > reciprocalLatticeVectorsWithinRadius(const kvector_t q, double dq) const
Returns a list of reciprocal lattice vectors within distance dq of a vector q.
void onChange() override
Action to be taken in inherited class when a parameter has changed.
void initialize()
Initializes cached data.