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

specialization for a wire More...

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

Detailed Description

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

specialization for a wire

Definition at line 917 of file ParticleBConds3DSoa.h.

Constructor & Destructor Documentation

◆ DTD_BConds()

Member Function Documentation

◆ computeDist()

T computeDist ( dx,
dy,
dz 
) const
inline

Definition at line 982 of file ParticleBConds3DSoa.h.

References qmcplusplus::sqrt().

983  {
984  T x = dx * Linv0;
985  dx = L0 * (x - round(x));
986  return std::sqrt(dx * dx + dy * dy + dz * dz);
987  }
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 923 of file ParticleBConds3DSoa.h.

References qmcplusplus::sqrt().

930  {
931  const T x0 = pos[0];
932  const T y0 = pos[1];
933  const T z0 = pos[2];
934 
935  const T* restrict px = R0.data(0);
936  const T* restrict py = R0.data(1);
937  const T* restrict pz = R0.data(2);
938 
939  T* restrict dx = temp_dr.data(0);
940  T* restrict dy = temp_dr.data(1);
941  T* restrict dz = temp_dr.data(2);
942 
943 #pragma omp simd aligned(temp_r, px, py, pz, dx, dy, dz: QMC_SIMD_ALIGNMENT)
944  for (int iat = first; iat < last; ++iat)
945  {
946  T x = (px[iat] - x0) * Linv0;
947  dx[iat] = L0 * (x - round(x));
948  dy[iat] = py[iat] - y0;
949  dz[iat] = pz[iat] - z0;
950  temp_r[iat] = std::sqrt(dx[iat] * dx[iat] + dy[iat] * dy[iat] + dz[iat] * dz[iat]);
951  }
952  }
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 954 of file ParticleBConds3DSoa.h.

References qmcplusplus::sqrt().

962  {
963  const T x0 = pos[0];
964  const T y0 = pos[1];
965  const T z0 = pos[2];
966 
967  const T* restrict px = R0;
968  const T* restrict py = R0 + r0_stride;
969  const T* restrict pz = R0 + r0_stride * 2;
970 
971  T* restrict dx = temp_dr;
972  T* restrict dy = temp_dr + padded_size;
973  T* restrict dz = temp_dr + padded_size * 2;
974 
975  T x = (px[iat] - x0) * Linv0;
976  dx[iat] = L0 * (x - round(x));
977  dy[iat] = py[iat] - y0;
978  dz[iat] = pz[iat] - z0;
979  temp_r[iat] = std::sqrt(dx[iat] * dx[iat] + dy[iat] * dy[iat] + dz[iat] * dz[iat]);
980  }
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)

Member Data Documentation

◆ L0

T L0

Definition at line 919 of file ParticleBConds3DSoa.h.

◆ Linv0

T Linv0

Definition at line 919 of file ParticleBConds3DSoa.h.


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