本文整理汇总了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.;
}
}
}