Remaining update

This commit is contained in:
2024-09-19 13:12:09 +02:00
parent 1a1420890b
commit 85543dee11
40 changed files with 161 additions and 1023 deletions

View File

@@ -19,6 +19,25 @@
#define G(v, i, j, k) v[(k) * (imax + 2) * (jmax + 2) + (j) * (imax + 2) + (i)]
static FILE* initResidualWriter()
{
FILE* fp;
fp = fopen("residual.dat", "w");
if (fp == NULL) {
printf("Error!\n");
exit(EXIT_FAILURE);
}
return fp;
}
static void writeResidual(FILE* fp, double ts, double res)
{
fprintf(fp, "%f, %f\n", ts, res);
}
static void createBulkArrays(
Discretization* s, double* pg, double* ug, double* vg, double* wg)
{

View File

@@ -50,21 +50,3 @@ void stopProgress()
fflush(stdout);
}
FILE* initResidualWriter()
{
FILE* fp;
fp = fopen("residual.dat", "w");
if (fp == NULL) {
printf("Error!\n");
exit(EXIT_FAILURE);
}
return fp;
}
void writeResidual(FILE* fp, double ts, double res)
{
fprintf(fp, "%f, %f\n", ts, res);
}

View File

@@ -10,6 +10,5 @@
extern void initProgress(double);
extern void printProgress(double);
extern void stopProgress(void);
extern FILE* initResidualWriter(void);
extern void writeResidual(FILE*, double, double);
#endif

View File

@@ -112,7 +112,7 @@ static void setBoundaryCondition(double* p, int imax, int jmax, int kmax)
}
}
static double smooth(
static void smooth(
Solver* s, double* p, double* rhs, int level, int imax, int jmax, int kmax)
{
double eps = s->eps;