本文整理汇总了C++中QMCHamiltonian::makeClone方法的典型用法代码示例。如果您正苦于以下问题:C++ QMCHamiltonian::makeClone方法的具体用法?C++ QMCHamiltonian::makeClone怎么用?C++ QMCHamiltonian::makeClone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMCHamiltonian
的用法示例。
在下文中一共展示了QMCHamiltonian::makeClone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeClones
void CloneManager::makeClones(MCWalkerConfiguration& w,
TrialWaveFunction& psi, QMCHamiltonian& ham)
{
if(wClones.size()) {
app_log() << " Cannot make clones again. Use existing " << NumThreads << " clones" << endl;
return;
}
app_log() << "Number of threads = " << NumThreads << endl;
wClones.resize(NumThreads,0);
psiClones.resize(NumThreads,0);
hClones.resize(NumThreads,0);
wClones[0]=&w;
psiClones[0]=ψ
hClones[0]=&ham;
#if defined(ENABLE_CLONE_PSI_AND_H)
char pname[16];
for(int ip=1; ip<NumThreads; ++ip)
{
sprintf(pname,"%s.c%i",w.getName().c_str(),ip);
wClones[ip]=new MCWalkerConfiguration(w);
wClones[ip]->setName(pname);
psiClones[ip]=psi.makeClone(*wClones[ip]);
hClones[ip]=ham.makeClone(*wClones[ip],*psiClones[ip]);
}
#else
cloneEngine.clone(w,psi,ham,wClones,psiClones,hClones);
#endif
}
示例2: makeClones
void CloneManager::makeClones(MCWalkerConfiguration& w,
TrialWaveFunction& psi, QMCHamiltonian& ham)
{
if(wClones.size())
{
app_log() << " Cannot make clones again. Use existing " << NumThreads << " clones" << endl;
return;
}
wClones.resize(NumThreads,0);
psiClones.resize(NumThreads,0);
hClones.resize(NumThreads,0);
wClones[0]=&w;
psiClones[0]=ψ
hClones[0]=&ham;
if(NumThreads==1) return;
app_log() << " CloneManager::makeClones makes " << NumThreads << " clones for W/Psi/H." <<endl;
#if defined(ENABLE_CLONE_PSI_AND_H)
app_log() << " Cloning methods for both Psi and H are used" << endl;
OhmmsInfo::Log->turnoff();
OhmmsInfo::Warn->turnoff();
char pname[16];
for(int ip=1; ip<NumThreads; ++ip)
{
wClones[ip]=new MCWalkerConfiguration(w);
psiClones[ip]=psi.makeClone(*wClones[ip]);
hClones[ip]=ham.makeClone(*wClones[ip],*psiClones[ip]);
}
OhmmsInfo::Log->reset();
OhmmsInfo::Warn->reset();
#else
app_log() << "Old parse method is used." << endl;
cloneEngine.clone(w,psi,ham,wClones,psiClones,hClones);
#endif
}