Skip to content

Commit

Permalink
change SOECPComponent variables to follow standards
Browse files Browse the repository at this point in the history
  • Loading branch information
camelto2 committed Mar 9, 2023
1 parent 4ba73a0 commit dab55ff
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions src/QMCHamiltonians/ECPComponentBuilder.2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void ECPComponentBuilder::buildSemiLocalAndLocal(std::vector<xmlNodePtr>& semiPt
// we may not know which one is local yet.

std::vector<int> angList;
std::vector<int> angListSO; //For spin-orbit, if it exists
std::vector<int> angListSO; //For spin-orbit, if it exists
std::vector<xmlNodePtr> vpsPtr;
std::vector<xmlNodePtr> vpsoPtr; //For spin-orbit, if it exists.
Lmax = -1;
Expand Down Expand Up @@ -364,8 +364,8 @@ void ECPComponentBuilder::buildSO(const std::vector<int>& angList,
app->spline();
pp_so->add(angList[l], app);
}
NumSO = angList.size();
pp_so->Rmax_ = rmax;
NumSO = angList.size();
pp_so->setRmax(rmax);
}

bool ECPComponentBuilder::parseCasino(const std::string& fname, xmlNodePtr cur)
Expand Down
42 changes: 21 additions & 21 deletions src/QMCHamiltonians/SOECPComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,32 @@
namespace qmcplusplus
{
SOECPComponent::SOECPComponent()
: lmax_(0), nchannel_(0), nknot_(0), sknot_(0), total_knots_(0), Rmax_(-1), VP_(nullptr)
: lmax_(0), nchannel_(0), nknot_(0), sknot_(0), total_knots_(0), rmax_(-1), vp_(nullptr)
{}

SOECPComponent::~SOECPComponent()
{
for (int i = 0; i < sopp_m_.size(); i++)
delete sopp_m_[i];
if (VP_)
delete VP_;
if (vp_)
delete vp_;
}

void SOECPComponent::print(std::ostream& os) {}

void SOECPComponent::initVirtualParticle(const ParticleSet& qp)
{
assert(VP_ == nullptr);
assert(vp_ == nullptr);
outputManager.pause();
VP_ = new VirtualParticleSet(qp, total_knots_);
vp_ = new VirtualParticleSet(qp, total_knots_);
outputManager.resume();
}

void SOECPComponent::deleteVirtualParticle()
{
if (VP_)
delete VP_;
VP_ = nullptr;
if (vp_)
delete vp_;
vp_ = nullptr;
}

void SOECPComponent::add(int l, RadialPotentialType* pp)
Expand All @@ -59,8 +59,8 @@ SOECPComponent* SOECPComponent::makeClone(const ParticleSet& qp)
SOECPComponent* myclone = new SOECPComponent(*this);
for (int i = 0; i < sopp_m_.size(); i++)
myclone->sopp_m_[i] = sopp_m_[i]->makeClone();
if (VP_)
myclone->VP_ = new VirtualParticleSet(qp, total_knots_);
if (vp_)
myclone->vp_ = new VirtualParticleSet(qp, total_knots_);
return myclone;
}

Expand Down Expand Up @@ -145,10 +145,10 @@ SOECPComponent::RealType SOECPComponent::evaluateOne(ParticleSet& W,
RealType sold = W.spins[iel];
buildTotalQuadrature(r, dr, sold);

if (VP_)
if (vp_)
{
VP_->makeMovesWithSpin(W, iel, deltaV_, deltaS_, true, iat);
Psi.evaluateRatios(*VP_, psiratio_);
vp_->makeMovesWithSpin(W, iel, deltaV_, deltaS_, true, iat);
Psi.evaluateRatios(*vp_, psiratio_);
}
else
for (int iq = 0; iq < total_knots_; iq++)
Expand Down Expand Up @@ -200,11 +200,11 @@ void SOECPComponent::mw_evaluateOne(const RefVectorWithLeader<SOECPComponent>& s
ResourceCollection& collection)
{
auto& soecp_component_leader = soecp_component_list.getLeader();
if (soecp_component_leader.VP_)
if (soecp_component_leader.vp_)
{
// Compute ratios with VP
RefVectorWithLeader<VirtualParticleSet> vp_list(*soecp_component_leader.VP_);
RefVectorWithLeader<const VirtualParticleSet> const_vp_list(*soecp_component_leader.VP_);
RefVectorWithLeader<VirtualParticleSet> vp_list(*soecp_component_leader.vp_);
RefVectorWithLeader<const VirtualParticleSet> const_vp_list(*soecp_component_leader.vp_);
RefVector<const std::vector<PosType>> deltaV_list;
RefVector<const std::vector<RealType>> deltaS_list;
RefVector<std::vector<ValueType>> psiratios_list;
Expand All @@ -222,8 +222,8 @@ void SOECPComponent::mw_evaluateOne(const RefVectorWithLeader<SOECPComponent>& s

component.buildTotalQuadrature(job.ion_elec_dist, job.ion_elec_displ, sold);

vp_list.push_back(*component.VP_);
const_vp_list.push_back(*component.VP_);
vp_list.push_back(*component.vp_);
const_vp_list.push_back(*component.vp_);
deltaV_list.push_back(component.deltaV_);
deltaS_list.push_back(component.deltaS_);
psiratios_list.push_back(component.psiratio_);
Expand Down Expand Up @@ -291,11 +291,11 @@ SOECPComponent::RealType SOECPComponent::evaluateValueAndDerivatives(ParticleSet

//Now we have all the spin and spatial quadrature points acculated to use in evaluation
//Now we need to obtain dlogpsi and dlogpsi_vp
if (VP_)
if (vp_)
{
// Compute ratios with VP
VP_->makeMovesWithSpin(W, iel, deltaV_, deltaS_, true, iat);
Psi.evaluateDerivRatios(*VP_, optvars, psiratio_, dratio_);
vp_->makeMovesWithSpin(W, iel, deltaV_, deltaS_, true, iat);
Psi.evaluateDerivRatios(*vp_, optvars, psiratio_, dratio_);
}
else
for (int iq = 0; iq < total_knots_; iq++)
Expand Down
12 changes: 6 additions & 6 deletions src/QMCHamiltonians/SOECPComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class SOECPComponent : public QMCTraits
int sknot_;
int total_knots_; //spin + spatial knots
///Maximum cutoff the non-local pseudopotential
RealType Rmax_;
RealType rmax_;
///Angular momentum map
aligned_vector<int> angpp_m_;
///Non-Local part of the pseudo-potential
Expand All @@ -76,7 +76,7 @@ class SOECPComponent : public QMCTraits
//scratch spaces used by evaluateValueAndDerivative
Matrix<ValueType> dratio_;
Vector<ValueType> dlogpsi_vp_;
VirtualParticleSet* VP_;
VirtualParticleSet* vp_;

//This builds the full quadrature grid for the Simpsons rule used for spin integrals as well as
//the spatial quadrature. In this function, it specifies the deltaS_ and deltaV_ for all the quadrature points and sets the interal weights
Expand Down Expand Up @@ -139,14 +139,14 @@ class SOECPComponent : public QMCTraits
void initVirtualParticle(const ParticleSet& qp);
void deleteVirtualParticle();

inline void setRmax(RealType rmax) { Rmax_ = rmax; }
inline RealType getRmax() const { return Rmax_; }
inline void setLmax(int Lmax) { lmax_ = Lmax; }
inline void setRmax(RealType rmax) { rmax_ = rmax; }
inline RealType getRmax() const { return rmax_; }
inline void setLmax(int lmax) { lmax_ = lmax; }
inline int getLmax() const { return lmax_; }
inline int getNknot() const { return nknot_; }
inline int getSknot() const { return sknot_; }

const VirtualParticleSet* getVP() const { return VP_; };
const VirtualParticleSet* getVP() const { return vp_; };

friend struct ECPComponentBuilder;
friend void copyGridUnrotatedForTest(SOECPComponent& nlpp);
Expand Down

0 comments on commit dab55ff

Please sign in to comment.