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

specialization for a slab, general cell More...

+ Collaboration diagram for DTD_BConds< T, 3, PPNS+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
 
r01
 
r11
 
g00
 
g10
 
g01
 
g11
 

Detailed Description

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

specialization for a slab, general cell

Definition at line 799 of file ParticleBConds3DSoa.h.

Constructor & Destructor Documentation

◆ DTD_BConds()

Member Function Documentation

◆ computeDist()

T computeDist ( dx,
dy,
dz 
) const
inline

Definition at line 896 of file ParticleBConds3DSoa.h.

References qmcplusplus::sqrt().

897  {
898  T ar_0 = dx * g00 + dy * g10;
899  T ar_1 = dx * g01 + dy * g11;
900 
901  //put them in the box
902  ar_0 -= round(ar_0);
903  ar_1 -= round(ar_1);
904 
905  //unit2cart
906  dx = ar_0 * r00 + ar_1 * r10;
907  dy = ar_0 * r01 + ar_1 * r11;
908 
909  return std::sqrt(dx * dx + dy * dy + dz * dz);
910  }
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 815 of file ParticleBConds3DSoa.h.

References qmcplusplus::sqrt().

822  {
823  const T x0 = pos[0];
824  const T y0 = pos[1];
825  const T z0 = pos[2];
826 
827  const T* restrict px = R0.data(0);
828  const T* restrict py = R0.data(1);
829  const T* restrict pz = R0.data(2);
830 
831  T* restrict dx = temp_dr.data(0);
832  T* restrict dy = temp_dr.data(1);
833  T* restrict dz = temp_dr.data(2);
834 
835 #pragma omp simd aligned(temp_r, px, py, pz, dx, dy, dz: QMC_SIMD_ALIGNMENT)
836  for (int iat = first; iat < last; ++iat)
837  {
838  T displ_0 = px[iat] - x0;
839  T displ_1 = py[iat] - y0;
840 
841  T ar_0 = displ_0 * g00 + displ_1 * g10;
842  T ar_1 = displ_0 * g01 + displ_1 * g11;
843 
844  //put them in the box
845  ar_0 -= round(ar_0);
846  ar_1 -= round(ar_1);
847 
848  //unit2cart
849  dx[iat] = ar_0 * r00 + ar_1 * r10;
850  dy[iat] = ar_0 * r01 + ar_1 * r11;
851  dz[iat] = pz[iat] - z0;
852 
853  temp_r[iat] = std::sqrt(dx[iat] * dx[iat] + dy[iat] * dy[iat] + dz[iat] * dz[iat]);
854  }
855  }
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 857 of file ParticleBConds3DSoa.h.

References qmcplusplus::sqrt().

865  {
866  const T x0 = pos[0];
867  const T y0 = pos[1];
868  const T z0 = pos[2];
869 
870  const T* restrict px = R0;
871  const T* restrict py = R0 + r0_stride;
872  const T* restrict pz = R0 + r0_stride * 2;
873 
874  T* restrict dx = temp_dr;
875  T* restrict dy = temp_dr + padded_size;
876  T* restrict dz = temp_dr + padded_size * 2;
877 
878  T displ_0 = px[iat] - x0;
879  T displ_1 = py[iat] - y0;
880 
881  T ar_0 = displ_0 * g00 + displ_1 * g10;
882  T ar_1 = displ_0 * g01 + displ_1 * g11;
883 
884  //put them in the box
885  ar_0 -= round(ar_0);
886  ar_1 -= round(ar_1);
887 
888  //unit2cart
889  dx[iat] = ar_0 * r00 + ar_1 * r10;
890  dy[iat] = ar_0 * r01 + ar_1 * r11;
891  dz[iat] = pz[iat] - z0;
892 
893  temp_r[iat] = std::sqrt(dx[iat] * dx[iat] + dy[iat] * dy[iat] + dz[iat] * dz[iat]);
894  }
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 802 of file ParticleBConds3DSoa.h.

◆ g01

T g01

Definition at line 802 of file ParticleBConds3DSoa.h.

◆ g10

T g10

Definition at line 802 of file ParticleBConds3DSoa.h.

◆ g11

T g11

Definition at line 802 of file ParticleBConds3DSoa.h.

◆ r00

T r00

Definition at line 801 of file ParticleBConds3DSoa.h.

◆ r01

T r01

Definition at line 801 of file ParticleBConds3DSoa.h.

◆ r10

T r10

Definition at line 801 of file ParticleBConds3DSoa.h.

◆ r11

T r11

Definition at line 801 of file ParticleBConds3DSoa.h.


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