QMCPACK
DistanceTableAA Class Reference

AA type of DistanceTable containing storage. More...

+ Inheritance diagram for DistanceTableAA:
+ Collaboration diagram for DistanceTableAA:

Public Member Functions

 DistanceTableAA (const ParticleSet &target, DTModes modes)
 constructor using source and target ParticleSet More...
 
const std::vector< DistRow > & getDistances () const
 return full table distances More...
 
const std::vector< DisplRow > & getDisplacements () const
 return full table displacements More...
 
const DistRow & getDistRow (int iel) const
 return a row of distances for a given target particle More...
 
const DisplRow & getDisplRow (int iel) const
 return a row of displacements for a given target particle More...
 
const DistRow & getTempDists () const
 return the temporary distances when a move is proposed More...
 
const DisplRow & getTempDispls () const
 return the temporary displacements when a move is proposed More...
 
const DistRow & getOldDists () const
 return old distances set up by move() for optimized distance table consumers More...
 
const DisplRow & getOldDispls () const
 return old displacements set up by move() for optimized distance table consumers More...
 
virtual size_t get_num_particls_stored () const
 
virtual const RealType * getMultiWalkerTempDataPtr () const
 return multi walker temporary pair distance table data pointer More...
 
virtual const RealType * mw_evalDistsInRange (const RefVectorWithLeader< DistanceTable > &dt_list, const RefVectorWithLeader< ParticleSet > &p_list, size_t range_begin, size_t range_end) const
 
- Public Member Functions inherited from DistanceTable
 DistanceTable (const ParticleSet &source, const ParticleSet &target, DTModes modes)
 constructor using source and target ParticleSet More...
 
 DistanceTable (const DistanceTable &)=delete
 copy constructor. deleted More...
 
virtual ~DistanceTable ()=default
 virutal destructor More...
 
DTModes getModes () const
 get modes More...
 
void setModes (DTModes modes)
 set modes More...
 
const std::string & getName () const
 return the name of table More...
 
const ParticleSet & get_origin () const
 returns the reference the origin particleset More...
 
size_t centers () const
 returns the number of centers More...
 
size_t targets () const
 returns the number of centers More...
 
size_t sources () const
 returns the number of source particles More...
 
virtual void evaluate (ParticleSet &P)=0
 evaluate the full Distance Table More...
 
virtual void mw_evaluate (const RefVectorWithLeader< DistanceTable > &dt_list, const RefVectorWithLeader< ParticleSet > &p_list) const
 
virtual void mw_recompute (const RefVectorWithLeader< DistanceTable > &dt_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::vector< bool > &recompute) const
 recompute multi walker internal data, recompute More...
 
virtual void move (const ParticleSet &P, const PosType &rnew, const IndexType iat, bool prepare_old=true)=0
 evaluate the temporary pair relations when a move is proposed More...
 
virtual void mw_move (const RefVectorWithLeader< DistanceTable > &dt_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::vector< PosType > &rnew_list, const IndexType iat, bool prepare_old=true) const
 walker batched version of move. More...
 
virtual void update (IndexType jat)=0
 update the distance table by the pair relations from the temporal position. More...
 
virtual void updatePartial (IndexType jat, bool from_temp)
 fill partially the distance table by the pair relations from the temporary or old particle position. More...
 
virtual void mw_updatePartial (const RefVectorWithLeader< DistanceTable > &dt_list, IndexType jat, const std::vector< bool > &from_temp)
 walker batched version of updatePartial. More...
 
virtual void finalizePbyP (const ParticleSet &P)
 finalize distance table calculation after particle-by-particle moves if update() doesn't make the table up-to-date during p-by-p moves finalizePbyP takes action to bring the table up-to-date More...
 
virtual void mw_finalizePbyP (const RefVectorWithLeader< DistanceTable > &dt_list, const RefVectorWithLeader< ParticleSet > &p_list) const
 walker batched version of finalizePbyP If not DTModes::NEED_TEMP_DATA_ON_HOST, host distance table data is not updated at all during p-by-p Thus, a recompute is necessary to update the whole host distance table for consumers like the Coulomb potential. More...
 
virtual int get_first_neighbor (IndexType iat, RealType &r, PosType &dr, bool newpos) const =0
 find the first nearest neighbor More...
 
void print (std::ostream &os)
 
virtual void createResource (ResourceCollection &collection) const
 initialize a shared resource and hand it to a collection More...
 
virtual void acquireResource (ResourceCollection &collection, const RefVectorWithLeader< DistanceTable > &dt_list) const
 acquire a shared resource from a collection More...
 
virtual void releaseResource (ResourceCollection &collection, const RefVectorWithLeader< DistanceTable > &dt_list) const
 return a shared resource to a collection More...
 

Protected Attributes

std::vector< DistRow > distances_
 distances_[num_targets_][num_sources_], [i][3][j] = |r_A2[j] - r_A1[i]| Note: Derived classes decide if it is a memory view or the actual storage For only the lower triangle (j<i) data can be accessed safely. More...
 
std::vector< DisplRow > displacements_
 displacements_[num_targets_][3][num_sources_], [i][3][j] = r_A2[j] - r_A1[i] Note: Derived classes decide if it is a memory view or the actual storage only the lower triangle (j<i) is defined. More...
 
DistRow temp_r_
 temp_r More...
 
DisplRow temp_dr_
 temp_dr More...
 
DistRow old_r_
 old distances More...
 
DisplRow old_dr_
 old displacements More...
 
- Protected Attributes inherited from DistanceTable
const ParticleSet & origin_
 
const size_t num_sources_
 
const size_t num_targets_
 
const std::string name_
 name of the table More...
 
DTModes modes_
 operation modes defined by DTModes More...
 

Additional Inherited Members

- Public Types inherited from DistanceTable
using IndexType = QMCTraits::IndexType
 
using RealType = QMCTraits::RealType
 
using PosType = QMCTraits::PosType
 
using DistRow = Vector< RealType, aligned_allocator< RealType > >
 
using DisplRow = VectorSoaContainer< RealType, DIM >
 
- Static Public Attributes inherited from DistanceTable
static constexpr unsigned DIM = OHMMS_DIM
 

Detailed Description

AA type of DistanceTable containing storage.

Definition at line 223 of file DistanceTable.h.

Constructor & Destructor Documentation

◆ DistanceTableAA()

DistanceTableAA ( const ParticleSet &  target,
DTModes  modes 
)
inline

constructor using source and target ParticleSet

Definition at line 256 of file DistanceTable.h.

256 : DistanceTable(target, target, modes) {}
DistanceTable(const ParticleSet &source, const ParticleSet &target, DTModes modes)
constructor using source and target ParticleSet
Definition: DistanceTable.h:64

Member Function Documentation

◆ get_num_particls_stored()

virtual size_t get_num_particls_stored ( ) const
inlinevirtual

Reimplemented in SoaDistanceTableAAOMPTarget< T, D, SC >.

Definition at line 290 of file DistanceTable.h.

290 { return 0; }

◆ getDisplacements()

const std::vector<DisplRow>& getDisplacements ( ) const
inline

return full table displacements

Definition at line 264 of file DistanceTable.h.

References DistanceTableAA::displacements_.

264 { return displacements_; }
std::vector< DisplRow > displacements_
displacements_[num_targets_][3][num_sources_], [i][3][j] = r_A2[j] - r_A1[i] Note: Derived classes de...

◆ getDisplRow()

const DisplRow& getDisplRow ( int  iel) const
inline

return a row of displacements for a given target particle

Definition at line 272 of file DistanceTable.h.

References DistanceTableAA::displacements_.

Referenced by CoulombPotential< T >::evaluateAAForces().

272 { return displacements_[iel]; }
std::vector< DisplRow > displacements_
displacements_[num_targets_][3][num_sources_], [i][3][j] = r_A2[j] - r_A1[i] Note: Derived classes de...

◆ getDistances()

const std::vector<DistRow>& getDistances ( ) const
inline

◆ getDistRow()

const DistRow& getDistRow ( int  iel) const
inline

return a row of distances for a given target particle

Definition at line 268 of file DistanceTable.h.

References DistanceTableAA::distances_.

Referenced by Backflow_ee< FT >::evaluate(), CoulombPotential< T >::evaluate_spAA(), CoulombPotential< T >::evaluateAA(), CoulombPotential< T >::evaluateAAForces(), TwoBodyJastrow< FT >::evaluateDerivRatios(), and Backflow_ee< FT >::evaluateWithDerivatives().

268 { return distances_[iel]; }
std::vector< DistRow > distances_
distances_[num_targets_][num_sources_], [i][3][j] = |r_A2[j] - r_A1[i]| Note: Derived classes decide ...

◆ getMultiWalkerTempDataPtr()

virtual const RealType* getMultiWalkerTempDataPtr ( ) const
inlinevirtual

return multi walker temporary pair distance table data pointer

Reimplemented in SoaDistanceTableAAOMPTarget< T, D, SC >.

Definition at line 293 of file DistanceTable.h.

References DistanceTable::name_.

294  {
295  throw std::runtime_error(name_ + " multi walker data pointer for temp not supported");
296  }
const std::string name_
name of the table
Definition: DistanceTable.h:57

◆ getOldDispls()

const DisplRow& getOldDispls ( ) const
inline

return old displacements set up by move() for optimized distance table consumers

Definition at line 288 of file DistanceTable.h.

References DistanceTableAA::old_dr_.

288 { return old_dr_; }
DisplRow old_dr_
old displacements

◆ getOldDists()

const DistRow& getOldDists ( ) const
inline

return old distances set up by move() for optimized distance table consumers

Definition at line 284 of file DistanceTable.h.

References DistanceTableAA::old_r_.

284 { return old_r_; }
DistRow old_r_
old distances

◆ getTempDispls()

const DisplRow& getTempDispls ( ) const
inline

return the temporary displacements when a move is proposed

Definition at line 280 of file DistanceTable.h.

References DistanceTableAA::temp_dr_.

Referenced by TwoBodyJastrow< FT >::ratioGrad().

280 { return temp_dr_; }

◆ getTempDists()

const DistRow& getTempDists ( ) const
inline

return the temporary distances when a move is proposed

Definition at line 276 of file DistanceTable.h.

References DistanceTableAA::temp_r_.

Referenced by TwoBodyJastrow< FT >::acceptMove(), TwoBodyJastrow< FT >::evaluateRatiosAlltoOne(), TwoBodyJastrow< FT >::ratio(), and TwoBodyJastrow< FT >::ratioGrad().

276 { return temp_r_; }

◆ mw_evalDistsInRange()

virtual const RealType* mw_evalDistsInRange ( const RefVectorWithLeader< DistanceTable > &  dt_list,
const RefVectorWithLeader< ParticleSet > &  p_list,
size_t  range_begin,
size_t  range_end 
) const
inlinevirtual

Reimplemented in SoaDistanceTableAAOMPTarget< T, D, SC >.

Definition at line 298 of file DistanceTable.h.

302  {
303  return nullptr;
304  }

Member Data Documentation

◆ displacements_

◆ distances_

std::vector<DistRow> distances_
protected

distances_[num_targets_][num_sources_], [i][3][j] = |r_A2[j] - r_A1[i]| Note: Derived classes decide if it is a memory view or the actual storage For only the lower triangle (j<i) data can be accessed safely.

There is no bound check to protect j>=i terms as the nature of operator[]. When the storage of the table is allocated as a single memory segment, out-of-bound access is still within the segment and thus doesn't trigger an alarm by the address sanitizer.

Definition at line 234 of file DistanceTable.h.

Referenced by SoaDistanceTableAA< T, D, SC >::evaluate(), SoaDistanceTableAAOMPTarget< T, D, SC >::evaluate(), SoaDistanceTableAA< T, D, SC >::get_first_neighbor(), SoaDistanceTableAAOMPTarget< T, D, SC >::get_first_neighbor(), DistanceTableAA::getDistances(), DistanceTableAA::getDistRow(), SoaDistanceTableAA< T, D, SC >::resize(), SoaDistanceTableAAOMPTarget< T, D, SC >::resize(), SoaDistanceTableAA< T, D, SC >::update(), SoaDistanceTableAAOMPTarget< T, D, SC >::update(), SoaDistanceTableAA< T, D, SC >::updatePartial(), and SoaDistanceTableAAOMPTarget< T, D, SC >::updatePartial().

◆ old_dr_

◆ old_r_

◆ temp_dr_

◆ temp_r_


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