Commit Graph

19 Commits

Author SHA1 Message Date
Robert Maynard
0e9253289f VTK-m filters now have a consistent set of header guards 2019-10-08 10:39:59 -04:00
Robert Maynard
16a6af5857 Some filters had unnecessary DoMapField methods.
The CrossProduct and DotProduct are field filters and therefore
fields are automatically propagated instead of calling DoMapField.

As GhostCellClassify is passing through all fields, it can
override `MapFieldOntoOutput` and skip the deduction of the
Field to an ArrayHandle for better compile time.
2019-09-10 15:26:16 -04:00
Kenneth Moreland
26d7bfd0db Force ArrayPolicy of a specific type to the right template
There is a form of ApplyPolicy that takes a field and a value type and
returns an ArrayHandle with that value type that can be used directly.
This is implemented with an ArrayHandleMultiplexer.

For some reason, this version of ApplyPolicy magically stopped working.
The compiler, for some reason, grabbed a different overload and then
complained because it tried to use the ValueType as a list. I'm not sure
why this didn't get ignored due to SFINAE. (Maybe a compiler bug.)

At any rate, the problem is fixed by renaming that ApplyPolicy to
ApplyPolicyFieldOfType to make it clear what we are doing and to help
the compiler along.
2019-09-09 13:12:56 -06:00
Kenneth Moreland
07c59fcf72 Update filters with secondary fields to use new policy method
Rather than do a CastAndCall on all possible field types when calling a
worklet with two fields (where they all typically get cast to the same
type as the primary field), use the new mechanism with
ArrayHandleMultiplexer to create one code path.

Also update the ApplyPolicy to accept the Field type, which is used to
determine any additional storage types to support.
2019-09-09 08:19:16 -06:00
Robert Maynard
a6c1b10cd3 CreateResult API improved to make it easier to use
To help provide a better time writing VTK-m filter this streamlines
the CreateResult API to provide a focused set of methods, based on
how CreateResult has been used by existing filters.
2019-08-14 15:28:43 -04:00
Robert Maynard
cec717015a CreateResult is now part of vtkm::filter instead of being inside internals 2019-08-09 12:44:43 -04:00
Robert Maynard
3a7d3cb5ff VTK-m filters now launch all worklets via a vtkm::cont::Invoker
This has been done as to showcase the recommend best practices
for new VTK-m contributors.
2019-08-09 10:37:35 -04:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Robert Maynard
f63be1abe6 Update vtkm/filter to work with ArrayHandleVariant 2018-12-27 14:35:56 -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
d879188de0 Make DispatcherBase invoke using a TryExecute
Rather than force all dispatchers to be templated on a device adapter,
instead use a TryExecute internally within the invoke to select a device
adapter.

Because this removes the need to declare a device when invoking a
worklet, this commit also removes the need to declare a device in
several other areas of the code.
2018-08-29 19:18:54 -07:00
Haocheng LIU
5c797169ec Use the strong typed enums for vtkm::cont::Field
Since Field association is used either when creating or working
with 'vtkm::cont::Field', it's put in the class itself.
2018-05-22 11:44:51 -04:00
Utkarsh Ayachit
3da8b5be66 Remove vtkm::filter::Result
This commit removes `vtkm::filter::Result`. All methods that used
`vtkm::filter::Result` simply change to use `vtkm::cont::Dataset` instead.
The utility API on `Result` that was used to add fields to the resulting
dataset is now available via `vtkm::filter::internal::CreateResult`.
2018-04-03 16:55:03 -04:00
Kenneth Moreland
fa84272507 Enable using coordinates for dot/cross product filters
Also better supporting policies on secondary field.
2018-03-25 19:34:43 -06:00
Kenneth Moreland
707eccd3d5 Make dot/cross filter interface more consistent
Both the dot product filter and the cross product filter require 2
fields to be selected as their input. Previously, you used the
superclass' SetActiveField for the primary field and
SetSecondaryFieldName for the secondary field. This changes adds a
SetPrimaryField method to make the selection more clear. I also changed
SetSecondaryFieldName to SetSecondaryField that optionally takes an
association to make it more consistent.
2018-03-25 10:43:49 -06:00
Utkarsh Ayachit
d1a59aad20 Fixes for CrossProduct and DotProduct. 2018-03-06 15:54:46 -05:00
Dave Pugmire
da2b518e63 fix compiler warning 2018-02-27 13:35:35 -05:00
Dave Pugmire
1a0dfaa760 Add mapfield method. 2018-02-27 13:24:30 -05:00
Dave Pugmire
daf1171382 Filters to compute the cross and dot product of vector fields. 2018-02-27 09:24:46 -05:00