Skip to content
Snippets Groups Projects
Commit 7e3ebdc1 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

particle code compiles, but not finished

parent a3dc03cd
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,8 @@ base_files := \
p3DFFT_to_iR \
vector_field \
fluid_solver_base \
fluid_solver
fluid_solver \
slab_field_particles
#headers := $(patsubst %, ./src/%.hpp, ${base_files})
src := $(patsubst %, ./src/%.cpp, ${base_files})
......
......@@ -31,6 +31,11 @@ static const int message_buffer_length = 1024;
static char debug_message_buffer[message_buffer_length];
extern int myrank, nprocs;
int MOD(int a, int n)
{
return ((a%n) + n) % n;
}
#ifndef NDEBUG
inline void DEBUG_MSG(const char * format, ...)
......
......@@ -18,6 +18,8 @@
*
************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
......@@ -35,7 +37,6 @@ class slab_field_particles
{
public:
fluid_solver_base<rnumber> *fs;
int nparticles;
/* is_active is a matrix of shape [nprocs][nparticles], with
* is_active[r][p] being true if particle p is in the domain
......@@ -48,11 +49,17 @@ class slab_field_particles
* a general ncomponents is better, since we may change our minds.
* */
double *state;
int nparticles;
int ncomponents;
int array_size;
int buffer_size;
double *lbound;
double *ubound;
/* simulation parameters */
char name[256];
int iteration;
double dt;
/* physical parameters of field */
rnumber dx, dy, dz;
......@@ -60,8 +67,20 @@ class slab_field_particles
/* methods */
slab_field_particles(
const char *NAME,
fluid_solver_base<rnumber> *FSOLVER);
fluid_solver_base<rnumber> *FSOLVER,
const int NPARTICLES,
const int NCOMPONENTS,
const int BUFFERSIZE);
~slab_field_particles();
/* an Euler step is needed to compute an estimate of future positions,
* which is needed for synchronization.
* function is virtual since we want children to do different things,
* depending on the type of particle. this particular function just
* copies the old state into the new state.
* */
virtual void jump_estimate(double *jump_length);
void synchronize();
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment