From 519844782093b426415efa06e6ce909cb9f197db Mon Sep 17 00:00:00 2001 From: Sudhanshu Sane Date: Tue, 12 May 2020 11:18:33 -0700 Subject: [PATCH 1/2] Fix order of initialized seeds to match output format --- vtkm/filter/Lagrangian.hxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vtkm/filter/Lagrangian.hxx b/vtkm/filter/Lagrangian.hxx index f33d1ea61..993240726 100644 --- a/vtkm/filter/Lagrangian.hxx +++ b/vtkm/filter/Lagrangian.hxx @@ -184,15 +184,15 @@ inline void Lagrangian::InitializeSeedPositions(const vtkm::cont::DataSet& input auto portal2 = BasisParticlesValidity.WritePortal(); vtkm::Id count = 0, id = 0; - for (int x = 0; x < this->SeedRes[0]; x++) + for (int z = 0; z < this->SeedRes[2]; z++) { - vtkm::FloatDefault xi = static_cast(x * x_spacing); + vtkm::FloatDefault zi = static_cast(z * z_spacing); for (int y = 0; y < this->SeedRes[1]; y++) { vtkm::FloatDefault yi = static_cast(y * y_spacing); - for (int z = 0; z < this->SeedRes[2]; z++) + for (int x = 0; x < this->SeedRes[0]; x++) { - vtkm::FloatDefault zi = static_cast(z * z_spacing); + vtkm::FloatDefault xi = static_cast(x * x_spacing); portal1.Set(count, vtkm::Particle(Vec3f(static_cast(bounds.X.Min) + xi, static_cast(bounds.Y.Min) + yi, From 10dc96cb870dbe621c1767f874c60b33ea8ab8f5 Mon Sep 17 00:00:00 2001 From: Sudhanshu Sane Date: Wed, 20 May 2020 10:30:16 -0700 Subject: [PATCH 2/2] Remove extra count variable --- vtkm/filter/Lagrangian.hxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vtkm/filter/Lagrangian.hxx b/vtkm/filter/Lagrangian.hxx index 993240726..f1fe23d17 100644 --- a/vtkm/filter/Lagrangian.hxx +++ b/vtkm/filter/Lagrangian.hxx @@ -183,7 +183,7 @@ inline void Lagrangian::InitializeSeedPositions(const vtkm::cont::DataSet& input auto portal1 = BasisParticles.WritePortal(); auto portal2 = BasisParticlesValidity.WritePortal(); - vtkm::Id count = 0, id = 0; + vtkm::Id id = 0; for (int z = 0; z < this->SeedRes[2]; z++) { vtkm::FloatDefault zi = static_cast(z * z_spacing); @@ -193,13 +193,12 @@ inline void Lagrangian::InitializeSeedPositions(const vtkm::cont::DataSet& input for (int x = 0; x < this->SeedRes[0]; x++) { vtkm::FloatDefault xi = static_cast(x * x_spacing); - portal1.Set(count, + portal1.Set(id, vtkm::Particle(Vec3f(static_cast(bounds.X.Min) + xi, static_cast(bounds.Y.Min) + yi, static_cast(bounds.Z.Min) + zi), id)); - portal2.Set(count, 1); - count++; + portal2.Set(id, 1); id++; } }