Commit Graph

73 Commits

Author SHA1 Message Date
Dave Pugmire
596ec20e90 Change particle type in examples 2020-08-26 09:36:09 -04: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
dpugmire
5fc822082e replace vtkm::Particle with vtkm::Massless 2020-07-21 11:14:31 -04:00
Kenneth Moreland
0612be9c5b Move VTKDataSetReaderBase code to vtkm_io
Most of this code is not templated methods. Rather, it implements over
several types to call templated functions, which creates quite a bit of
code. Rather than have all code using a reader recompile the code, just
compile it once and put it in a library.
2020-05-19 12:27:01 -06:00
NAThompson
697369fc14 Remove deprecation warnings throughout the project. 2020-04-30 08:12:04 -04:00
Sujin Philip
c102ea556c Update cmake minimum required version to 3.12 2020-04-13 12:42:28 -05:00
dpugmire
c5f9b9b20f Fix to examples to use vtkm::Particle 2019-12-19 09:56:05 -05:00
Dave Pugmire
e2ae2d74af Print optional agruments in usage information. 2019-10-08 10:22:29 -04:00
Dave Pugmire
05a37b88b4 Add device options to particle advection example. 2019-10-07 16:49:13 -04:00
Robert Maynard
1bfcce19dd VTK-m builds with separate function sections to allow smaller binaries
Consumers of VTK-m when enabling of dropping of unused functions
will see VTK-m functions dropped. Previously this didn't happen
as VTK-m didn't build object files with the correct flags for this.

By allowing the linker to remove unused symbols we see a significant
saving the file size of VTK-m tests, examples, and benchmarks.
An OpenMP build of the tests and benchmarks goes from 168MB to
141MB which is roughly a 16% filesize reduction.

Initially I had presumed that these changes would increase link times.
But in measurements the total wall time for compilation of VTK-m has
stayed about the same ( seeing a decrease of 1.5% ). Presumably the
increased computation is offset by the reduction in file writing.
2019-09-11 13:34:25 -04:00
Dave Pugmire
e34639818c Add example data file. 2019-08-28 11:14:30 -04:00
Dave Pugmire
cbc6e2e7c6 don't need know the pos in string::find. 2019-08-28 07:54:10 -04:00
Dave Pugmire
c56e53b6c4 Simplify particle advection example 2019-08-28 07:48:20 -04:00
Robert Maynard
267f963d32 Opt into all CMake 3.15 policies 2019-08-20 15:38:27 -04:00
Robert Maynard
28484fc6aa Update examples and benchmarks to use new VTK-m CMake helper function 2019-07-09 13:32:23 -04:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Robert Maynard
ff30684c8e Removes the default device macros from VTK-m
Fixes #116
2019-04-15 08:15:36 -04:00
Robert Maynard
0ce7e82d43 VTK-m now enables all new CMake policies in 3.14
This means that we opt-in to policy changes introduced in 3.14
2019-03-26 11:50:06 -04:00
Kenneth Moreland
fd794edb36 Fix particle advection example
The grid evaluator class structure changed.
2019-03-21 13:58:42 -06:00
Kenneth Moreland
887f79c6f4 Make a vtkm_worklet library
This is a library that contains parts of worklets that can be
precompiled into a library.

Currently, this library contains the implementation of ScatterCounting.
2019-01-23 17:09:15 -07:00
Robert Maynard
f1e1a524e9 Require CMake 3.8 to build VTK-m. 2019-01-09 16:01:22 -05:00
Kenneth Moreland
bddad9b386 Remove TryExecute from filters
Now that the dispatcher does its own TryExecute, filters do not need to
do that. This change requires all worklets called by filters to be able
to execute without knowing the device a priori.
2018-10-16 15:59:53 -06:00
Kenneth Moreland
723792a482 Use new integrators and evaluators for advection 2018-10-16 09:53:18 -06:00
Kenneth Moreland
a2602183a4 Make integrators have a virtual superclass
This will make it easier to support integrators as an ExecObject.

One side effect is that the integrators and partical advection
are not templated by the type of the field.
Regardless of the type of the field, there is probably little reason to
compute particle advection with less than 64 bit floats to account for
accumulated errors. This will make it easier to use these classes.
2018-10-16 09:53:18 -06:00
Robert Maynard
9861cdecb1 Use CMake to automatically set policies to NEW.
CMake 3.12 introduces a ...<max> syntax in the version given to
cmake_minimum_required to automatically set policies to NEW up
to that version. Use it to avoid listing policies explicitly.
2018-06-19 16:12:48 -04:00
Robert Maynard
5a2c2b9460 temporaladvection example follows the same naming pattern as all examples 2018-06-01 10:31:14 -04:00
Robert Maynard
b10e50860f Update all the examples to the new CMake code. 2018-01-08 14:00:57 -05:00
Allison Vacanti
30f4151bf8 Add missing headers to examples. 2017-10-02 12:33:30 -04:00
Kenneth Moreland
c3a3184d51 Update copyright for Sandia
Sandia National Laboratories recently changed management from the
Sandia Corporation to the National Technology & Engineering Solutions
of Sandia, LLC (NTESS). The copyright statements need to be updated
accordingly.
2017-09-20 15:33:44 -06:00
Abhishek Yenpure
d30c795c08 Fix particle advection error 2017-09-15 13:07:39 -04:00
Dave Pugmire
1c0f721b96 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into streamline_returntype 2017-08-28 15:27:04 -04:00
Dave Pugmire
611c5c43e5 Remove dead code. Remove compiler warnings. 2017-08-28 14:31:50 -04:00
Yenpure
1c35a74521 Resolve merge conflicts for pics_unittest 2017-08-11 13:57:47 -04:00
Yenpure
2ba83cd101 particle advection refactoring
-removing the bounds object form integrators.
-some formatting changes
-changes to build successfully
2017-08-03 13:34:58 -04:00
Yenpure
3668e098e3 Fixed particle advection build issues
-Merged short steps changes from AYenpure's branch
-Fixed build issues
-Fixedf merge issues
2017-08-02 10:02:21 -04:00
Yenpure
4b7bba836b Merge branch 'refactor_integrators' of https://gitlab.kitware.com/ayenpure/vtk-m into pics_unittests 2017-08-01 22:00:07 -04:00
Yenpure
61c61ee93b Adding a base class for Integrators 2017-07-31 15:46:13 -04:00
ayenpure
c564c4b911 Enhancements for particle advection
-support for short steps to push the particle out of bounds
2017-07-25 23:30:17 -04:00
Dave Pugmire
45c82f2e93 First take at getting streamline worklet to return useful information.
More changes to come.
2017-07-21 14:37:20 -04:00
Dave Pugmire
8bdf42f31c Change return type to a struct that contains the arrays from the worklet. 2017-07-20 07:36:57 -04:00
Yenpure
8e500a172a Moving PortalType templetization to Step method of Integrators
Changes suggested by Rob.
2017-07-12 15:31:16 -04:00
Dave Pugmire
33150365eb Validate the data format for the UniformGridEvaluate. 2017-07-12 12:02:04 -05:00
Yenpure
5a652f41bc Fix for MSVC compile isses
MSVC does not allow typename for non templated types while
compiling with c++98 std. (clang/gcc allow it)
Don't know about which standards Kitware uses to test builds, but
this should fix it.
Also removing unused parameter from the particle advection example.
2017-07-12 10:52:39 -04:00
Dave Pugmire
50dbd6347a Remove unneeded template from grid eval glasses. 2017-07-12 08:38:32 -05:00
Dave Pugmire
4f7ccdefbf Remove the rectilinear examples. 2017-07-11 21:27:53 -05:00
Dave Pugmire
4574f36dec Cleanup of particle advection worklets
Created ParticleAdvection.h for worklets that match the worklet pattern.
Slight reorganization of existing code to match this pattern.
Added a unittest particle advection.
2017-07-11 21:22:28 -05:00
Dave Pugmire
77c152abc2 Move some python files used for the paper. 2017-07-10 14:32:07 -05:00
Dave Pugmire
929b10fa72 MR cleanup.
Move some python testing files for the paper into the paper repo. (removing from VTK-m repo)
Removed a #define that is no longer needed.
2017-07-10 14:30:38 -05:00
Dave Pugmire
b86ca21b6d Cleanup for merge.
Renamed filter classes to worklet.
Removed some dead code.
2017-07-08 15:54:44 -04:00
ayenpure
f5c59a01e8 Updates for particle advection files.
- removing tabs, and trailing whitespaces.
- removing compile warnings for clang and gcc.
2017-07-07 13:46:45 -04:00