EnhancedSolver port complete
This commit is contained in:
@@ -20,8 +20,10 @@ int main(int argc, char** argv)
|
||||
Parameter p;
|
||||
Discretization d;
|
||||
Solver s;
|
||||
|
||||
|
||||
initParameter(&p);
|
||||
FILE* fp;
|
||||
fp = initResidualWriter();
|
||||
|
||||
if (argc != 2) {
|
||||
printf("Usage: %s <configFile>\n", argv[0]);
|
||||
@@ -32,7 +34,7 @@ int main(int argc, char** argv)
|
||||
printParameter(&p);
|
||||
initDiscretization(&d, &p);
|
||||
initSolver(&s, &d, &p);
|
||||
|
||||
|
||||
#ifndef VERBOSE
|
||||
initProgress(d.te);
|
||||
#endif
|
||||
@@ -41,8 +43,9 @@ int main(int argc, char** argv)
|
||||
double te = d.te;
|
||||
double t = 0.0;
|
||||
int nt = 0;
|
||||
double res = 0.0;
|
||||
|
||||
timeStart = getTimeStamp();
|
||||
timeStart = getTimeStamp();
|
||||
while (t <= te) {
|
||||
if (tau > 0.0) computeTimestep(&d);
|
||||
setBoundaryConditions(&d);
|
||||
@@ -50,17 +53,21 @@ 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
|
||||
}
|
||||
fclose(fp);
|
||||
timeStop = getTimeStamp();
|
||||
stopProgress();
|
||||
printf("Solution took %.2fs\n", timeStop - timeStart);
|
||||
|
Reference in New Issue
Block a user