14 #ifndef QMCPLUSPLUS_PARTICLE_BCONDS_2D_H 15 #define QMCPLUSPLUS_PARTICLE_BCONDS_2D_H 41 r2max(lat.CellRadiusSq)
45 for (
int i = -1; i <= 1; ++i)
46 for (
int j = -1; j <= 1; ++j)
50 nextcells[ic][0] = i * r00 + j * r10;
51 nextcells[ic][1] = i * r01 + j * r11;
66 T d2 = a[0] * a[0] + a[1] * a[1];
73 for (
int i = 0; i < 8; ++i)
76 d2 = c[0] * c[0] + c[1] * c[1];
97 TinyVector<T, 2> ar(displ[0] * g00 + displ[1] * g10, displ[0] * g01 + displ[1] * g11);
99 ar[0] -= round(ar[0]);
100 ar[1] -= round(ar[1]);
102 displ[0] = ar[0] * r00 + ar[1] * r10;
103 displ[1] = ar[0] * r01 + ar[1] * r11;
105 return get_min_distance(displ);
110 const int n = dr.size();
111 for (
int i = 0; i <
n; ++i)
119 for (
int i = 0; i < dr.size(); ++i)
145 r2max(lat.CellRadiusSq)
156 TinyVector<T, 2> ar(displ[0] * g00 + displ[1] * g10, displ[0] * g01 + displ[1] * g11);
158 ar[0] -= round(ar[0]);
159 ar[1] -= round(ar[1]);
161 displ[0] = ar[0] * r00 + ar[1] * r10;
162 displ[1] = ar[0] * r01 + ar[1] * r11;
163 return displ[0] * displ[0] + displ[1] * displ[1];
168 const int n = dr.size();
169 for (
int i = 0; i <
n; ++i)
177 for (
int i = 0; i < dr.size(); ++i)
190 : Linv0(lat.OneOverLength[0]), L0(lat.Length[0]), Linv1(lat.OneOverLength[1]), L1(lat.Length[1])
200 T x = displ[0] * Linv0;
201 displ[0] = L0 * (x - round(x));
202 T y = displ[1] * Linv1;
203 displ[1] = L1 * (y - round(y));
204 return displ[0] * displ[0] + displ[1] * displ[1];
211 const int n = r.size();
213 for (
int i = 0; i <
n; ++i)
221 for (
int i = 0; i < dr.size(); ++i)
222 r[i] =
dot(dr[i], dr[i]);
242 T x = displ[0] * Linv0;
243 displ[0] = L0 * (x - round(x));
244 return displ[0] * displ[0] + displ[1] * displ[1];
251 const int n = r.size();
253 for (
int i = 0; i <
n; ++i)
261 for (
int i = 0; i < dr.size(); ++i)
262 r[i] =
dot(dr[i], dr[i]);
267 #endif // OHMMS_PARTICLE_BCONDS_2D_H a class that defines a supercell in D-dimensional Euclean space.
DTD_BConds(const CrystalLattice< T, 2 > &lat)
T get_min_distance(TinyVector< T, 2 > &a) const
evaluate the minimum distance
helper functions for EinsplineSetBuilder
void apply_bc(std::vector< TinyVector< T, 2 >> &dr, std::vector< T > &r, std::vector< T > &rinv) const
evaluate displacement data for a vector
void apply_bc(std::vector< TinyVector< T, 2 >> &dr, std::vector< T > &r) const
void apply_bc(std::vector< TinyVector< T, 2 >> &dr, std::vector< T > &r, std::vector< T > &rinv) const
evaluate displacement data for a vector
Declaration of CrystalLattice<T,D>
T apply_bc(TinyVector< T, D > &displ) const
apply BC on displ and return |displ|^2
std::vector< TinyVector< T, 2 > > nextcells
std::vector< TinyVector< T, 2 > > nextcells
T apply_bc(TinyVector< T, 2 > &displ) const
apply BC to a displacement vector a and return the minimum-image distance
void inv(const T *restrict in, T *restrict out, int n)
T apply_bc(TinyVector< T, 2 > &displ) const
apply BC to a displacement vector a and return the minimum-image distance
void apply_bc(std::vector< TinyVector< T, 2 >> &dr, std::vector< T > &r) const
T apply_bc(TinyVector< T, 2 > &displ) const
evaluate |a| and apply boundary conditions on a
DTD_BConds(const CrystalLattice< T, 2 > &lat)
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
void apply_bc(std::vector< TinyVector< T, 2 >> &dr, std::vector< T > &r) const
T apply_bc(TinyVector< T, 2 > &displ) const
evaluate |a| and apply boundary conditions on a
void apply_bc(std::vector< TinyVector< T, 2 >> &dr, std::vector< T > &r, std::vector< T > &rinv) const
DTD_BConds(const CrystalLattice< T, 2 > &lat)
void apply_bc(std::vector< TinyVector< T, 2 >> &dr, std::vector< T > &r) const
void sqrt(T *restrict inout, SIZET n)
DTD_BConds(const CrystalLattice< T, 2 > &lat)
void apply_bc(std::vector< TinyVector< T, 2 >> &dr, std::vector< T > &r, std::vector< T > &rinv) const