/* * Copyright (C) 2022 NHR@FAU, University Erlangen-Nuremberg. * All rights reserved. This file is part of nusif-solver. * Use of this source code is governed by a MIT style * license that can be found in the LICENSE file. */ #ifndef __PARTICLETRACING_H_ #define __PARTICLETRACING_H_ #include "allocate.h" #include "parameter.h" #include "solver.h" #include "particletracing.h" #include #include #define NDIMS 2 typedef enum COORD { X = 0, Y, NCOORD } COORD; typedef struct { double x, y; bool flag; } Particle; typedef struct { int numberOfParticles, totalParticles; double startTime, injectTimePeriod, writeTimePeriod, lastInjectTime, lastUpdateTime, lastWriteTime; int estimatedNumParticles; double dx, dy, dt; Particle* linSpaceLine; Particle* particlePool; int pointer; double imax, jmax, xlength, ylength, imaxLocal, jmaxLocal; double x1, y1, x2, y2; MPI_Comm comm; MPI_Datatype mpi_particle; int rank, size; int iNeighbours[NDIMS], jNeighbours[NDIMS]; int coords[NDIMS], dims[NDIMS]; double xLocal, yLocal, xOffset, yOffset, xOffsetEnd, yOffsetEnd; double* offset; } ParticleTracer; void initParticleTracer(ParticleTracer*, Parameter*, Solver* ); void injectParticles(ParticleTracer*); void advanceParticles(ParticleTracer*, double* , double*, double); void freeParticles(ParticleTracer*); void writeParticles(ParticleTracer*); void printParticleTracerParameters(ParticleTracer*); void printParticles(ParticleTracer*); void trace(ParticleTracer*, double* , double* , double ); void compress(ParticleTracer* ); #endif