Hello everybody. I'm trying to create the structure describing particles with some positions and velocity. I'm doing the following:
#define SIZE 1000000
#define nx 1000
typedef struct Species{
double x[SIZE];
double y[SIZE];
double vx[SIZE];
double vy[SIZE];
double vz[SIZE];
double dens[nx];
double charge;
double mass;
long int num; double QtoM;
double sw; char *bc_l;
char *bc_r;
} species;
What I have tried:
I fill all arrays within the main function. When I compile the code, I don't see any warning or error message. But, when I run it, I see the message "stack overflow". As I understand correctly, the problem is with SIZE=1000000 because the code runs when I use SIZE=10000. Can anybody help me with this?
Thanks.May be, I should change my approach?