Skip to content

Commit afc0f1a

Browse files
authored
Merge pull request brucefan1983#1388 from tang070205/20260307-rdf
RDF output file header uses element symbols
2 parents 4ac1052 + 1234000 commit afc0f1a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/measure/rdf.cu

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,22 @@ void RDF::postprocess(
214214

215215
FILE* fid = fopen("rdf.out", "a");
216216

217+
std::vector<std::string> type_symbols(rdf_para.num_types);
218+
for (int a = 0; a < rdf_para.num_types; a++) {
219+
int type_idx = rdf_para.type_index[a];
220+
for (int n = 0; n < atom.number_of_atoms; n++) {
221+
if (atom.cpu_type[n] == type_idx) {
222+
type_symbols[a] = atom.cpu_atom_symbol[n];
223+
break;
224+
}
225+
}
226+
}
227+
217228
fprintf(fid, "#radius total");
218229
for (int a = 0; a < rdf_para.num_types; a++) {
219230
for (int b = a; b < rdf_para.num_types; b++) {
220231
fprintf(fid, " type_%d_%d", rdf_para.type_index[a], rdf_para.type_index[b]);
232+
fprintf(fid, " %s-%s", type_symbols[a].c_str(), type_symbols[b].c_str());
221233
}
222234
}
223235
fprintf(fid, "\n");

0 commit comments

Comments
 (0)