EnhancedSolver port complete

This commit is contained in:
2024-07-27 02:19:56 +02:00
parent 8091c714e2
commit d81313f293
199 changed files with 16030 additions and 310 deletions

View File

@@ -73,6 +73,9 @@ int main(int argc, char** argv)
Solver s;
initParameter(&p);
FILE* fp;
fp = initResidualWriter();
if (argc != 2) {
printf("Usage: %s <configFile>\n", argv[0]);
exit(EXIT_SUCCESS);
@@ -90,6 +93,7 @@ int main(int argc, char** argv)
double te = d.te;
double t = 0.0;
int nt = 0;
double res = 0.0;
timeStart = getTimeStamp();
while (t <= te) {
@@ -99,13 +103,16 @@ int main(int argc, char** argv)
computeFG(&d);
computeRHS(&d);
if (nt % 100 == 0) normalizePressure(&d);
solve(&s, d.p, d.rhs);
res = solve(&s, d.p, d.rhs);
adaptUV(&d);
writeResidual(fp, t, res);
t += d.dt;
nt++;
#ifdef VERBOSE
printf("TIME %f , TIMESTEP %f\n", t, solver.dt);
printf("TIME %f , TIMESTEP %f\n", t, d.dt);
#else
printProgress(t);
#endif
@@ -123,7 +130,8 @@ int main(int argc, char** argv)
ug = allocate(64, bytesize);
vg = allocate(64, bytesize);
wg = allocate(64, bytesize);
fclose(fp);
createBulkArrays(&d, pg, ug, vg, wg);
VtkOptions opts = { .grid = d.grid };
vtkOpen(&opts, d.problem);