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


C++ Lattice::FixGaugeKind方法代码示例

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


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

示例1: gaugeFixSink

//----------------------------------------------------------------------------
// Coulomb gauge fix fermion solution vector in hyperplanes of direction dir.
// Gauge fixing matrices must exist before this routine is used.
// --- Meifeng Lin 01/31/06
//---------------------------------------------------------------------------- 
void FermionVector::gaugeFixSink(Lattice &lat, int dir) const
{
  char *fname = "gaugeFixSink()";
  VRB.Func(d_class_name, fname);
  
  Matrix **gm = lat.FixGaugePtr();
  //-------------------------------------------------------
  //If gauge fixing matrices do not exist, 
  //nothing has to be done.
  //-------------------------------------------------------
  if(gm==0){
    ERR.General(d_class_name,fname,"No gauge fixing matrices were found\n");
    return;
  }
  else{
    printf("Gauge Fixing Sink...\n");

  }

  IFloat *fv = d_fermion_p;

  int error = 0;
  switch(dir){
  case 0:
    if ( lat.FixGaugeKind() != FIX_GAUGE_COULOMB_X )
      error = 1;break;
  case 1:
    if ( lat.FixGaugeKind() != FIX_GAUGE_COULOMB_Y )
      error = 1;break;
  case 2:
    if ( lat.FixGaugeKind() != FIX_GAUGE_COULOMB_Z )
      error = 1;break;
  case 3:
    if ( lat.FixGaugeKind() != FIX_GAUGE_COULOMB_T )
      error = 1;break;
  }
  if (error)
    ERR.General(d_class_name,fname,"Mismatch gauge fixing kind\n");

  int lcl[LORENTZs];
  
  //-------------------------------------------------------------------------
  // Indices for all the directions
  // Here use "t" to indicate the propagation direction, but not necessarily 
  // the generic t direction. Other 3 directions are arbitrarily labelled x,y,z
  //-------------------------------------------------------------------------
  int t = dir;
  int z = (dir + 1) % LORENTZs;
  int y = (dir + 2) % LORENTZs;
  int x = (dir + 3) % LORENTZs;
  
  Vector tmp_vec;
  
  for (lcl[t]=0; lcl[t] < lcl_sites[t]; lcl[t]++) {
    
    Matrix *pM = gm[lcl[t]];
    
    if(pM != NULL ){
      for (lcl[z]  = 0; lcl[z] < lcl_sites[z]; lcl[z]++)
	for (lcl[y] = 0; lcl[y] < lcl_sites[y]; lcl[y]++)
	  for (lcl[x] = 0; lcl[x] < lcl_sites[x]; lcl[x]++)
	    {
	      // the matrix offset
	      int j =  siteOffset(lcl,dir);
	      for (int spin = 0; spin < DIRACs; spin++)
		{
		  // the vector offset
		  int i= 2 * COLORs * ( spin + 4 * siteOffset(lcl));
		  tmp_vec.CopyVec((Vector*)&fv[i], 6);
		  uDotXEqual((IFloat*)&fv[i],(const IFloat*)&pM[j],
			     (const IFloat*)&tmp_vec);
		}
	    }
    }
    else{
         ERR.General(d_class_name,fname,"Not gauge fixing matrices were found at slice = %d\n",lcl[t]); 
         Float *null_p = 0;
         *null_p = 1.;
    }
  }


}
开发者ID:DeanHowarth,项目名称:QUDA-CPS,代码行数:88,代码来源:w_ferm_vec.C


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