Skip to content
Snippets Groups Projects
Commit 44af19b4 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Fix binary TM output axis order and write values as double pairs

parent f8e84eb6
No related branches found
No related tags found
No related merge requests found
...@@ -294,10 +294,17 @@ void sphere(string config_file, string data_file, string output_path) { ...@@ -294,10 +294,17 @@ void sphere(string config_file, string data_file, string output_path) {
ttms.write(reinterpret_cast<char *>(&vk), sizeof(double)); ttms.write(reinterpret_cast<char *>(&vk), sizeof(double));
ttms.write(reinterpret_cast<char *>(&exri), sizeof(double)); ttms.write(reinterpret_cast<char *>(&exri), sizeof(double));
for (int lmi = 0; lmi < gconf->l_max; lmi++) { for (int lmi = 0; lmi < gconf->l_max; lmi++) {
complex<double> element1 = -1.0 / c1->rmi[0][lmi]; complex<double> element1 = -1.0 / c1->rmi[lmi][0];
complex<double> element2 = -1.0 / c1->rei[0][lmi]; complex<double> element2 = -1.0 / c1->rei[lmi][0];
ttms.write(reinterpret_cast<char *>(&element1), sizeof(complex<double>)); double vreal, vimag;
ttms.write(reinterpret_cast<char *>(&element2), sizeof(complex<double>)); vreal = element1.real();
vimag = element1.imag();
ttms.write(reinterpret_cast<char *>(&vreal), sizeof(double));
ttms.write(reinterpret_cast<char *>(&vimag), sizeof(double));
vreal = element2.real();
vimag = element2.imag();
ttms.write(reinterpret_cast<char *>(&vreal), sizeof(double));
ttms.write(reinterpret_cast<char *>(&vimag), sizeof(double));
} }
ttms.write(reinterpret_cast<char *>(&(sconf->radii_of_spheres[0])), sizeof(double)); ttms.write(reinterpret_cast<char *>(&(sconf->radii_of_spheres[0])), sizeof(double));
ttms.close(); ttms.close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment