7#ifndef model_ReciprocalLatticeVector_cpp_
8#define model_ReciprocalLatticeVector_cpp_
11#include <LatticeModule.h>
17 typename ReciprocalLatticeVectorBase<dim>::BaseType& ReciprocalLatticeVectorBase<dim>::base()
23 const typename ReciprocalLatticeVectorBase<dim>::BaseType& ReciprocalLatticeVectorBase<dim>::base()
const
41 BaseType(
LatticeCore<dim>::integerCoordinates(d, lat.latticeBasis.transpose())),
51 assert(&
lattice == &other.
lattice &&
"ReciprocalLatticeVectorBase<dim> belong to different Lattices.");
52 base() = other.base();
59 assert(&
lattice == &other.
lattice &&
"LatticeVectors belong to different Lattices.");
60 base() = other.base();
67 assert(&
lattice == &other.
lattice &&
"LatticeVectors belong to different Lattices.");
74 assert(&
lattice == &other.
lattice &&
"LatticeVectors belong to different Lattices.");
75 base() += other.base();
82 assert(&
lattice == &other.
lattice &&
"LatticeVectors belong to different Lattices.");
89 assert(&
lattice == &other.
lattice &&
"LatticeVectors belong to different Lattices.");
90 base() -= other.base();
103 assert(&
lattice == &other.
lattice &&
"LatticeVectors belong to different Lattices.");
112 return lattice.reciprocalBasis * this->
template cast<double>();
125 return c /
c.squaredNorm();
131 assert(this->squaredNorm() > 0 &&
"A null ReciprocalLatticeVector cannot be used to compute planeIndexOfPoint");
133 return std::lround(hd);
139 assert(this->squaredNorm() > 0 &&
"A null ReciprocalLatticeVector cannot be used to compute planeIndexOfPoint");
142 if (fabs(hd -
h) > FLT_EPSILON)
144 std::cout <<
"P=" << P.transpose() << std::endl;
145 std::cout <<
"r=" << this->
cartesian().transpose() << std::endl;
146 std::cout <<
"hd=" << std::setprecision(15) << std::scientific << hd << std::endl;
147 std::cout <<
"h=" <<
h << std::endl;
148 assert(0 &&
"P in not on a lattice plane.");
156 assert(this->squaredNorm() > 0 &&
"A null ReciprocalLatticeVector cannot be used to compute planeIndexOfPoint");
187 ReciprocalLatticeVectorBase<dim>(lat)
194ReciprocalLatticeVector<dim>::ReciprocalLatticeVector(
const VectorDimD &d,
195 const Lattice<dim> &lat) :
196 ReciprocalLatticeVectorBase<
dim>(d,lat)
219 assert(&
lattice == &other.
lattice &&
"LatticeVectors belong to different Lattices.");
const LatticeType & lattice
LatticeCore< 3 >::VectorDimD VectorDimD
LatticeCore< 3 >::VectorDimI VectorDimI
ReciprocalLatticeVectorBase(const Lattice< dim > &lat)
IntScalarType dot(const LatticeVector< dim > &other) const
VectorDimD interplaneVector() const
LatticeCore< dim >::IntScalarType IntScalarType
const Lattice< dim > & lattice
IntScalarType planeIndexOfPoint(const VectorDimD &P) const
IntScalarType closestPlaneIndexOfPoint(const VectorDimD &P) const
LatticeCore< dim >::VectorDimI VectorDimI
ReciprocalLatticeVectorBase< dim > operator+(const ReciprocalLatticeVectorBase< dim > &other) const
LatticeCore< dim >::VectorDimD VectorDimD
ReciprocalLatticeVectorBase< dim > & operator-=(const ReciprocalLatticeVectorBase< dim > &other)
ReciprocalLatticeVectorBase< dim > & operator+=(const ReciprocalLatticeVectorBase< dim > &other)
ReciprocalLatticeVectorBase< dim > & operator=(const ReciprocalLatticeVectorBase< dim > &other)
double planeSpacing() const
VectorDimD cartesian() const
ReciprocalLatticeVectorBase< dim > operator*(const IntScalarType &scalar) const
ReciprocalLatticeVectorBase< dim > operator-(const ReciprocalLatticeVectorBase< dim > &other) const
LatticeDirectionType cross(const ReciprocalLatticeVectorType &other) const
ReciprocalLatticeVector(const LatticeType &lat)
const LatticeType & lattice
auto operator*(const std::shared_ptr< BilinearForm< T1, T2 > > &f, const IntegrationDomain< FE, D, Q, Rule > &dom)