Skip to content

Commit

Permalink
Less layering of particles in fusion
Browse files Browse the repository at this point in the history
Fixes http://tpt.io/~1683916 - PLSM was created on top of DMND, which other particles then displaced, leading to lots of stacking and particles escaping through the DMND.
  • Loading branch information
jacksonmj committed Nov 30, 2014
1 parent 70a815a commit e25fac5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/simulation/elements/CO2.cpp
Expand Up @@ -92,12 +92,12 @@ int Element_CO2::update(UPDATE_FUNC_ARGS)
{
int j;
sim->create_part(i,x,y,PT_O2);
j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NEUT);
j = sim->create_part(-3,x,y,PT_NEUT);
if (j != -1)
parts[j].temp = MAX_TEMP;
if (!(rand()%50))
{
j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_ELEC);
j = sim->create_part(-3,x,y,PT_ELEC);
if (j != -1)
parts[j].temp = MAX_TEMP;
}
Expand Down
8 changes: 4 additions & 4 deletions src/simulation/elements/H2.cpp
Expand Up @@ -101,23 +101,23 @@ int Element_H2::update(UPDATE_FUNC_ARGS)
sim->create_part(i,x,y,PT_NBLE);
parts[i].tmp = 0x1;

j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NEUT);
j = sim->create_part(-3,x,y,PT_NEUT);
if (j>-1)
parts[j].temp = temp;
if (!(rand()%10))
{
j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_ELEC);
j = sim->create_part(-3,x,y,PT_ELEC);
if (j>-1)
parts[j].temp = temp;
}
j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_PHOT);
j = sim->create_part(-3,x,y,PT_PHOT);
if (j>-1)
{
parts[j].ctype = 0x7C0000;
parts[j].temp = temp;
parts[j].tmp = 0x1;
}
j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_PLSM);
j = sim->create_part(-1,x+rand()%3-1,y+rand()%3-1,PT_PLSM);
if (j>-1)
{
parts[j].temp = temp;
Expand Down
8 changes: 4 additions & 4 deletions src/simulation/elements/NBLE.cpp
Expand Up @@ -58,23 +58,23 @@ int Element_NBLE::update(UPDATE_FUNC_ARGS)
float temp = parts[i].temp;
sim->create_part(i,x,y,PT_CO2);

j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NEUT);
j = sim->create_part(-3,x,y,PT_NEUT);
if (j != -1)
parts[j].temp = temp;
if (!(rand()%25))
{
j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_ELEC);
j = sim->create_part(-3,x,y,PT_ELEC);
if (j != -1)
parts[j].temp = temp;
}
j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_PHOT);
j = sim->create_part(-3,x,y,PT_PHOT);
if (j != -1)
{
parts[j].ctype = 0xF800000;
parts[j].temp = temp;
parts[j].tmp = 0x1;
}
j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_PLSM);
j = sim->create_part(-1,x+rand()%3-1,y+rand()%3-1,PT_PLSM);
if (j != -1)
{
parts[j].temp = temp;
Expand Down
6 changes: 3 additions & 3 deletions src/simulation/elements/O2.cpp
Expand Up @@ -83,16 +83,16 @@ int Element_O2::update(UPDATE_FUNC_ARGS)
int j;
sim->create_part(i,x,y,PT_BRMT);

j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NEUT);
j = sim->create_part(-3,x,y,PT_NEUT);
if (j != -1)
parts[j].temp = MAX_TEMP;
j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_PHOT);
j = sim->create_part(-3,x,y,PT_PHOT);
if (j != -1)
{
parts[j].temp = MAX_TEMP;
parts[j].tmp = 0x1;
}
j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_PLSM);
j = sim->create_part(-1,x+rand()%3-1,y+rand()%3-1,PT_PLSM);
if (j != -1)
{
parts[j].temp = MAX_TEMP;
Expand Down

0 comments on commit e25fac5

Please sign in to comment.