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


C++ Communicator::primaryNode方法代码示例

本文整理汇总了C++中Communicator::primaryNode方法的典型用法代码示例。如果您正苦于以下问题:C++ Communicator::primaryNode方法的具体用法?C++ Communicator::primaryNode怎么用?C++ Communicator::primaryNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Communicator的用法示例。


在下文中一共展示了Communicator::primaryNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: run


//.........这里部分代码省略.........
  double ev=0.0;
  while(reader>>idummy && reader>>ev) iev++;

  CCIO::cout<<"Found "<< iev <<" eigenvalues in "<< Eval_filename<<"\n";
  
  for(int eid=0; eid<std::min(Nev,iev); ++eid){
    double eval;
    Field evec(FF.size());
    if(Eigen::pickUpFromFile<Format::Format_F>(eval,evec,eid,eig_pred,
					       Eval_filename,Emod_filename)) continue;
    CCIO::cout<< "Eigenvalue: "<< eval<<"\n";
    CCIO::cout<< "Norm: "<< evec.norm()<<"\n";

    std::ofstream outf, outc;

    double ipr=0.0; //inverse participation ratio (2nd moment)
    double ipr_q4=0.0; //inverse participation ratio (4th moment)
    double ipr_q6=0.0; //inverse participation ratio (6th moment)

    
    int max_loc[4];
    double max= 0.0;
    
    int min_loc[4];
    double min = 0.0;
    
    for(int t=0; t<Nt; ++t){
      std::stringstream ss;
      ss<< fname<< "_"<< eid<< "_norm_t"<< t; 
      
      std::stringstream sc;
      sc<< fname<< "_"<< eid<< "_chirality_t"<< t;   
      
      if(comm->primaryNode()){
	outf.open(ss.str().c_str()); 
	outc.open(sc.str().c_str());
      }
      outf<<"x  y  z  norm\n";
      outc<<"x  y  z  chi_norm\n";
      
      for(int x=0; x<Nx; ++x){
	for(int y=0; y<Ny; ++y){
	  for(int z=0; z<Nz; ++z){
	    
	    int site = SiteIndex::instance()->site(x,y,z,t);
	    int site0 = SiteIndex::instance()->site(x,y,z,0);
	    //Local norm;
	    double site_norm = 0.0;
	    SUNmat PL = mat(PL_field,site0);
	    double pl_re = SUNmatUtils::ReTr(PL);
	    double pl_im = SUNmatUtils::ImTr(PL);
	    
	    //std::valarray<double> site_Array(EigM.evecs_[eid][FF.islice(site)]);
	    std::valarray<double> site_Array(evec[FF.islice(site)]);
	    
	    //std::cout << "spinor\n";
	    //print_va(site_Array);
	    
	    // DIRAC representation
	    std::valarray<double> spinor_up(24);
	    std::valarray<double> spinor_dn(24);
	    
	    std::valarray<double> chiral(24);
	    std::valarray<double> chiral_left(24);
	    std::valarray<double> chiral_right(24);
	    
开发者ID:coppolachan,项目名称:IroIro,代码行数:66,代码来源:test_ReadEigenModes.cpp


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