コード例 #1
0
ファイル: control.c プロジェクト: daschaich/polarization
int main(int argc, char *argv[]) {
  register int i;
  register site *s;
  int prompt;
  double ss_plaq, st_plaq, td;

  // Setup
  setlinebuf(stdout); // DEBUG
  initialize_machine(&argc, &argv);
  // Remap standard I/O
  if (remap_stdio_from_args(argc, argv) == 1)
    terminate(1);

  g_sync();
  prompt = setup();

  // Load input and run (loop removed)
  if (readin(prompt) != 0) {
    node0_printf("ERROR in readin, aborting\n");
    terminate(1);
  }

  // Serial code!
  if (this_node != 0) {
    node0_printf("ERROR: run this thing in serial!\n");
    terminate(1);
  }

  // Check plaquette
  plaquette(&ss_plaq, &st_plaq);
  td = 0.5 * (ss_plaq + st_plaq);
  node0_printf("START %.8g %.8g %.8g\n", ss_plaq, st_plaq, td);

  // Compute field strength tensor at each site
  make_field_strength(F_OFFSET(link), F_OFFSET(FS));
  FORALLSITES(i, s) {
    // TODO...
  }

  fflush(stdout);
  return 0;
}
コード例 #2
0
ファイル: fmunu.c プロジェクト: erinaldi/milc_qcd
/* Computes the field strength components and topological charge */
void
fmunu_fmunu( double *time, double *space, double *charge )
{
  /* Site variables */
  register int i;
  register site *s;

  /* Temporary component storage */
  su3_matrix *ft, *fs;

  /* Initialize sums */
  *time = *space = *charge = 0;

  /* Compute 8*F_mu,nu at each site */
  make_field_strength( F_OFFSET(link), F_OFFSET(fieldstrength) );

  /* Loop over each site to sum F_mu,nu components */
  FORALLSITES(i, s) {
    
    fs = &(s->fieldstrength[FS_XY]);
    ft = &(s->fieldstrength[FS_ZT]);
    *time -= real_trace_nn(ft, ft);
    *space -= real_trace_nn(fs, fs);
    *charge -= real_trace_nn(fs, ft);

    fs = &(s->fieldstrength[FS_XZ]);
    ft = &(s->fieldstrength[FS_YT]);
    *time -= real_trace_nn(ft, ft);
    *space -= real_trace_nn(fs, fs);
    *charge -= realtrace_su3(fs, ft); /* ReTr{ fs.dag * ft } */

    fs = &(s->fieldstrength[FS_YZ]);
    ft = &(s->fieldstrength[FS_XT]);
    *time -= real_trace_nn(ft, ft);
    *space -= real_trace_nn(fs, fs);
    *charge -= real_trace_nn(fs, ft);
  }