QMCPACK
DTD_BConds< T, 3, PPPS+SOA_OFFSET > Struct Template Reference

specialization for a periodic 3D general cell with wigner-seitz==simulation cell More...

+ Collaboration diagram for DTD_BConds< T, 3, PPPS+SOA_OFFSET >:

Public Member Functions

 DTD_BConds (const CrystalLattice< T, 3 > &lat)
 
template<typename PT , typename RSOA , typename DISPLSOA >
void computeDistances (const PT &pos, const RSOA &R0, T *restrict temp_r, DISPLSOA &temp_dr, int first, int last, int flip_ind=0) const
 
void computeDistancesOffload (const T pos[3], const T *restrict R0, int r0_stride, T *restrict temp_r, T *restrict temp_dr, int padded_size, int iat, int flip_ind=0) const
 
computeDist (T dx, T dy, T dz) const
 

Public Attributes

r00
 
r10
 
r20
 
r01
 
r11
 
r21
 
r02
 
r12
 
r22
 
g00
 
g10
 
g20
 
g01
 
g11
 
g21
 
g02
 
g12
 
g22
 

Detailed Description

template<class T>
struct qmcplusplus::DTD_BConds< T, 3, PPPS+SOA_OFFSET >

specialization for a periodic 3D general cell with wigner-seitz==simulation cell

Skip image cells.

Definition at line 188 of file ParticleBConds3DSoa.h.

Constructor & Destructor Documentation

◆ DTD_BConds()

DTD_BConds ( const CrystalLattice< T, 3 > &  lat)
inline

Definition at line 192 of file ParticleBConds3DSoa.h.

193  : r00(lat.R(0)),
194  r10(lat.R(3)),
195  r20(lat.R(6)),
196  r01(lat.R(1)),
197  r11(lat.R(4)),
198  r21(lat.R(7)),
199  r02(lat.R(2)),
200  r12(lat.R(5)),
201  r22(lat.R(8)),
202  g00(lat.G(0)),
203  g10(lat.G(3)),
204  g20(lat.G(6)),
205  g01(lat.G(1)),
206  g11(lat.G(4)),
207  g21(lat.G(7)),
208  g02(lat.G(2)),
209  g12(lat.G(5)),
210  g22(lat.G(8))
211  {}

Member Function Documentation

◆ computeDist()

T computeDist ( dx,
dy,
dz 
) const
inline

Definition at line 301 of file ParticleBConds3DSoa.h.

References qmcplusplus::sqrt().

302  {
303  T ar_0 = dx * g00 + dy * g10 + dz * g20;
304  T ar_1 = dx * g01 + dy * g11 + dz * g21;
305  T ar_2 = dx * g02 + dy * g12 + dz * g22;
306 
307  //put them in the box
308  ar_0 -= round(ar_0);
309  ar_1 -= round(ar_1);
310  ar_2 -= round(ar_2);
311 
312  //unit2cart
313  dx = ar_0 * r00 + ar_1 * r10 + ar_2 * r20;
314  dy = ar_0 * r01 + ar_1 * r11 + ar_2 * r21;
315  dz = ar_0 * r02 + ar_1 * r12 + ar_2 * r22;
316 
317  return std::sqrt(dx * dx + dy * dy + dz * dz);
318  }
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)

◆ computeDistances()

void computeDistances ( const PT &  pos,
const RSOA &  R0,
T *restrict  temp_r,
DISPLSOA &  temp_dr,
int  first,
int  last,
int  flip_ind = 0 
) const
inline

Definition at line 214 of file ParticleBConds3DSoa.h.

References qmcplusplus::sqrt().

221  {
222  const T x0 = pos[0];
223  const T y0 = pos[1];
224  const T z0 = pos[2];
225 
226  const T* restrict px = R0.data(0);
227  const T* restrict py = R0.data(1);
228  const T* restrict pz = R0.data(2);
229 
230  T* restrict dx = temp_dr.data(0);
231  T* restrict dy = temp_dr.data(1);
232  T* restrict dz = temp_dr.data(2);
233 
234 #pragma omp simd aligned(temp_r, px, py, pz, dx, dy, dz: QMC_SIMD_ALIGNMENT)
235  for (int iat = first; iat < last; ++iat)
236  {
237  T displ_0 = px[iat] - x0;
238  T displ_1 = py[iat] - y0;
239  T displ_2 = pz[iat] - z0;
240 
241  T ar_0 = displ_0 * g00 + displ_1 * g10 + displ_2 * g20;
242  T ar_1 = displ_0 * g01 + displ_1 * g11 + displ_2 * g21;
243  T ar_2 = displ_0 * g02 + displ_1 * g12 + displ_2 * g22;
244 
245  //put them in the box
246  ar_0 -= round(ar_0);
247  ar_1 -= round(ar_1);
248  ar_2 -= round(ar_2);
249 
250  //unit2cart
251  dx[iat] = ar_0 * r00 + ar_1 * r10 + ar_2 * r20;
252  dy[iat] = ar_0 * r01 + ar_1 * r11 + ar_2 * r21;
253  dz[iat] = ar_0 * r02 + ar_1 * r12 + ar_2 * r22;
254 
255  temp_r[iat] = std::sqrt(dx[iat] * dx[iat] + dy[iat] * dy[iat] + dz[iat] * dz[iat]);
256  }
257  }
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)

◆ computeDistancesOffload()

void computeDistancesOffload ( const T  pos[3],
const T *restrict  R0,
int  r0_stride,
T *restrict  temp_r,
T *restrict  temp_dr,
int  padded_size,
int  iat,
int  flip_ind = 0 
) const
inline

Definition at line 259 of file ParticleBConds3DSoa.h.

References qmcplusplus::sqrt().

267  {
268  const T x0 = pos[0];
269  const T y0 = pos[1];
270  const T z0 = pos[2];
271 
272  const T* restrict px = R0;
273  const T* restrict py = R0 + r0_stride;
274  const T* restrict pz = R0 + r0_stride * 2;
275 
276  T* restrict dx = temp_dr;
277  T* restrict dy = temp_dr + padded_size;
278  T* restrict dz = temp_dr + padded_size * 2;
279 
280  T displ_0 = px[iat] - x0;
281  T displ_1 = py[iat] - y0;
282  T displ_2 = pz[iat] - z0;
283 
284  T ar_0 = displ_0 * g00 + displ_1 * g10 + displ_2 * g20;
285  T ar_1 = displ_0 * g01 + displ_1 * g11 + displ_2 * g21;
286  T ar_2 = displ_0 * g02 + displ_1 * g12 + displ_2 * g22;
287 
288  //put them in the box
289  ar_0 -= round(ar_0);
290  ar_1 -= round(ar_1);
291  ar_2 -= round(ar_2);
292 
293  //unit2cart
294  dx[iat] = ar_0 * r00 + ar_1 * r10 + ar_2 * r20;
295  dy[iat] = ar_0 * r01 + ar_1 * r11 + ar_2 * r21;
296  dz[iat] = ar_0 * r02 + ar_1 * r12 + ar_2 * r22;
297 
298  temp_r[iat] = std::sqrt(dx[iat] * dx[iat] + dy[iat] * dy[iat] + dz[iat] * dz[iat]);
299  }
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)

Member Data Documentation

◆ g00

T g00

Definition at line 191 of file ParticleBConds3DSoa.h.

◆ g01

T g01

Definition at line 191 of file ParticleBConds3DSoa.h.

◆ g02

T g02

Definition at line 191 of file ParticleBConds3DSoa.h.

◆ g10

T g10

Definition at line 191 of file ParticleBConds3DSoa.h.

◆ g11

T g11

Definition at line 191 of file ParticleBConds3DSoa.h.

◆ g12

T g12

Definition at line 191 of file ParticleBConds3DSoa.h.

◆ g20

T g20

Definition at line 191 of file ParticleBConds3DSoa.h.

◆ g21

T g21

Definition at line 191 of file ParticleBConds3DSoa.h.

◆ g22

T g22

Definition at line 191 of file ParticleBConds3DSoa.h.

◆ r00

T r00

Definition at line 190 of file ParticleBConds3DSoa.h.

◆ r01

T r01

Definition at line 190 of file ParticleBConds3DSoa.h.

◆ r02

T r02

Definition at line 190 of file ParticleBConds3DSoa.h.

◆ r10

T r10

Definition at line 190 of file ParticleBConds3DSoa.h.

◆ r11

T r11

Definition at line 190 of file ParticleBConds3DSoa.h.

◆ r12

T r12

Definition at line 190 of file ParticleBConds3DSoa.h.

◆ r20

T r20

Definition at line 190 of file ParticleBConds3DSoa.h.

◆ r21

T r21

Definition at line 190 of file ParticleBConds3DSoa.h.

◆ r22

T r22

Definition at line 190 of file ParticleBConds3DSoa.h.


The documentation for this struct was generated from the following file: