本文整理汇总了C++中QMCHamiltonian::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ QMCHamiltonian::getName方法的具体用法?C++ QMCHamiltonian::getName怎么用?C++ QMCHamiltonian::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMCHamiltonian
的用法示例。
在下文中一共展示了QMCHamiltonian::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hterms
LocalEnergyEstimator::LocalEnergyEstimator(QMCHamiltonian& h):Href(h) {
int hterms(h.size());
SizeOfHamiltonians = hterms;
FirstHamiltonian = h.startIndex();
elocal.resize(SizeOfHamiltonians+LE_MAX);
elocal_name.resize(SizeOfHamiltonians+LE_MAX);
elocal_name[ENERGY_INDEX] = "LocalEnergy";
elocal_name[ENERGY_SQ_INDEX] = "Variance";
elocal_name[POTENTIAL_INDEX] = "LocalPotential";
int ii(LE_MAX);
for(int i=0; i < SizeOfHamiltonians; i++) elocal_name[ii++] = h.getName(i);
}
示例2: clone
void HamiltonianPool::clone(const MCWalkerConfiguration& qp, const TrialWaveFunction& psi, const QMCHamiltonian& h,
vector<MCWalkerConfiguration*>& plist,
vector<TrialWaveFunction*>& olist,
vector<QMCHamiltonian*>& hlist)
{
int np=omp_get_max_threads();
{
ReportEngine PRE("HamiltonianPool","clone");
app_log() << "Number of threads = " << np << endl;
}
//temporarily turnoff stream buffer for the clones
OhmmsInfo::Log->turnoff();
OhmmsInfo::Warn->turnoff();
//clone ParticleSet and TrialWaveFunction
WaveFunctionFactory* psiFac=psiPool->getWaveFunctionFactory(psi.getName());
psiFac->setCloneSize(np);
//capture cloned WaveFunctionFactory*
vector<WaveFunctionFactory*> otemp;
otemp.resize(np,0);
//allocate the data on each thread
//#pragma omp parallel
// {
// int ip=omp_get_thread_num();
//#pragma omp critical
// {
// if(ip) {
// char pname[16],oname[16];
// sprintf(pname,"%s.c%i",qp.getName().c_str(),ip);
// plist[ip]=new MCWalkerConfiguration(qp);
// plist[ip]->setName(pname);
//
// sprintf(oname,"%s.c%i",psi.getName().c_str(),ip);
// otemp[ip]= psiFac->clone(plist[ip],ip,oname);
// }
// }
// }
//
// //add the Clones to the pools
// for(int ip=1; ip<np; ip++)
// {
// ptclPool->addParticleSet(plist[ip]);
// psiPool->addFactory(otemp[ip]);
// olist[ip]=otemp[ip]->targetPsi;
// if(ip%2==1) olist[ip]->reverse();
// }
//
//add the Clones to the pools
for(int ip=1; ip<np; ++ip)
{
plist[ip]=new MCWalkerConfiguration(qp);
char oname[16];
sprintf(oname,"%s.c%i",psi.getName().c_str(),ip);
// Don't recreate with a factory anymore
//otemp[ip]= psiFac->clone(plist[ip],ip,oname);
//ptclPool->addParticleSet(plist[ip]);
//psiPool->addFactory(otemp[ip]);
//olist[ip]=otemp[ip]->targetPsi;
// Just clone the TrialWaveFunction.
ptclPool->addParticleSet(plist[ip]);
olist[ip]=psiFac->targetPsi->makeClone(*plist[ip]);
olist[ip]->setName(oname);
//need to add a WaveFunctionFactory so that Hamiltonian can use them
otemp[ip]=new WaveFunctionFactory(*psiFac);//make a shallow copy
otemp[ip]->setPsi(olist[ip]);
psiPool->addFactory(otemp[ip]);
}
//find the HamiltonianFactory* to be cloned
HamiltonianFactory* hFac=0;
PoolType::iterator hit(myPool.find(h.getName()));
if(hit == myPool.end()) {
hFac=(*(myPool.begin())).second;
} else {
hFac=(*hit).second;
}
hFac->setCloneSize(np);
vector<HamiltonianFactory*> htemp;
htemp.resize(np,0);
//#pragma omp parallel
// {
// int ip=omp_get_thread_num();
//#pragma omp critical
// {
// if(ip) {
// char hname[16];
// sprintf(hname,"%s.c%i",h.getName().c_str(),ip);
// htemp[ip]= hFac->clone(plist[ip],olist[ip],ip,hname);
// }
// }
// }
//.........这里部分代码省略.........