16 #ifndef QMCPLUSPLUS_DISTANCETABLEDATAIMPL_H 17 #define QMCPLUSPLUS_DISTANCETABLEDATAIMPL_H 29 class ResourceCollection;
106 for (
int iw = 0; iw < dt_list.size(); iw++)
117 const std::vector<bool>& recompute)
const 119 for (
int iw = 0; iw < dt_list.size(); iw++)
121 dt_list[iw].evaluate(p_list[iw]);
142 const std::vector<PosType>& rnew_list,
144 bool prepare_old =
true)
const 146 for (
int iw = 0; iw < dt_list.size(); iw++)
147 dt_list[iw].
move(p_list[iw], rnew_list[iw], iat, prepare_old);
172 const std::vector<bool>& from_temp)
174 for (
int iw = 0; iw < dt_list.size(); iw++)
191 for (
int iw = 0; iw < dt_list.size(); iw++)
205 [[noreturn]]
inline void print(std::ostream& os)
207 throw std::runtime_error(
"DistanceTable::print is not supported");
295 throw std::runtime_error(
name_ +
" multi walker data pointer for temp not supported");
301 size_t range_end)
const 360 throw std::runtime_error(
name_ +
" multi walker data pointer not supported");
366 throw std::runtime_error(
name_ +
" getPerTargetPctlStrideSize not supported");
QMCTraits::RealType RealType
const size_t num_targets_
virtual void finalizePbyP(const ParticleSet &P)
finalize distance table calculation after particle-by-particle moves if update() doesn't make the tab...
void print(std::ostream &os)
const std::vector< DistRow > & getDistances() const
return full table distances
virtual void update(IndexType jat)=0
update the distance table by the pair relations from the temporal position.
helper functions for EinsplineSetBuilder
const DisplRow & getDisplRow(int iel) const
return a row of displacements for a given target particle
virtual size_t getPerTargetPctlStrideSize() const
return stride of per target pctl data. full table data = stride * num of target particles ...
QTBase::RealType RealType
const DistRow & getDistRow(int iel) const
return a row of distances for a given target particle
virtual ~DistanceTable()=default
virutal destructor
size_t getTotalNum() const
const ParticleSet & get_origin() const
returns the reference the origin particleset
const std::vector< DisplRow > & getDisplacements() const
return full table displacements
Abstract class to manage operations on pair data between two ParticleSets.
Soa Container for D-dim vectors.
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 da...
void setModes(DTModes modes)
set modes
SoA adaptor class for Vector<TinyVector<T,D> >
const DisplRow & getTempDispls() const
return the temporary displacements when a move is proposed
static constexpr unsigned DIM
std::vector< DisplRow > displacements_
displacements_[num_targets_][3][num_sources_], [i][3][j] = r_A2[j] - r_A1[i] Note: Derived classes de...
const DistRow & getTempDists() const
return the temporary distances when a move is proposed
const std::string name_
name of the table
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
QMCTraits::IndexType IndexType
DisplRow old_dr_
old displacements
DistRow old_r_
old distances
virtual size_t get_num_particls_stored() const
Specialized paritlce class for atomistic simulations.
const DisplRow & getTempDispls() const
return the temporary displacements when a move is proposed
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.
virtual void updatePartial(IndexType jat, bool from_temp)
fill partially the distance table by the pair relations from the temporary or old particle position...
const DistRow & getTempDists() const
return the temporary distances when a move is proposed
AB type of DistanceTable containing storage.
virtual void evaluate(ParticleSet &P)=0
evaluate the full Distance Table
size_t targets() const
returns the number of centers
DistanceTableAA(const ParticleSet &target, DTModes modes)
constructor using source and target ParticleSet
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
virtual const RealType * getMultiWalkerDataPtr() const
return multi-walker full (all pairs) distance table data pointer
const std::string & getName() const
return the name of table
const DistRow & getDistRow(int iel) const
return a row of distances for a given target particle
OHMMS_INDEXTYPE IndexType
define other types
AA type of DistanceTable containing storage.
const DisplRow & getDisplRow(int iel) const
return a row of displacements for a given target particle
virtual void mw_updatePartial(const RefVectorWithLeader< DistanceTable > &dt_list, IndexType jat, const std::vector< bool > &from_temp)
walker batched version of updatePartial.
virtual void acquireResource(ResourceCollection &collection, const RefVectorWithLeader< DistanceTable > &dt_list) const
acquire a shared resource from a collection
size_t sources() const
returns the number of source particles
virtual const RealType * getMultiWalkerTempDataPtr() const
return multi walker temporary pair distance table data pointer
Declaraton of Vector<T,Alloc> Manage memory through Alloc directly and allow referencing an existing ...
QMCTraits::IndexType IndexType
DTModes getModes() const
get modes
const std::vector< DistRow > & getDistances() const
return full table distances
const std::vector< DisplRow > & getDisplacements() const
return full table displacements
virtual void createResource(ResourceCollection &collection) const
initialize a shared resource and hand it to a collection
virtual void mw_evaluate(const RefVectorWithLeader< DistanceTable > &dt_list, const RefVectorWithLeader< ParticleSet > &p_list) const
size_t centers() const
returns the number of centers
const DistRow & getOldDists() const
return old distances set up by move() for optimized distance table consumers
std::vector< DisplRow > displacements_
displacements_[num_targets_][3][num_sources_], [i][3][j] = r_A2[j] - r_A1[i] Note: Derived classes de...
virtual const RealType * mw_evalDistsInRange(const RefVectorWithLeader< DistanceTable > &dt_list, const RefVectorWithLeader< ParticleSet > &p_list, size_t range_begin, size_t range_end) const
DistanceTableAB(const ParticleSet &source, const ParticleSet &target, DTModes modes)
constructor using source and target ParticleSet
const ParticleSet & origin_
virtual int get_first_neighbor(IndexType iat, RealType &r, PosType &dr, bool newpos) const =0
find the first nearest neighbor
std::vector< DistRow > distances_
distances_[num_targets_][num_sources_], [i][3][j] = |r_A2[j] - r_A1[i]| Note: Derived classes decide ...
virtual void releaseResource(ResourceCollection &collection, const RefVectorWithLeader< DistanceTable > &dt_list) const
return a shared resource to a collection
std::vector< DistRow > distances_
distances_[num_targets_][num_sources_], [i][3][j] = |r_A2[j] - r_A1[i]| Note: Derived classes decide ...
DTModes modes_
operation modes defined by DTModes
DistanceTable(const ParticleSet &source, const ParticleSet &target, DTModes modes)
constructor using source and target ParticleSet
const DisplRow & getOldDispls() const
return old displacements set up by move() for optimized distance table consumers
const size_t num_sources_