22 #ifndef OHMMS_CRYSTALLATTICE_H 23 #define OHMMS_CRYSTALLATTICE_H 26 #include "config/stdlib/Constants.h" 54 template<
class T,
unsigned D>
159 for (
int i = 0; i < D; i++)
160 if (-std::numeric_limits<T1>::epsilon() < val_dot[i] && val_dot[i] < 0)
161 val_dot[i] = T1(0.0);
180 for (
int dim = 0; dim < D; dim++)
181 inside &= (
BoxBConds[dim] || (u[dim] >= T(0) && u[dim] < T(1)));
188 for (
int i = 0; i < D; ++i)
199 for (
int i = 0; i < D; ++i)
200 u[i] = u[i] - round(u[i]);
235 template<
typename T1>
238 Base::LR_dim_cutoff = rhs.LR_dim_cutoff;
239 Base::LR_kc = rhs.LR_kc;
240 Base::LR_rc = rhs.LR_rc;
241 Base::num_ewald_grid_points = rhs.num_ewald_grid_points;
242 Base::ndim = rhs.ndim;
282 void print(std::ostream&,
int level = 2)
const;
a class that defines a supercell in D-dimensional Euclean space.
bool isValid(const TinyVector< T, D > &u) const
return true if all the open direction of reduced coordinates u are in the range [0,1)
int SuperCellEnum
supercell enumeration
SingleParticlePos Center
Center of the cell sum(Rv[i])/2.
Member function definitions of CrystalLattice<T,D>, included by CrystalLattice.h. ...
void reset()
Evaluate the reciprocal vectors, volume and metric tensor.
helper functions for EinsplineSetBuilder
CrystalLattice< T, D > & operator=(const CrystalLattice< T1, D > &rhs)
assignment operator
Scalar_t WignerSeitzRadius_G
Wigner-Seitz cell radius in reciprocal space.
MakeReturn< UnaryNode< FnFabs, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t abs(const Vector< T1, C1 > &l)
T VacuumScale
The scale factor for adding vacuum.
CrystalLattice< T, D > & operator*=(T sc)
scale the lattice vectors by sc.
Tensor_t G
Reciprocal unit vectors. G(j,i) i=vector and j=x,y,z.
void print(std::ostream &, int level=2) const
Print out CrystalLattice Data.
TinyVector< SingleParticlePos, D > Rv
Real-space unit vectors.
T ksq(const SingleParticlePos &kin) const
evaluate
SingleParticlePos Length
Length[idim] length of the idim-th lattice vector.
SingleParticlePos k_cart(const SingleParticlePos &kin) const
conversion of a reciprocal-vector
Tensor_t Gt
Transpose of reciprocal unit vectors:
Scalar_t Volume
Physical properties of a supercell.
TinyVector< int, D > BoxBConds
The boundary condition in each direction.
SingleParticlePos toUnit_floor(const TinyVector< T1, D > &r) const
SingleParticlePos OneOverLength
OneOverLength[idim] 1/length of the idim-th lattice vector.
SingleParticlePos a(int i) const
Provide interfaces familiar to fotran users.
SingleParticlePos k_unit(const SingleParticlePos &kin) const
conversion of a caresian reciprocal-vector to unit k-vector
SingleParticlePos toUnit(const TinyVector< T1, D > &r) const
Convert a cartesian vector to a unit vector.
CrystalLattice()
default constructor, assign a huge supercell
T Dot(const SingleParticlePos &ra, const SingleParticlePos &rb) const
evaluate the cartesian distance
TinyVector< SingleParticlePos, D > Gv
Reciprocal unit vectors.
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
bool outOfBound(const TinyVector< T, D > &u) const
return true if any direction of reduced coordinates u goes larger than 0.5
SingleParticlePos toCart(const TinyVector< T1, D > &c) const
Convert a unit vector to a cartesian vector.
Scalar_t SimulationCellRadius
simulation cell radii
bool explicitly_defined
true, the lattice is defined by the input instead of an artificial default
bool DiagonalOnly
true, if off-diagonal elements are zero so that other classes can take advantage of this ...
Scalar_t WignerSeitzRadius
Wigner-Seitz cell radius.
void applyMinimumImage(TinyVector< T, D > &c) const
Scalar_t CellRadiusSq
SimulationCellRadius*SimulationCellRadius.
Tensor_t Mg
Metric tensor for G vectors.
SingleParticlePos b(int i) const
Provide interfaces familiar to fotran users.
Tensor_t R
Real-space unit vectors. R(i,j) i=vector and j=x,y,z.
MakeReturn< UnaryNode< FnFloor, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t floor(const Vector< T1, C1 > &l)
ST Scalar_t
the type of scalar