Commit 272ff48b authored by Abhishek Yenpure's avatar Abhishek Yenpure
Browse files

Adding updates

parent 587cb341
......@@ -100,6 +100,7 @@ public:
, Time(time)
{
this->Direction = 1;
this->DirChanged = false;
}
VTKM_EXEC_CONT
......@@ -108,6 +109,7 @@ public:
, ID(p.ID)
, NumSteps(p.NumSteps)
, Direction(p.Direction)
, DirChanged(p.DirChanged)
, Status(p.Status)
, Time(p.Time)
{
......@@ -149,6 +151,7 @@ public:
vtkm::Id ID = -1;
vtkm::Id NumSteps = 0;
vtkm::Id Direction = 1;
bool DirChanged = 0;
vtkm::ParticleStatus Status;
vtkm::FloatDefault Time = 0;
};
......
......@@ -62,6 +62,7 @@ public:
newParticle.Pos = pt;
newParticle.Time = time;
newParticle.NumSteps++;
newParticle.DirChanged = false;
this->Particles.Set(idx, newParticle);
}
......
......@@ -36,17 +36,19 @@ public:
/// -- Check if the particle is out of spatial boundaries
/// -- Check if the particle has reached the maximum number of steps
/// -- Check if the particle is in a zero velocity region
auto& status = particle.Status;
auto& status = particle.Status;
auto& changed = particle.DirChanged;
if(particle.NumSteps == this->MaxSteps)
{
status.SetTerminate();
}
if(this->ReverseDirection && (status.CheckSpatialBounds() || status.CheckTemporalBounds()))
if(!changed && this->ReverseDirection && (status.CheckSpatialBounds() || status.CheckTemporalBounds()))
{
status.SetOk();
status.ClearSpatialBounds();
status.ClearTemporalBounds();
particle.Direction *= -1;
particle.DirChanged = true;
}
bool terminate = status.CheckOk()
&& !status.CheckTerminate()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment