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

@@ -17,6 +17,24 @@
#include "timing.h"
#include "vtkWriter.h"
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);
}
int main(int argc, char** argv)
{
double timeStart, timeStop;
@@ -46,7 +64,6 @@ int main(int argc, char** argv)
initSolver(&s, &d, &p);
initParticleTracer(&particletracer, &p, &d);
#ifndef VERBOSE
initProgress(d.te);
#endif

View File

@@ -49,17 +49,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

@@ -12,6 +12,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

@@ -172,7 +172,7 @@ static void setBoundaryCondition(
#endif
}
static double smooth(Solver* s, double* p, double* rhs, int level, Comm* comm)
static void smooth(Solver* s, double* p, double* rhs, int level, Comm* comm)
{
int imaxLocal = comm->imaxLocal;
int jmaxLocal = comm->jmaxLocal;
@@ -316,6 +316,8 @@ static double multiGrid(Solver* s, double* p, double* rhs, int level, Comm* comm
// restrict
restrictMG(s, level, comm);
// Create a new comm object withupdated imaxLocal and jmaxLocal
// along with their updated bufferTypes, sdispls, rdispls
Comm newcomm;
commUpdateDatatypes(s->comm, &newcomm, imaxLocal, jmaxLocal, kmaxLocal);