当前位置: 首页>>代码示例>>C++>>正文


C++ QMCHamiltonian::sizeOfCollectables方法代码示例

本文整理汇总了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;
}
开发者ID:digideskio,项目名称:qmcpack,代码行数:40,代码来源:EstimatorManager.cpp

示例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;
  }
开发者ID:digideskio,项目名称:qmcpack,代码行数:79,代码来源:EstimatorManager.cpp

示例3: refH

 CollectablesEstimator::CollectablesEstimator(QMCHamiltonian& h)
   : refH(h)
 { 
   scalars.resize(h.sizeOfCollectables());
   scalars_saved.resize(h.sizeOfCollectables());
 }
开发者ID:digideskio,项目名称:qmcpack,代码行数:6,代码来源:CollectablesEstimator.cpp


注:本文中的QMCHamiltonian::sizeOfCollectables方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。