Particle Tracer work in progress

This commit is contained in:
2023-08-05 19:35:16 +02:00
parent b50dbe7d4b
commit 7b83a34e47
46 changed files with 60399 additions and 23269 deletions

View File

@@ -178,7 +178,7 @@ void solve(Solver* solver)
it++;
}
#ifdef VERBOSE
#ifndef VERBOSE
printf("Solver took %d iterations to reach %f\n", it, sqrt(res));
#endif
}

View File

@@ -77,7 +77,6 @@ static void advanceParticles(
double yn = y + delt * vn;
m[particleId * NCOORD + Y] = yn;
printf("P%i VEL %f %f dt %f OP %f %f NP %f %f\n", i, un, vn, delt, x, y, xn, yn);
}
double xlength = t->grid.xlength;
@@ -107,7 +106,6 @@ static void injectParticles(Tracing* t)
double* m = t->memorypool;
for (int i = 0; i < t->numParticles; i++) {
printf("Inject %d as %d mem %d\n", i, t->totalParticles, t->cursor);
t->particles[t->totalParticles] = t->cursor;
m[(t->cursor) * NCOORD + X] = line[i * NCOORD + X];
m[(t->cursor) * NCOORD + Y] = line[i * NCOORD + Y];
@@ -145,14 +143,11 @@ void trace(Tracing* t, double* restrict u, double* restrict v, double time)
{
if (time >= t->traceStart) {
if ((time - t->lastUpdate[INJECT]) > t->traceInject) {
printf("Inject at %f\n", time);
printState(t);
injectParticles(t);
t->lastUpdate[INJECT] = time;
}
if ((time - t->lastUpdate[WRITE]) > t->traceWrite) {
printf("Write at %f\n", time);
writeParticles(t);
t->lastUpdate[WRITE] = time;
}
@@ -199,7 +194,7 @@ void initTrace(Tracing* t, Parameter* p)
double x = spacing * x1 + (1.0 - spacing) * x2;
double y = spacing * y1 + (1.0 - spacing) * y2;
printf("S: %f x: %f y: %f\n", spacing, x, y);
//printf("S: %f x: %f y: %f\n", spacing, x, y);
line[i * NCOORD + X] = x;
line[i * NCOORD + Y] = y;
}