コード例 #1
0
ファイル: diffusion.java プロジェクト: noelcjr/Aguan
 public diffusion(String filePath, String fileType) {
   try {
     prefix = filePath.substring(0, (filePath.length() - 4));
     System.out.println("Reading file trj_typ: " + prefix);
     if (fileType.equals("dcd")) {
       DCD = new dcd(filePath);
       DCD.openInputStream();
       System.out.printf("DCD file %s \n", DCD.read_dcd());
       DCD.est_file_length();
       DCD.print_header();
       DCD.gen_DCD_body_pointers();
     } else if (fileType.equals("trr")) {
       FR = new FileReader(filePath);
       dFile = new BufferedReader(FR);
     }
     outcrd = new FileWriter(prefix + "_crd.xvg");
     doutC = new PrintWriter(outcrd, true);
     outvel = new FileWriter(prefix + "_vel.xvg");
     doutV = new PrintWriter(outvel, true);
     outfrc = new FileWriter(prefix + "_frc.xvg");
     doutF = new PrintWriter(outfrc, true);
     frameData1 = new String[5];
     frameData2 = new String[5];
     sumX = sumY = sumZ = 0;
   } catch (IOException e) {
     System.err.println(e);
   }
 }
コード例 #2
0
ファイル: diffusion.java プロジェクト: noelcjr/Aguan
 public void read_dcd_file() {
   String line;
   int lineCount, frameCount, natoms, i, NSET, N;
   float time;
   lineCount = frameCount = 0;
   N = DCD.get_N();
   NSET = DCD.get_NSET();
 }
コード例 #3
0
ファイル: diffusion.java プロジェクト: noelcjr/Aguan
 public void read_dcd_frame(int n, int nset) {
   int i, j;
   for (i = 0; i < 3; i++) {
     System.out.println(DCD.read_int());
     for (j = 0; j < n; j++) {
       System.out.println("[" + i + "," + j + "]=" + DCD.read_float());
     }
     System.out.println(DCD.read_int());
   }
 }