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

specialization for a slab, orthorombic cell More...

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

Detailed Description

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

specialization for a slab, orthorombic cell

Definition at line 718 of file ParticleBConds3DSoa.h.

Constructor & Destructor Documentation

◆ DTD_BConds()

Member Function Documentation

◆ computeDist()

T computeDist ( dx,
dy,
dz 
) const
inline

Definition at line 786 of file ParticleBConds3DSoa.h.

References qmcplusplus::sqrt().

787  {
788  T x = dx * Linv0;
789  T y = dy * Linv1;
790  dx = L0 * (x - round(x));
791  dy = L1 * (y - round(y));
792  return std::sqrt(dx * dx + dy * dy + dz * dz);
793  }
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 727 of file ParticleBConds3DSoa.h.

References qmcplusplus::sqrt().

734  {
735  const T x0 = pos[0];
736  const T y0 = pos[1];
737  const T z0 = pos[2];
738  const T* restrict px = R0.data(0);
739  const T* restrict py = R0.data(1);
740  const T* restrict pz = R0.data(2);
741  T* restrict dx = temp_dr.data(0);
742  T* restrict dy = temp_dr.data(1);
743  T* restrict dz = temp_dr.data(2);
744 
745 #pragma omp simd aligned(temp_r, px, py, pz, dx, dy, dz: QMC_SIMD_ALIGNMENT)
746  for (int iat = first; iat < last; ++iat)
747  {
748  T x = (px[iat] - x0) * Linv0;
749  dx[iat] = L0 * (x - round(x));
750  T y = (py[iat] - y0) * Linv1;
751  dy[iat] = L1 * (y - round(y));
752  dz[iat] = pz[iat] - z0;
753  temp_r[iat] = std::sqrt(dx[iat] * dx[iat] + dy[iat] * dy[iat] + dz[iat] * dz[iat]);
754  }
755  }
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 757 of file ParticleBConds3DSoa.h.

References qmcplusplus::sqrt().

765  {
766  const T x0 = pos[0];
767  const T y0 = pos[1];
768  const T z0 = pos[2];
769 
770  const T* restrict px = R0;
771  const T* restrict py = R0 + r0_stride;
772  const T* restrict pz = R0 + r0_stride * 2;
773 
774  T* restrict dx = temp_dr;
775  T* restrict dy = temp_dr + padded_size;
776  T* restrict dz = temp_dr + padded_size * 2;
777 
778  T x = (px[iat] - x0) * Linv0;
779  dx[iat] = L0 * (x - round(x));
780  T y = (py[iat] - y0) * Linv1;
781  dy[iat] = L1 * (y - round(y));
782  dz[iat] = pz[iat] - z0;
783  temp_r[iat] = std::sqrt(dx[iat] * dx[iat] + dy[iat] * dy[iat] + dz[iat] * dz[iat]);
784  }
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 720 of file ParticleBConds3DSoa.h.

◆ L1

T L1

Definition at line 720 of file ParticleBConds3DSoa.h.

◆ Linv0

T Linv0

Definition at line 720 of file ParticleBConds3DSoa.h.

◆ Linv1

T Linv1

Definition at line 720 of file ParticleBConds3DSoa.h.


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