QMCPACK
DTD_BConds< T, 2, PPPS > Struct Template Reference

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

+ Collaboration diagram for DTD_BConds< T, 2, PPPS >:

Public Member Functions

 DTD_BConds (const CrystalLattice< T, 2 > &lat)
 
apply_bc (TinyVector< T, 2 > &displ) const
 apply BC to a displacement vector a and return the minimum-image distance More...
 
void apply_bc (std::vector< TinyVector< T, 2 >> &dr, std::vector< T > &r, std::vector< T > &rinv) const
 
void apply_bc (std::vector< TinyVector< T, 2 >> &dr, std::vector< T > &r) const
 

Public Attributes

r00
 
r10
 
r01
 
r11
 
g00
 
g10
 
g01
 
g11
 
r2max
 
std::vector< TinyVector< T, 2 > > nextcells
 

Detailed Description

template<class T>
struct qmcplusplus::DTD_BConds< T, 2, PPPS >

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

Skip image cells.

Definition at line 129 of file ParticleBConds2D.h.

Constructor & Destructor Documentation

◆ DTD_BConds()

Member Function Documentation

◆ apply_bc() [1/3]

T apply_bc ( TinyVector< T, 2 > &  displ) const
inline

apply BC to a displacement vector a and return the minimum-image distance

Parameters
latlattice
adisplacement vector
Returns
the minimum-image distance

Definition at line 153 of file ParticleBConds2D.h.

154  {
155  //cart2unit
156  TinyVector<T, 2> ar(displ[0] * g00 + displ[1] * g10, displ[0] * g01 + displ[1] * g11);
157  //put them in the box
158  ar[0] -= round(ar[0]);
159  ar[1] -= round(ar[1]);
160  //unit2cart
161  displ[0] = ar[0] * r00 + ar[1] * r10;
162  displ[1] = ar[0] * r01 + ar[1] * r11;
163  return displ[0] * displ[0] + displ[1] * displ[1];
164  }

◆ apply_bc() [2/3]

void apply_bc ( std::vector< TinyVector< T, 2 >> &  dr,
std::vector< T > &  r,
std::vector< T > &  rinv 
) const
inline

Definition at line 166 of file ParticleBConds2D.h.

References DTD_BConds< T, D, SC >::apply_bc(), qmcplusplus::simd::inv(), qmcplusplus::n, and qmcplusplus::simd::sqrt().

167  {
168  const int n = dr.size();
169  for (int i = 0; i < n; ++i)
170  rinv[i] = apply_bc(dr[i]);
171  simd::sqrt(&rinv[0], &r[0], n);
172  simd::inv(&r[0], &rinv[0], n);
173  }
T apply_bc(TinyVector< T, 2 > &displ) const
apply BC to a displacement vector a and return the minimum-image distance
void inv(const T *restrict in, T *restrict out, int n)
Definition: vmath.hpp:65
void sqrt(T *restrict inout, SIZET n)
Definition: vmath.hpp:52

◆ apply_bc() [3/3]

void apply_bc ( std::vector< TinyVector< T, 2 >> &  dr,
std::vector< T > &  r 
) const
inline

Definition at line 175 of file ParticleBConds2D.h.

References DTD_BConds< T, D, SC >::apply_bc().

176  {
177  for (int i = 0; i < dr.size(); ++i)
178  r[i] = apply_bc(dr[i]);
179  }
T apply_bc(TinyVector< T, 2 > &displ) const
apply BC to a displacement vector a and return the minimum-image distance

Member Data Documentation

◆ g00

T g00

Definition at line 132 of file ParticleBConds2D.h.

◆ g01

T g01

Definition at line 132 of file ParticleBConds2D.h.

◆ g10

T g10

Definition at line 132 of file ParticleBConds2D.h.

◆ g11

T g11

Definition at line 132 of file ParticleBConds2D.h.

◆ nextcells

std::vector<TinyVector<T, 2> > nextcells

Definition at line 134 of file ParticleBConds2D.h.

◆ r00

T r00

Definition at line 131 of file ParticleBConds2D.h.

◆ r01

T r01

Definition at line 131 of file ParticleBConds2D.h.

◆ r10

T r10

Definition at line 131 of file ParticleBConds2D.h.

◆ r11

T r11

Definition at line 131 of file ParticleBConds2D.h.

◆ r2max

T r2max

Definition at line 133 of file ParticleBConds2D.h.


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