Skip to content

Commit

Permalink
fix warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
PDoakORNL committed Dec 2, 2024
1 parent c2e8bd0 commit 05dabf0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
18 changes: 14 additions & 4 deletions src/Estimators/StructureFactorEstimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ StructureFactorEstimator::StructureFactorEstimator(StructureFactorInput& sfi,
elec_species_ = elns_.getSpeciesSet().getTotalNum();
ion_species_ = ions_.getSpeciesSet().getTotalNum();

num_kpoints_ = pset_ions.getSimulationCell().getKLists().numk;
kshell_offsets_ = pset_ions.getSimulationCell().getKLists().kshell;
int max_kshell = kshell_offsets_.size() - 1;
num_kpoints_ = pset_ions.getSimulationCell().getKLists().numk;
kshell_offsets_ = pset_ions.getSimulationCell().getKLists().kshell;
int max_kshell = kshell_offsets_.size() - 1;

rhok_tot_r_.resize(num_kpoints_);
rhok_tot_i_.resize(num_kpoints_);
Expand All @@ -49,6 +49,12 @@ StructureFactorEstimator::StructureFactorEstimator(StructureFactorInput& sfi,
};
}

StructureFactorEstimator::StructureFactorEstimator(const StructureFactorEstimator& sfe, DataLocality dl)
: qmcplusplus::StructureFactorEstimator(sfe)
{
data_locality_ = dl;
}

void StructureFactorEstimator::accumulate(const RefVector<MCPWalker>& walkers,
const RefVector<ParticleSet>& psets,
const RefVector<TrialWaveFunction>& wfns,
Expand Down Expand Up @@ -109,6 +115,10 @@ void StructureFactorEstimator::collect(const RefVector<OperatorEstBase>& type_er

void StructureFactorEstimator::startBlock(int steps) {}

UPtr<OperatorEstBase> StructureFactorEstimator::spawnCrowdClone() const {}
UPtr<OperatorEstBase> StructureFactorEstimator::spawnCrowdClone() const
{
UPtr<StructureFactorEstimator> spawn(std::make_unique<StructureFactorEstimator>(*this, data_locality_));
return spawn;
}

} // namespace qmcplusplus
7 changes: 6 additions & 1 deletion src/Estimators/StructureFactorEstimator.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class StructureFactorEstimator : public OperatorEstBase
ParticleSet& pset_elec,
DataLocality data_locality = DataLocality::crowd);

StructureFactorEstimator(const StructureFactorEstimator& sfe, DataLocality dl);

/** accumulate 1 or more walkers of EnergyDensity samples
*/
void accumulate(const RefVector<MCPWalker>& walkers,
Expand All @@ -51,16 +53,19 @@ class StructureFactorEstimator : public OperatorEstBase
UPtr<OperatorEstBase> spawnCrowdClone() const override;

void registerOperatorEstimator(hdf_archive& file) override;
void write(hdf_archive& file);
void write(hdf_archive& file) override;
void collect(const RefVector<OperatorEstBase>& type_erased_operator_estimators) override;

long long getNumKPoints() { return num_kpoints_; }

protected:
// Testing functions
const Vector<Real>& getSKElecElec() const { return sfk_e_e_; }
const Vector<std::complex<Real>>& getRhoKElec() const { return rhok_e_; }

private:
StructureFactorEstimator(const StructureFactorEstimator& obdm) = default;

int elec_species_;
ParticleSet& elns_;
int ion_species_;
Expand Down

0 comments on commit 05dabf0

Please sign in to comment.