Skip to content

Commit

Permalink
correct box input interface
Browse files Browse the repository at this point in the history
  • Loading branch information
brucefan1983 committed Nov 22, 2019
1 parent 3ffca6b commit 7f86f8c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/fitness.cu
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,23 @@ void Fitness::read_train_in(char* input_dir)
if (pe_ref[n] < energy_minimum) energy_minimum = pe_ref[n];
}

// box
// box (transpose of VASP input matrix)
float h_tmp[9];
for (int k = 0; k < 9; ++k)
{
count = fscanf(fid, "%f", &h[k + 18 * n]);
count = fscanf(fid, "%f", &h_tmp[k]);
if (count != 1) { print_error("reading error for train.in.\n"); }
}
h[0 + 18 * n] = h_tmp[0];
h[3 + 18 * n] = h_tmp[1];
h[6 + 18 * n] = h_tmp[2];
h[1 + 18 * n] = h_tmp[3];
h[4 + 18 * n] = h_tmp[4];
h[7 + 18 * n] = h_tmp[5];
h[2 + 18 * n] = h_tmp[6];
h[5 + 18 * n] = h_tmp[7];
h[8 + 18 * n] = h_tmp[8];

get_inverse(h + 18 * n);

// type, position, force
Expand Down

0 comments on commit 7f86f8c

Please sign in to comment.