Fix BSSN-EM runtime crash

This commit is contained in:
2026-05-07 16:47:55 +08:00
parent 5525465cad
commit fea2dcc0d5
7 changed files with 103 additions and 98 deletions

View File

@@ -1,9 +1,10 @@
#ifdef newc
#include <sstream>
#include <cstdio>
#include <map>
using namespace std;
#include <sstream>
#include <cstdio>
#include <map>
#include <string>
using namespace std;
#else
#include <stdio.h>
#include <map.h>
@@ -3257,12 +3258,13 @@ void Z4c_class::Interp_Constraint()
}
}
ofstream outfile;
char filename[50];
sprintf(filename, "%s/interp_constraint_%05d.dat", ErrorMonitor->out_dir.c_str(), int(PhysTime / dT + 0.5));
// 0.5 for round off
outfile.open(filename);
ofstream outfile;
char suffix[64];
sprintf(suffix, "/interp_constraint_%05d.dat", int(PhysTime / dT + 0.5));
string filename = ErrorMonitor->out_dir + suffix;
// 0.5 for round off
outfile.open(filename.c_str());
outfile << "# corrdinate, H_Res, Px_Res, Py_Res, Pz_Res, Gx_Res, Gy_Res, Gz_Res, ...." << endl;
for (int i = 0; i < n; i++)
{