Commit Graph

917 Commits

Author SHA1 Message Date
Robert Maynard
769d6468fd Correct a mistake where the kokkos MR merged disabled worklet tests 2020-08-26 13:19:49 -04:00
Kenneth Moreland
571aa9f3d7 Simplify getting test file names
The testing helper class provided a method named `GetTestDataBasePath`
that returned the base path to all the data files stored in the VTK-m
repo. This is fine, but it was a little cumbersome to build filenames.

To make things easier, there is now a new method named `DataPath` that
takes a string of the filename (or, rather, subpath) to the file in that
directory and automatically builds the path to it.
2020-08-25 06:17:59 -06:00
Kitware Robot
cf0cdcf7d1 clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
Nick
024ab1cff8 Put each ODE integrator in it's own file. 2020-08-18 15:32:39 -04:00
Sujin Philip
452f61e290 Add Kokkos backend 2020-08-12 13:55:24 -04:00
Kenneth Moreland
2163077441 Fix errors with memory access 2020-07-23 11:02:40 -06:00
Kenneth Moreland
d1a4aecc59 Improvements to moving data into ArrayHandle
We have made several improvements to adding data into an `ArrayHandle`.

## Moving data from an `std::vector`

For numerous reasons, it is convenient to define data in a `std::vector`
and then wrap that into an `ArrayHandle`. It is often the case that an
`std::vector` is filled and then becomes unused once it is converted to an
`ArrayHandle`. In this case, what we really want is to pass the data off to
the `ArrayHandle` so that the `ArrayHandle` is now managing the data and
not the `std::vector`.

C++11 has a mechanism to do this: move semantics. You can now pass
variables to functions as an "rvalue" (right-hand value). When something is
passed as an rvalue, it can pull state out of that variable and move it
somewhere else. `std::vector` implements this movement so that an rvalue
can be moved to another `std::vector` without actually copying the data.
`make_ArrayHandle` now also takes advantage of this feature to move rvalue
`std::vector`s.

There is a special form of `make_ArrayHandle` named `make_ArrayHandleMove`
that takes an rvalue. There is also a special overload of
`make_ArrayHandle` itself that handles an rvalue `vector`. (However, using
the explicit move version is better if you want to make sure the data is
actually moved.)

## Make `ArrayHandle` from initalizer list

A common use case for using `std::vector` (particularly in our unit tests)
is to quickly add an initalizer list into an `ArrayHandle`. Now you can
by simply passing an initializer list to `make_ArrayHandle`.

## Deprecated `make_ArrayHandle` with default shallow copy

For historical reasons, passing an `std::vector` or a pointer to
`make_ArrayHandle` does a shallow copy (i.e. `CopyFlag` defaults to `Off`).
Although more efficient, this mode is inherintly unsafe, and making it the
default is asking for trouble.

To combat this, calling `make_ArrayHandle` without a copy flag is
deprecated. In this way, if you wish to do the faster but more unsafe
creation of an `ArrayHandle` you should explicitly express that.

This requried quite a few changes through the VTK-m source (particularly in
the tests).

## Similar changes to `Field`

`vtkm::cont::Field` has a `make_Field` helper function that is similar to
`make_ArrayHandle`. It also features the ability to create fields from
`std::vector`s and C arrays. It also likewise had the same unsafe behavior
by default of not copying from the source of the arrays.

That behavior has similarly been depreciated. You now have to specify a
copy flag.

The ability to construct a `Field` from an initializer list of values has
also been added.
2020-07-23 10:53:38 -06:00
Li-Ta Lo
537557ef91 Merge topic 'worket_invoker_dispatcher2'
0dcc6cc16 reverse #include on CellNeighborhood
2489da125 restore comment, add needed #include
f33318247 Reverse Invoker, Dispatcher and Worklet dependency

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2192
2020-07-22 14:20:35 -04:00
dpugmire
e60d899536 Use the ResetTypes spell to fix the ArrayCopy issue. 2020-07-22 12:03:11 -04:00
dpugmire
0a4d184205 fix compile error in array copy 2020-07-22 09:59:20 -04:00
Li-Ta Lo
f333182476 Reverse Invoker, Dispatcher and Worklet dependency 2020-07-21 17:25:43 -06:00
dpugmire
415e2a5ac8 Fix to deal with float data when double enabled. 2020-07-21 15:00:47 -04:00
dpugmire
5ad32f4860 enable reading data files. 2020-07-21 11:23:58 -04:00
dpugmire
31c97bed89 Generalize fields for particle advection 2020-07-20 21:15:46 -04:00
Kenneth Moreland
f6b13df513 Support coordinates of both float32 and float64
Previously there were issues if the coordinate system was using floating
point values that were not FloatDefault. This remedies that issue.
2020-07-14 08:53:01 -06:00
Kenneth Moreland
be7f06bbe7 CoordinateSystem data is VariantArrayHandle
`CoordinateSystem` differed from `Field` in that its `GetData`
method returned an `ArrayHandleVirtualCoordinates` instead of
a `VariantArrayHandle`. This is probably confusing since
`CoordianteSystem` inherits `Field` and has a pretty dramatic
difference in this behavior.

In preparation to deprecate `ArrayHandleVirtualCoordinates`, this
changes `CoordiantSystem` to be much more like `Field`. (In the
future, we may change the `CoordinateSystem` to point to a `Field`
rather than be a special `Field`.)

A method named `GetDataAsMultiplexer` has been added to
`CoordinateSystem`. This method allows you to get data from
`CoordinateSystem` as a single array type without worrying
about creating functors to handle different types and without
needing virtual methods.
2020-07-14 08:50:39 -06:00
Kenneth Moreland
31feaed0f8 Merge topic 'fix-warnings'
0a4317709 Fix issues of calling __host__ from __device__
dd4d88cd5 Fix warnings about comparing floating point values
cd4b59059 Fix warnings about data type conversion

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2146
2020-06-17 17:23:07 -04:00
Kenneth Moreland
dd4d88cd5e Fix warnings about comparing floating point values 2020-06-17 11:58:45 -06:00
Kenneth Moreland
cd4b59059e Fix warnings about data type conversion 2020-06-17 10:29:08 -06:00
dpugmire
4744730630 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into betterParticleAdvectionDiffs2 2020-06-17 11:12:11 -04:00
Li-Ta Lo
df08816317 minor coding style improvment 2020-06-16 13:01:08 -06:00
Li-Ta Lo
ba35520b1c use condition number for error tolerance 2020-06-16 10:56:17 -06:00
Li-Ta Lo
ee422b7f27 move data member initialization to constructors 2020-06-16 10:25:16 -06:00
Li-Ta Lo
c25f0b4bb8 Rename StatisticalMoments. more unit tests
Change StatisticalMoments to the more descriptive DescriptiveStatistics,
add some more property based tests.
2020-06-15 14:24:00 -06:00
dpugmire
cff830fb4c Remove some debugging code. 2020-06-15 14:23:52 -04:00
dpugmire
ee41466673 Accidently added some garbage numbers to line 35. Removed it. 2020-06-15 14:01:12 -04:00
dpugmire
bece39ec44 Fix compiler warnings. 2020-06-15 13:27:01 -04:00
NAThompson
755137a822 Particle advection tests with file. 2020-06-13 10:58:45 -04:00
Li-Ta Lo
5eeeb47914 Change StatState's API to better conform to VTKm's coding standard 2020-06-12 21:41:31 -06:00
Li-Ta Lo
794db28ad6 Merge branch 'master' into stats_by_key 2020-06-11 23:12:07 -06:00
Li-Ta Lo
964c1a778b Reversion to the Mean
Change the formula for calculating Mean to be exactly as is in the
literature. My own invention actually causes more numeric error.
2020-06-11 22:47:24 -06:00
Li-Ta Lo
8e6fb01d02 Merge branch 'stats_by_key' of gitlab.kitware.com:ollielo/vtk-m into stats_by_key 2020-06-10 13:40:55 -06:00
Li-Ta Lo
6bc6a7ef50 widen error tolerance for variance test 2020-06-10 08:30:41 -06:00
Li-Ta Lo
0cf611e3b7 Add ByKey version 2020-06-09 14:13:07 -06:00
Li-Ta Lo
c9da2a9c06 add unit test on the property of variance 2020-06-08 10:22:24 -06:00
Li-Ta Lo
63232e0eed add reference to the algorithm and a unit test on normal RN 2020-06-08 09:20:25 -06:00
Robert Maynard
748f8f8c30 Correct flying edge cell-id mapping 2020-06-08 10:01:04 -04:00
Li-Ta Lo
807a0a9dea add newline 2020-06-05 16:18:19 -06:00
Li-Ta Lo
991e7eac2a United We Stand
Implemented a one-pass, Divide and Conqur algorithm to calculate various statistical
moments. Only one call to Reduce is needed.
2020-06-05 16:09:10 -06:00
Kenneth Moreland
7be44c847f Enable setting invalid value in probe filter
Initially, the probe filter would simply not set a value if a sample was
outside the input `DataSet`. This is not great as the memory could be
left uninitalized and lead to unpredictable results. The testing
compared these invalid results to 0, which seemed to work but is
probably unstable.

This was partially fixed by a previous change that consolidated to
mapping of cell data with a general routine that permuted data. However,
the fix did not extend to point data in the input, and it was not
possible to specify a particular invalid value.

This change specifically updates the probe filter so that invalid values
are set to a user-specified value.
2020-06-03 15:29:37 -06:00
Abhishek Yenpure
8260be6fc6 Merge topic 'euler_integrator_fix'
e9fd545b0 Merge branch 'master' of gitlab.kitware.com:vtk/vtk-m into euler_integrator_fix
23126bbec Integrator status fix for consistant behavior
3e18f105e Fixing Integrator Status Behavior
ff112e424 Integrator status behavior check
343f2d577 Merge branch 'master' of gitlab.kitware.com:vtk/vtk-m into euler_integrator_fix
82cfba27c Rectify testing code
8ddecbb43 Fixing test issues
6274b1657 Updating Euler Integrator to work

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2023
2020-06-01 17:20:16 -04:00
NAThompson
fe4f71ab92 Deprecate DataSetFieldAdd. 2020-05-27 15:27:47 -04:00
Abhishek Yenpure
e9fd545b06 Merge branch 'master' of gitlab.kitware.com:vtk/vtk-m into euler_integrator_fix 2020-05-27 10:55:49 -07:00
Abhishek Yenpure
23126bbec5 Integrator status fix for consistant behavior
- Return OK and spatial bits set when particle is out of bounds
- Changes done after discussion w/ Dave
2020-05-23 21:37:25 -07:00
Robert Maynard
251bd82b80 Significantly improve FlyingEdges performance across all devices
We now use SumYAxis when executing with CUDA for better memory patterns.
Instead of using the heavy Pass4/Pass4WithNormals, CUDA now uses a
2 pass approach with the second pass outputting the normals and
coordinates using with significantly less warp divergence
2020-05-22 15:53:49 -04:00
Kenneth Moreland
b1f288aaea Add non-templated base class to Keys class.
The only reason Keys has a template is so that it can hold a UniqueKeys
array and provide the key for each group. If that is not needed and you
want to implement a library function that takes a keys object, you can
now grab the Keys superclass KeysBase. KeysBase is not templated, so you
can pass it to a standard method in a library.
2020-05-21 08:34:07 -06:00
Kenneth Moreland
72cd0107ee Deprecate Execute with policy
The version of `Filter::Execute` that takes a policy as an argument is now
deprecated. Filters are now able to specify their own fields and types,
which is often why you want to customize the policy for an execution. The
other reason is that you are compiling VTK-m into some other source that
uses a particular types of storage. However, there is now a mechanism in
the CMake configuration to allow you to provide a header that customizes
the "default" types used in filters. This is a much more convenient way to
compile filters for specific types.

One thing that filters were not able to do was to customize what cell sets
they allowed using. This allows filters to self-select what types of cell
sets they support (beyond simply just structured or unstructured). To
support this, the lists `SupportedCellSets`, `SupportedStructuredCellSets`,
and `SupportedUnstructuredCellSets` have been added to `Filter`. When you
apply a policy to a cell set, you now have to also provide the filter.
2020-05-18 12:38:41 -06:00
Abhishek Yenpure
ff112e4244 Integrator status behavior check 2020-05-12 17:00:52 -07:00
NAThompson
d961c185ac Deprecate ReadPortal().Get pattern. 2020-05-12 15:43:40 -04:00
Abhishek Yenpure
343f2d5773 Merge branch 'master' of gitlab.kitware.com:vtk/vtk-m into euler_integrator_fix 2020-05-12 11:35:53 -07:00