Classes: adding a new variable produces errors
Hi all,
I have a class inside a program and at the moment it works fine. But when I add one more variable to it - then I run into the errors in the program - it actually runs, but all the other variables have some random number. I guess I run into some memory issues.
So here is my class:
Code:
class plasma_class
{
public:
float PeakDensity;
short DensityProfileX;
short DensityProfileY;
short NumberOfSpecies;
double RoughnessAmplitude;
double RoughnessPeriod;
//double FrontPreplasmaLength;
//double RearPreplasmaLength;
struct specie_class
{
int ParticlesPerCellX;
int ParticlesPerCellY;
int Charge;
double Mass;
double ReciprocalMass;
int NumberOfParticles;
int CellsPlasmaX;
int CellsPlasmaY;
double StartX;
double EndX;
double StartY;
double EndY;
double PeakCharge;
struct particle_class
{
//public:
double x;
double y;
double p_x;
double p_y;
double p_z;
//double ExParticle;
//double EyParticle;
//double BzParticle;
double q;
short InsideVolumeFlag;
};
std::vector<particle_class> particle;
};
std::vector<specie_class> specie;
plasma_class(const char *, simulation_class simulation);
void move(simulation_class simulation, fields_class &fields, int TimeStep);
};
Problems start when I uncomment for example FrontPreplasmaLength. Could anybody help me understand all this stuff and resolve the problem
Thanks in advance