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

specialization for a periodic 3D, orthorombic cell More...

+ Collaboration diagram for DTD_BConds< T, 3, PPPO+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

Linv0
 
L0
 
Linv1
 
L1
 
Linv2
 
L2
 
r2max
 
dummy
 

Detailed Description

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

specialization for a periodic 3D, orthorombic cell

Definition at line 95 of file ParticleBConds3DSoa.h.

Constructor & Destructor Documentation

◆ DTD_BConds()

Member Function Documentation

◆ computeDist()

T computeDist ( dx,
dy,
dz 
) const
inline

Definition at line 171 of file ParticleBConds3DSoa.h.

References qmcplusplus::sqrt().

172  {
173  T x = dx * Linv0;
174  T y = dy * Linv1;
175  T z = dz * Linv2;
176  dx = L0 * (x - round(x));
177  dy = L1 * (y - round(y));
178  dz = L2 * (z - round(z));
179  return std::sqrt(dx * dx + dy * dy + dz * dz);
180  }
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 111 of file ParticleBConds3DSoa.h.

References qmcplusplus::sqrt().

118  {
119  const T x0 = pos[0];
120  const T y0 = pos[1];
121  const T z0 = pos[2];
122  const T* restrict px = R0.data(0);
123  const T* restrict py = R0.data(1);
124  const T* restrict pz = R0.data(2);
125  T* restrict dx = temp_dr.data(0);
126  T* restrict dy = temp_dr.data(1);
127  T* restrict dz = temp_dr.data(2);
128 #pragma omp simd aligned(temp_r, px, py, pz, dx, dy, dz: QMC_SIMD_ALIGNMENT)
129  for (int iat = first; iat < last; ++iat)
130  {
131  const T x = (px[iat] - x0) * Linv0;
132  const T y = (py[iat] - y0) * Linv1;
133  const T z = (pz[iat] - z0) * Linv2;
134  dx[iat] = L0 * (x - round(x));
135  dy[iat] = L1 * (y - round(y));
136  dz[iat] = L2 * (z - round(z));
137  temp_r[iat] = std::sqrt(dx[iat] * dx[iat] + dy[iat] * dy[iat] + dz[iat] * dz[iat]);
138  }
139  }
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 141 of file ParticleBConds3DSoa.h.

References qmcplusplus::sqrt().

149  {
150  const T x0 = pos[0];
151  const T y0 = pos[1];
152  const T z0 = pos[2];
153 
154  const T* restrict px = R0;
155  const T* restrict py = R0 + r0_stride;
156  const T* restrict pz = R0 + r0_stride * 2;
157 
158  T* restrict dx = temp_dr;
159  T* restrict dy = temp_dr + padded_size;
160  T* restrict dz = temp_dr + padded_size * 2;
161 
162  const T x = (px[iat] - x0) * Linv0;
163  const T y = (py[iat] - y0) * Linv1;
164  const T z = (pz[iat] - z0) * Linv2;
165  dx[iat] = L0 * (x - round(x));
166  dy[iat] = L1 * (y - round(y));
167  dz[iat] = L2 * (z - round(z));
168  temp_r[iat] = std::sqrt(dx[iat] * dx[iat] + dy[iat] * dy[iat] + dz[iat] * dz[iat]);
169  }
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)

Member Data Documentation

◆ dummy

T dummy

Definition at line 97 of file ParticleBConds3DSoa.h.

◆ L0

T L0

Definition at line 97 of file ParticleBConds3DSoa.h.

◆ L1

T L1

Definition at line 97 of file ParticleBConds3DSoa.h.

◆ L2

T L2

Definition at line 97 of file ParticleBConds3DSoa.h.

◆ Linv0

T Linv0

Definition at line 97 of file ParticleBConds3DSoa.h.

◆ Linv1

T Linv1

Definition at line 97 of file ParticleBConds3DSoa.h.

◆ Linv2

T Linv2

Definition at line 97 of file ParticleBConds3DSoa.h.

◆ r2max

T r2max

Definition at line 97 of file ParticleBConds3DSoa.h.


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