QMCPACK
DistanceTableAB Class Reference

AB type of DistanceTable containing storage. More...

+ Inheritance diagram for DistanceTableAB:
+ Collaboration diagram for DistanceTableAB:

Public Member Functions

 DistanceTableAB (const ParticleSet &source, 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 DistRowgetDistRow (int iel) const
 return a row of distances for a given target particle More...
 
const DisplRowgetDisplRow (int iel) const
 return a row of displacements for a given target particle More...
 
const DistRowgetTempDists () const
 return the temporary distances when a move is proposed More...
 
const DisplRowgetTempDispls () const
 return the temporary displacements when a move is proposed More...
 
virtual const RealTypegetMultiWalkerDataPtr () const
 return multi-walker full (all pairs) distance table data pointer More...
 
virtual size_t getPerTargetPctlStrideSize () const
 return stride of per target pctl data. full table data = stride * num of target particles More...
 
- 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 ParticleSetget_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< DistRowdistances_
 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 More...
 
std::vector< DisplRowdisplacements_
 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 More...
 
DistRow temp_r_
 temp_r More...
 
DisplRow temp_dr_
 temp_dr More...
 
- Protected Attributes inherited from DistanceTable
const ParticleSetorigin_
 
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

AB type of DistanceTable containing storage.

Definition at line 308 of file DistanceTable.h.

Constructor & Destructor Documentation

◆ DistanceTableAB()

DistanceTableAB ( const ParticleSet source,
const ParticleSet target,
DTModes  modes 
)
inline

constructor using source and target ParticleSet

Definition at line 329 of file DistanceTable.h.

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

Member Function Documentation

◆ getDisplacements()

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

return full table displacements

Definition at line 339 of file DistanceTable.h.

References DistanceTableAB::displacements_.

Referenced by JeeIOrbitalSoA< FT >::build_compact_list(), HybridRepCenterOrbitals< SPLINEBASE::DataType >::evaluateValuesC2X(), and HybridRepCenterOrbitals< SPLINEBASE::DataType >::evaluateValuesR2R().

339 { 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 347 of file DistanceTable.h.

References DistanceTableAB::displacements_.

Referenced by J1Spin< FT >::evaluateDerivativesWF(), and J1OrbitalSoA< FT >::evaluateDerivativesWF().

347 { 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()

◆ getMultiWalkerDataPtr()

virtual const RealType* getMultiWalkerDataPtr ( ) const
inlinevirtual

return multi-walker full (all pairs) distance table data pointer

Reimplemented in SoaDistanceTableABOMPTarget< T, D, SC >.

Definition at line 358 of file DistanceTable.h.

References DistanceTable::name_.

359  {
360  throw std::runtime_error(name_ + " multi walker data pointer not supported");
361  }
const std::string name_
name of the table
Definition: DistanceTable.h:57

◆ getPerTargetPctlStrideSize()

virtual size_t getPerTargetPctlStrideSize ( ) const
inlinevirtual

return stride of per target pctl data. full table data = stride * num of target particles

Reimplemented in SoaDistanceTableABOMPTarget< T, D, SC >.

Definition at line 364 of file DistanceTable.h.

References DistanceTable::name_.

365  {
366  throw std::runtime_error(name_ + " getPerTargetPctlStrideSize not supported");
367  }
const std::string name_
name of the table
Definition: DistanceTable.h:57

◆ getTempDispls()

const DisplRow& getTempDispls ( ) const
inline

return the temporary displacements when a move is proposed

Definition at line 355 of file DistanceTable.h.

References DistanceTableAB::temp_dr_.

Referenced by J1OrbitalSoA< FT >::acceptMove(), J1Spin< FT >::acceptMove(), J1Spin< FT >::ratioGrad(), and J1OrbitalSoA< FT >::ratioGrad().

355 { return temp_dr_; }

◆ getTempDists()

Member Data Documentation

◆ displacements_

◆ distances_

◆ temp_dr_

◆ temp_r_


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