Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

alg_smear_oleg.C

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00022 //--------------------------------------------------------------------
00023 #include <config.h>
00024 #include <math.h>
00025 #include <util/qcdio.h>
00026 #include <alg/alg_smear.h>
00027 #include <util/lattice.h>
00028 #include <util/gjp.h>
00029 #include <util/error.h>
00030 #include <util/site.h>
00031 #include <util/link_buffer.h>
00032 #include <util/smalloc.h>
00033 
00034 CPS_START_NAMESPACE
00035 
00036 AlgOlegSmear::AlgOlegSmear(Lattice&     lat,
00037                            CommonArg*   ca,
00038                            ApeSmearArg* asa):
00039   // does not perform builtin SU(3) projecton, see run().
00040   AlgApeSmear(lat,ca,asa,0),
00041   cname("AlgOlegSmear"),
00042   coef(asa->coef)
00043 {
00044   cname = "AlgOlegSmear";
00045   lat_back2 = new Matrix[GJP.VolNodeSites()*4];
00046   if ( lat_back2 == 0x0 ) { ERR.Pointer(cname, cname,"lat_back2"); }
00047 }
00048   
00049 AlgOlegSmear::~AlgOlegSmear() {
00050   delete[] lat_back2;
00051 }
00052 
00058 void AlgOlegSmear::run()
00059 {
00060   if(common_arg->filename != 0){
00061     FILE* f = Fopen(common_arg->filename, "a");
00062     if(!f) ERR.FileA(cname, "run", common_arg->filename);
00063     Fprintf(f,"AlgOlegSmear: coef = %e \n",coef);
00064     Fclose(f);
00065   }
00066 
00067   Lattice& lattice(AlgLattice());
00068 
00069   // backup the original,
00070   // which needs to be restored when SU(3) projection fails
00071   lattice.CopyGaugeField(lat_back2);
00072 
00073   AlgSmear::run();
00074 
00075   // do Thomas' SU(3) projection
00076   Matrix* u;
00077   u = (Matrix*) lattice.GaugeField();
00078   int isSingular;
00079   Site s;
00080   while( s.LoopsOverNode() ) {
00081     int offset = s.Index()*4;
00082     for(int mu=0;mu<4;mu++) {
00083       if( u->ProjSU3() ) { // returns 1 if the matrix is singular
00084         printf("Smeared link SU(3) matrix appears to be singular.Substituted original link\n");
00085         *u = *(lat_back2+offset+mu);
00086       }
00087       u++;
00088     }
00089   }
00090 }
00091 
00092 CPS_END_NAMESPACE

Generated on Sat Oct 10 14:11:20 2009 for Columbia Physics System by  doxygen 1.3.9.1