本文整理汇总了C++中QMCHamiltonian::sizeOfCollectables方法的典型用法代码示例。如果您正苦于以下问题:C++ QMCHamiltonian::sizeOfCollectables方法的具体用法?C++ QMCHamiltonian::sizeOfCollectables怎么用?C++ QMCHamiltonian::sizeOfCollectables使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMCHamiltonian
的用法示例。
在下文中一共展示了QMCHamiltonian::sizeOfCollectables方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: put
/** This should be moved to branch engine */
bool EstimatorManager::put(MCWalkerConfiguration& W, QMCHamiltonian& H, xmlNodePtr cur)
{
vector<string> extra;
cur = cur->children;
while(cur != NULL)
{
string cname((const char*)(cur->name));
if(cname == "estimator")
{
string est_name(MainEstimatorName);
string use_hdf5("yes");
OhmmsAttributeSet hAttrib;
hAttrib.add(est_name, "name");
hAttrib.add(use_hdf5, "hdf5");
hAttrib.put(cur);
if( (est_name == MainEstimatorName) || (est_name=="elocal") )
{
max4ascii=H.sizeOfObservables()+3;
add(new LocalEnergyEstimator(H,use_hdf5=="yes"),MainEstimatorName);
}
else
extra.push_back(est_name);
}
cur = cur->next;
}
if(Estimators.empty())
{
app_log() << " Adding a default LocalEnergyEstimator for the MainEstimator " << endl;
max4ascii=H.sizeOfObservables()+3;
add(new LocalEnergyEstimator(H,true),MainEstimatorName);
}
//Collectables is special and should not be added to Estimators
if(Collectables == 0 && H.sizeOfCollectables())
{
app_log() << " Using CollectablesEstimator for collectables, e.g. sk, gofr, density " << endl;
Collectables=new CollectablesEstimator(H);
}
return true;
}
示例2: put
/** This should be moved to branch engine */
bool EstimatorManager::put(MCWalkerConfiguration& W, QMCHamiltonian& H, xmlNodePtr cur)
{
vector<string> extra;
cur = cur->children;
while(cur != NULL)
{
string cname((const char*)(cur->name));
if(cname == "estimator")
{
string est_name(MainEstimatorName);
string use_hdf5("yes");
OhmmsAttributeSet hAttrib;
hAttrib.add(est_name, "name");
hAttrib.add(use_hdf5, "hdf5");
hAttrib.put(cur);
if( (est_name == MainEstimatorName) || (est_name=="elocal") )
{
if(use_hdf5 == "yes")
{
max4ascii=H.size()+3;//write only physical energies
add(new LocalEnergyEstimatorHDF(H),MainEstimatorName);
}
else
{//fall back to the ascii file
max4ascii=H.sizeOfObservables()+3;
add(new LocalEnergyEstimator(H),MainEstimatorName);
}
}
else if (est_name=="WFMConly")
{
max4ascii=H.sizeOfObservables()+10;
app_log() << " Using WFMConly for the MainEstimator " << endl;
add(new WFMCOnlyEstimator(H),MainEstimatorName);
est_name=MainEstimatorName;
}
else if (est_name=="releasednode")
{
int Smax(100);
int primary(1);
OhmmsAttributeSet hAttrib;
hAttrib.add(Smax, "Smax");
hAttrib.add(primary, "primary");
hAttrib.put(cur);
max4ascii=H.sizeOfObservables()+ 4 + 3*(Smax+1);
app_log() << " Using ReleasedNode for the MainEstimator with Smax="<<Smax<<" and max4ascii="<<max4ascii << endl;
if (primary==2) add(new ReleasedNodeEnergyEstimator(H,Smax),MainEstimatorName);
else add(new AlternateReleasedNodeEnergyEstimator(H,Smax),MainEstimatorName);
est_name=MainEstimatorName;
}
else if (est_name=="forwardwalking")
{
max4ascii=2*H.sizeOfObservables()+4;
app_log() << " Doing forwardwalking on hdf5 " << endl;
add(new ForwardWalkingEstimator(H),MainEstimatorName);
est_name=MainEstimatorName;
} else
extra.push_back(est_name);
}
cur = cur->next;
}
if(Estimators.empty())
{
app_log() << " Adding a default LocalEnergyEstimator for the MainEstimator " << endl;
max4ascii=H.sizeOfObservables()+3;
add(new LocalEnergyEstimator(H),MainEstimatorName);
//add(new LocalEnergyOnlyEstimator(),MainEstimatorName);
}
if(Collectables == 0 && H.sizeOfCollectables())
{
app_log() << " Using CollectablesEstimator for collectables, e.g. sk, gofr, density " << endl;
Collectables=new CollectablesEstimator(H);
add(Collectables,"collectables");
}
return true;
}
示例3: refH
CollectablesEstimator::CollectablesEstimator(QMCHamiltonian& h)
: refH(h)
{
scalars.resize(h.sizeOfCollectables());
scalars_saved.resize(h.sizeOfCollectables());
}