diff --git a/data/magField.vtk b/data/magField.vtk new file mode 100644 index 000000000..a79db3589 --- /dev/null +++ b/data/magField.vtk @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b947d66dbae99a1ebb392b200a9ea0d380cfccb7fcb3a3739615d0dde558d2f1 +size 238166 diff --git a/examples/particle_advection/ParticleAdvection.cxx b/examples/particle_advection/ParticleAdvection.cxx index 3f396bacb..61dd633fc 100644 --- a/examples/particle_advection/ParticleAdvection.cxx +++ b/examples/particle_advection/ParticleAdvection.cxx @@ -10,10 +10,17 @@ #include #include -#include #include #include +// Example computing streamlines. +// An example vector field is available in the vtk-m data directory: magField.vtk +// Example usage: +// this will advect 200 particles 50 steps using a step size of 0.01 +// +// Particle_Advection /magField.vtk vec 200 50 0.01 output.vtk +// + int main(int argc, char** argv) { if (argc != 7) @@ -32,12 +39,7 @@ int main(int argc, char** argv) vtkm::cont::DataSet ds; - if (dataFile.find(".bov") != std::string::npos) - { - vtkm::io::reader::BOVDataSetReader rdr(dataFile); - ds = rdr.ReadDataSet(); - } - else if (dataFile.find(".vtk") != std::string::npos) + if (dataFile.find(".vtk") != std::string::npos) { vtkm::io::reader::VTKDataSetReader rdr(dataFile); ds = rdr.ReadDataSet(); @@ -48,7 +50,7 @@ int main(int argc, char** argv) return -1; } - //create seeds + //create seeds randomly placed withing the bounding box of the data. vtkm::Bounds bounds = ds.GetCoordinateSystem().GetBounds(); std::vector seeds;