QMCPACK
RealSpacePositions.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2020 QMCPACK developers.
6 //
7 // File developed by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 /** @file RealSpacePostions.h
14  */
15 #ifndef QMCPLUSPLUS_REALSPACE_POSITIONS_H
16 #define QMCPLUSPLUS_REALSPACE_POSITIONS_H
17 
20 
21 namespace qmcplusplus
22 {
23 /** Introduced to handle virtual moves and ratio computations, e.g. for non-local PP evaluations.
24  */
26 {
27 public:
31 
33 
34  std::unique_ptr<DynamicCoordinates> makeClone() override { return std::make_unique<RealSpacePositions>(*this); }
35 
36  void resize(size_t n) override { RSoA.resize(n); }
37  size_t size() const override { return RSoA.size(); }
38 
39  void setAllParticlePos(const ParticlePos& R) override
40  {
41  resize(R.size());
42  RSoA.copyIn(R);
43  }
44  void setOneParticlePos(const PosType& pos, size_t iat) override { RSoA(iat) = pos; }
45 
47  size_t iat,
48  const std::vector<PosType>& new_positions,
49  const std::vector<bool>& isAccepted) const override
50  {
51  assert(this == &coords_list.getLeader());
52  for (size_t iw = 0; iw < isAccepted.size(); iw++)
53  if (isAccepted[iw])
54  coords_list[iw].setOneParticlePos(new_positions[iw], iat);
55  }
56 
57  const PosVectorSoa& getAllParticlePos() const override { return RSoA; }
58  PosType getOneParticlePos(size_t iat) const override { return RSoA[iat]; }
59 
60 private:
61  ///particle positions in SoA layout
63 };
64 } // namespace qmcplusplus
65 #endif
DynamicCoordinateKind
enumerator for DynamicCoordinates kinds
PosVectorSoa RSoA
particle positions in SoA layout
void mw_acceptParticlePos(const RefVectorWithLeader< DynamicCoordinates > &coords_list, size_t iat, const std::vector< PosType > &new_positions, const std::vector< bool > &isAccepted) const override
overwrite the positions of particles with a uniform id in all the walkers upon acceptance.
Introduced to handle virtual moves and ratio computations, e.g.
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
QTBase::RealType RealType
Definition: Configuration.h:58
quantum variables of all the particles
Soa Container for D-dim vectors.
SoA adaptor class for Vector<TinyVector<T,D> >
Attaches a unit to a Vector for IO.
size_type size() const
return the current size
Definition: OhmmsVector.h:162
const PosVectorSoa & getAllParticlePos() const override
all particle position accessor
QTBase::PosType PosType
Definition: Configuration.h:61
void setOneParticlePos(const PosType &pos, size_t iat) override
overwrite the position of one the particle.
void copyIn(const Vector< TinyVector< T, D >> &in)
AoS to SoA : copy from Vector<TinyVector<>>
PosType getOneParticlePos(size_t iat) const override
one particle position accessor
void resize(size_t n) override
resize internal storages based on the number of particles
std::unique_ptr< DynamicCoordinates > makeClone() override
ParticleAttrib< SingleParticlePos > ParticlePos
Definition: Configuration.h:92
size_t size() const override
return the number of particles
void setAllParticlePos(const ParticlePos &R) override
overwrite the positions of all the particles.
void resize(size_type n)
resize myData
size_type size() const
return the physical size