mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-20 02:55:47 +00:00
Fix to skip input particles already out of bounds
This commit is contained in:
parent
c5e2ee97fe
commit
a72bdf5463
@ -56,6 +56,8 @@ public:
|
||||
const PortalType& field,
|
||||
vtkm::Vec<FieldType, 3>& out) const
|
||||
{
|
||||
if (!bounds.Contains(pos))
|
||||
return ParticleStatus::EXITED_SPATIAL_BOUNDARY;
|
||||
vtkm::Vec<FieldType, 3> k1, k2, k3, k4;
|
||||
vtkm::Id numShortSteps = 0;
|
||||
bool shortSteps = false;
|
||||
@ -99,8 +101,8 @@ public:
|
||||
/*Calculate the velocity of the particle at current position*/
|
||||
f.Evaluate(out, field, k1);
|
||||
f.Evaluate(out + step_h_2 * k1, field, k2);
|
||||
f.Evaluate(out + step_h_2 * k2, field, k2);
|
||||
f.Evaluate(out + step_h * k3, field, k2);
|
||||
f.Evaluate(out + step_h_2 * k2, field, k3);
|
||||
f.Evaluate(out + step_h * k3, field, k4);
|
||||
vtkm::Vec<FieldType, 3> vel = (k1 + 2 * k2 + 2 * k3 + k4) / 6.0f;
|
||||
/*Get the direction of the particle*/
|
||||
FieldType magnitude = vtkm::Magnitude(vel);
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
ic.TakeStep(idx, p2, status);
|
||||
p = p2;
|
||||
}
|
||||
else
|
||||
else if (status == ParticleStatus::EXITED_SPATIAL_BOUNDARY)
|
||||
{
|
||||
ic.TakeStep(idx, p2, status);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user