public void run() {

    double[] av = new double[] {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9};
    int teq = params.iget("Equil Time");
    for (double alpha : av) {
      params.set("Status", "Intializing");
      Job.animate();
      params.set("Dissipation (\u03B1)", alpha);
      model = new ofc2Dfast(params);
      if (alpha == av[0])
        model.PrintParams(
            model.getOutdir() + File.separator + "Params_" + model.getBname() + ".log",
            params,
            model);
      params.set("Status", "Ready");
      Job.animate();
      for (int tt = 0; tt < teq; tt++) {
        model.evolve(tt, false);
        if (tt % 1000 == 0) {
          params.set("Status", (tt - teq));
          Job.animate();
        }
      }

      PrintUtil.printVectorToFile(
          model.getOutdir() + File.separator + model.getBname() + "_Stress_" + 100 * alpha + ".txt",
          model.getStress());
      params.set("Random Seed", params.iget("Random Seed") + 1);
    }
  }
Esempio n. 2
0
  public void run() {
    model = new LennardJones(params);
    tau = params.fget("d\u03C4");
    T = params.fget("T");
    then = 0;
    fout = params.sget("Data Directory") + File.separator + params.sget("Data File") + ".txt";
    PrintUtil.printlnToFile(
        params.sget("Data Directory")
            + File.separator
            + "Params_"
            + params.sget("Data File")
            + ".log",
        params.toString());
    Job.animate();

    int count = 0;
    int mxdp = 20;
    int nkx2m = 100 * 100;
    int nky2m = nkx2m;
    double sfRP[][] = new double[(int) (Math.sqrt(nkx2m)) + 1][(int) (Math.sqrt(nky2m)) + 1];
    double sfIP[][] = new double[(int) (Math.sqrt(nkx2m)) + 1][(int) (Math.sqrt(nky2m)) + 1];
    double foo[] = new double[2];

    while (count < mxdp) {
      now = model.stepWT();
      Job.animate();
      if (now - then >= tau) {
        then = now;
        for (int nx = 0; nx * nx <= nkx2m; nx++) {
          for (int ny = 0; ny * ny + nx * nx <= nky2m; ny++) {
            foo = model.structureFactor(nx, ny);
            sfRP[nx][ny] = foo[0];
            sfIP[nx][ny] = foo[1];
          }
          params.set("SF", Ef.format(100. * nx * nx / (double) (nkx2m)));
          Job.animate();
        }
        printSF(sfRP, sfIP, count, (int) (Math.sqrt(nkx2m)) + 1, (int) (Math.sqrt(nky2m)) + 1);
        count++;
      }
    }

    return;
  }
  public void Singlerun(IsingStructure Ising, int R, int L, double Tq, int steplimit, double q) {
    int run = 0;
    double dilution = Ising.percent;
    String path =
        "/Users/liukang2002507/Desktop/simulation/LRDIP/singlerun-R="
            + fmt.format(R)
            + "-L="
            + fmt.format(L)
            + "-q=0."
            + qmt.format(dilution * 1000000)
            + ".txt";
    String overall = "/Users/liukang2002507/Desktop/simulation/LRDIP/L=" + fmt.format(L) + ".txt";

    for (run = 1; run <= 1; run++) {
      Ising.Dinitialization(run, run, R, R);
      params.set("copies", run);
      params.set("deadsites", Ising.deadsites);
      Ising.Sinitialization(0, run);
      Istemp = Ising.clone();
      double mag = 0;
      int positive = 0;
      int negative = 0;

      Job.animate();
      int presteplimit = 50;
      params.set("T", 99);

      Random heat = new Random(run);
      Random flip = new Random(run);

      for (int prestep = 0; prestep < presteplimit; prestep++) {

        T = params.fget("T");
        H = params.fget("H");

        Istemp.MCS(T, H, heat, 1);
        params.set("MCS", prestep - presteplimit);
        Job.animate();
        mag = Istemp.Magnetization();
        reducedM = mag / (1 - Istemp.percent);
        PrintUtil.printlnToFile(path, prestep - presteplimit, mag, reducedM);
        params.set("magnetization", mag);
        params.set("reduced M", reducedM);
      }
      params.set("T", Tq);
      for (int step = 0; step < steplimit; step++) {
        T = params.fget("T");
        H = params.fget("H");

        Istemp.MCS(T, H, flip, 1);
        params.set("MCS", step);
        mag = Istemp.Magnetization();
        reducedM = mag / (1 - Istemp.percent);

        params.set("magnetization", mag);
        params.set("reduced M", reducedM);
        Job.animate();
        PrintUtil.printlnToFile(path, step, mag, reducedM);
        if (steplimit - step <= (steplimit / 2)) {
          if (reducedM < 0) negative++;
          if (reducedM > 0) positive++;
        }
      }
      PrintUtil.printlnToFile(overall, q, mag, Math.abs(reducedM), positive, negative);
    }
  }