コード例 #1
0
ファイル: GLUlib_wrap.c プロジェクト: RJHudspith/GLU
// U1 the links
int
read_and_U1( const char *infile , 
	     const GLU_bool rtrans ,
	     const struct u1_info U1INFO ,
	     const char *outfile , 
	     const GLU_output storage , 
	     const char *output_details ) 
{
  struct head_data HEAD_DATA ;
  struct site *lat = read_file( &HEAD_DATA , infile ) ;
  int FLAG = GLU_SUCCESS ;
  
  if( lat == NULL ) return GLU_FAILURE ;

  // if we want a random transform then here is where we do it
  if( rtrans == GLU_TRUE ) { random_gtrans( lat ) ; }

  suNC_cross_u1( lat , U1INFO ) ;

  if( (Latt.argc-1) == WRITE ) {
    FLAG = write_configuration( lat , outfile , storage , output_details ) ;
  }

  free_lat( lat ) ;

  return FLAG ;
}
コード例 #2
0
ファイル: GLUlib_wrap.c プロジェクト: RJHudspith/GLU
// checks unitarity and can write out a configuration
int
read_and_check( const char *infile ,
		const GLU_bool rtrans , 
		const char *outfile , 
		const GLU_output storage , 
		const char *output_details )
{
  struct head_data HEAD_DATA ;
  struct site *lat = read_file( &HEAD_DATA , infile ) ;
  int FLAG = GLU_SUCCESS ;
  
  // should print out a warning
  if( lat == NULL ) return GLU_FAILURE ;

  // if we want a random transform then here is where we do it
  if( rtrans == GLU_TRUE ) { random_gtrans( lat ) ; }

  gauge( lat ) ;

  if( (Latt.argc-1) == WRITE ) {
    FLAG = write_configuration( lat , outfile , storage , output_details ) ;
  }

  free_lat( lat ) ;

  return FLAG ;
}
コード例 #3
0
// configuration-dependent startup
static char *config_tests( void ) 
{
  // malloc our gauge field and initialise our lattice geometry
  lat = NULL ; 
  if( ( lat = allocate_lat( ) ) == NULL ) {
    fprintf( stderr , "[CONFIG-UNIT] Gauge field allocation failure\n" ) ;
    return NULL ;
  }
  init_navig( lat ) ;

  // randomly generate an SU(NC) field
  random_suNC( lat ) ;

  // allocate gauge transformed fields
  glat = NULL ; 
  if( ( glat = allocate_lat( ) ) == NULL ) {
    fprintf( stderr , "[CONFIG-UNIT] Gauge field 2 allocation failure\n" ) ;
    return NULL ;
  }
  init_navig( glat ) ;

  size_t i , mu ;
  for( i = 0 ; i < LVOLUME ; i++ ) {
    for( mu = 0 ; mu < ND ; mu++ ) {
      equiv( glat[i].O[mu] , lat[i].O[mu] ) ;
    }
  }

  // assumes gtrans works properly
  random_gtrans( glat ) ;

  // test gauge invariant stuff
  mu_run_test( av_plaquette_test ) ;
  mu_run_test( polyakov_test ) ;

  free( lat ) ;
  free( glat ) ;

  return 0 ;
}