Commit Graph

7352 Commits

Author SHA1 Message Date
Manish Mathai
f240a84e6d Merge topic 'enhance-glyphing-types' into release-1.8
814ec27f1 Add MapperGlyphScalar and MapperGlyphVector mappers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vicente Bolea <vicente.bolea@kitware.com>
Merge-request: !2747
2022-06-15 20:17:53 -04:00
Manish Mathai
814ec27f1e Add MapperGlyphScalar and MapperGlyphVector mappers
These mappers can be used to render cell sets as glyphs. The following
glyph types are available for scalar fields:
 - Cube
 - Sphere
 - Axes
 - Quads

For vector fields:
 - Arrows
2022-06-15 15:19:53 -07:00
Kenneth Moreland
7749b86b22 Move MakeTestDataSet.cxx to vtkm_cont
Originally `MakeTestDataSet.h` was header-only code. This was changed to
put its functionality into a library. The obvious library to put it in
was `vtkm_cont_testing`.

The problem is that there is some external code that is (unadvisably)
adding this header to their own code. This code ends up breaking because
it needed to include `vtkm_cont_testing`, which was not needed before.

As a workaround, there was a CMake interface link that caused external
code linking in `vtkm_cont` to also link in `vtkm_cont_testing`. This
works OK, but creates something of a circular dependency. CMake itself
has no problem with this, because `vtkm_cont` did not itself depend on
`vtkm_cont_testing`; only things that linked to `vtkm_cont` also had to
link to `vtkm_cont_testing`.

Unfortunately, some Ascent CMake script was trying to trace down
dependencies and ran into an infinite loop. So this solution was not so
great for them.

Get around the problem by just adding the `MakeTestDataSet` code
directly to `vtkm_cont` (for now).
2022-05-24 14:43:10 -06:00
Kenneth Moreland
9d4df90dfd Merge topic 'backport-2748' into release-1.8
d6353e1eb Fix StructuredPointGradient for Uniform Point Coordinates

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2765
2022-05-05 13:08:01 -04:00
Sujin Philip
d6353e1eb7 Fix StructuredPointGradient for Uniform Point Coordinates
The scalar field difference along x, y, and z should be divided by the
spacing not multiplied. This was causing some test failures in VTK and
ParaView when overriding the default contour filter with `vtkmContour`.
2022-05-04 12:55:33 -04:00
Kenneth Moreland
d3de36f470 Remove inline from PointTransform methods to be exported
When `PointTransform` was converted to the new filter structure, some of
the methods that were moved from .hxx to .cxx (and therefore compiled in
a library) were still marked as `inline`. This caused the compiler to
not compile the function into the library if it was not used. Fix the
problem by removing the `inline` modifier to the method implementations.
2022-05-03 12:57:14 -06:00
Manish Mathai
09fc8155af Merge topic 'fix-mapper-quad'
27825778e Fix color rendering when using MapperQuad

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2729
2022-04-20 12:04:35 -04:00
Kenneth Moreland
60e6b3ec84 Fix deprecated method export
The deprecated class `vtkm::filter::MeshQuality` contained a private
method that was referenced in its inlined constructor. The problem was
that this private method was compiled in the `vtkm_filter_mesh_info`
library but not properly exported. Fix this by adding an export to the
class.
2022-04-12 10:26:54 -06:00
Kenneth Moreland
a9d49b35b2 Merge topic 'scoped-enum-field-to-colors'
e6b37f7a4 Remove deprecated use of old unscoped enums in FieldToColors
f37cc7657 Use scoped enum for FieldToColors modes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Dave Pugmire <dpugmire@gmail.com>
Merge-request: !2734
2022-04-11 10:54:43 -04:00
Vicente Adolfo Bolea Sanchez
86bf876178 cuda: Fix new cuda version warnings 2022-04-07 17:50:37 -04:00
Gunther Weber
5ad164f98f Merge topic 'fix-memory-reallocation-kokkos'
291dafb17 use kokkos allocate whn oldSize is zero

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2746
2022-04-05 13:17:39 -04:00
Kenneth Moreland
a96f2a32b4 Merge topic 'gradient-test'
3b0cdcec2 Add tests for divergence, vorticity, and q criterion

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !2739
2022-04-01 10:11:43 -04:00
Abdelilah Essiari
291dafb173 use kokkos allocate whn oldSize is zero 2022-03-31 14:38:03 -04:00
Kenneth Moreland
62e509c0a2 Turn off inlining of Variant::CastAndCall for HIP
The current implementation of the AMD HIP compiler adds default compiler
flags to attempt to inline everything possible. This is wrecking havoc
with the `Variant::CastAndCall` function, whose implementation has one
or more large switch statements with each case calling a different
potentially inline function. In some parts of the VTK-m code, this is
dragging the compilation on for days as it tries to resolve a
`Variant::CastAndCall` within a `Variant::CastAndCall`. This will
probably need to be addressed in the compiler, but meanwhile we will
force the inlining to be turned off for the function called by
`Variant::CastAndCall`. It is unclear if this will result in some extra
runtime overhead, but the change is worth it to get reasonable compile
times.

Thanks to Nick Curtis for tracking this down and providing the solution.
2022-03-28 14:14:06 -06:00
Kenneth Moreland
6afff75501 Modify Variant CastAndCall to have fewer cases in its switch
The previous implementation of `Variant`'s `CastAndCall` generated a
switch statement with 20 cases (plus a default) regardless of how many
types were handled by the `Variant` (with the excess doing nothing
useful). This reduced the amount of code, but caused the compiler to
have to build many more instructions (and optimize for them). This in
turn lead to large compile times and unnecessary large libraries/
executables.

This change makes a different function to use for `CastAndCall` so that
the number of cases in the switch matches exactly the number of types in
the `Variant`'s union.

Because the size of VariantImplDetail.h was getting large, I also
reduced the maximum expansions for the code. This does not seem to
negatively affect compile time, and I doubt it will have an noticible
difference in running time (when in release mode).

I also modified some other parts of this code to match the expansion
without making unnecessary defaults.
2022-03-28 14:14:06 -06:00
Kenneth Moreland
61a44887fd Update vtkm_add_instantiations documentation 2022-03-23 06:34:05 -06:00
Kenneth Moreland
1c1881d53e Declare methods for instances out of line
For the templated methods that we are precompiling instances for, do not
put their implementation inside of the class declaration. The problem is
that if you define a method inside of a class, it is implicitly inline.
If it is inline, a compiler might choose to compile it even if an
external symbol exists.
2022-03-23 06:33:45 -06:00
Kenneth Moreland
13de2b7303 Protect gradient instantiations from ambiguity
It appears that some compilers treat template instances different than
calling a template. For example, if you have

```cpp
template <typename T, typename U>
void Foo(T t, U u);

template <typename T>
void Foo(T t, int u);

template void Foo(int t, int u);
```

that some compilers will complain that the instance is ambiguous because
it matches both versions of Foo even though the second one is the one
that is called (unless you specifically declare template parameters).

This is what happend with the gradient instances. Fix the problem by
wrapping the "ambiguous" cases to be called by a simple, single
templated function.
2022-03-23 06:33:41 -06:00
Kenneth Moreland
f4de1d8ee2 Compile instantiations of the gradient filter
When the gradient filter was moved over to the new filter structure, it
lost its instantiations. This is a problem because the gradient filter,
which compresses a lot of the code into single worklet calls for
efficiency, is one of the longest to compile filters.

This commit restores the instantiations with the updated instantiation
functionality. This breaks up the code into many translation units that
can be compiled simultaneously and thus not hold up the entire compile
on one process.
2022-03-23 06:33:41 -06:00
Kenneth Moreland
6eb9c9876c Add generalized instantiation
Recently, an instantiation method was added to the VTK-m configuration
files to set up a set of source files that compile instances of a template.
This allows the template instances to be compiled exactly once in separate
build files.

However, the implementation made the assumption that the instantiations
were happening for VTK-m filters. Now that the VTK-m filters are being
redesigned, this assumption is broken.

Thus, the instantiation code has been redesigned to be more general. It can
now be applied to code within the new filter structure. It can also be
applied anywhere else in the VTK-m source code.
2022-03-23 06:33:36 -06:00
Kenneth Moreland
b544b8e09f Fix point merge for Marching Cubes with multiple isosurfaces
When the Marching Cubes algorithm merges points together for multiple
isosurfaces, it uses an ArrayHandleZip to combine the isosurface id and
the edge identification. This is to prevent merging points from
different isosurfaces. However, internally this has to do an array copy.

It was doing this copy with `ArrayCopy`. A recent change to that method
made the copy fail for `ArrayHandleZip`. The fix is to change to
`ArrayCopyDevice`.

The reason why this bug was introduced was because there was no test
case for this specific use. A regression test has been updated to test
for this case.
2022-03-21 11:44:36 -06:00
Kenneth Moreland
e1e3d4af2f Merge topic 'scoped-enum-cell-classification'
5d90102f1 Remove deprecated use of vtkm::CellClassification
ccef4d2db Fix scoping of vtkm::CellClassification

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2737
2022-03-21 12:40:05 -04:00
Kenneth Moreland
86f238753b Merge topic 'scoped-enum-field-selection'
08e682601 Remove deprecated use of old unscoped enums in FieldSelection
28aa9b570 Use scoped enum for FieldSelection mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !2735
2022-03-21 08:43:24 -04:00
Kenneth Moreland
1053b40bde Merge topic 'scoped-enum-rendering'
2fd8a9b9a Remove deprecated use of old unscoped enums in rendering
e051565d9 Use scoped enums in rendering classes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2736
2022-03-21 08:36:35 -04:00
Kenneth Moreland
821e5f7473 Merge topic 'no-test-compile'
97f5ed640 Remove testing include from ZFP worklet headers
8d5e636ac Enable ci that compiles without testing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vicente Bolea <vicente.bolea@kitware.com>
Merge-request: !2738
2022-03-21 08:35:47 -04:00
Kenneth Moreland
08e6826017 Remove deprecated use of old unscoped enums in FieldSelection 2022-03-18 13:16:55 -06:00
Kenneth Moreland
28aa9b570f Use scoped enum for FieldSelection mode 2022-03-18 13:14:57 -06:00
Kenneth Moreland
3b0cdcec27 Add tests for divergence, vorticity, and q criterion
The gradient filter has the ability to compute divergence, vorticity,
and q criterion. However, none of the gradient tests were actually
testing the result of these computations. At best, one of the tests was
checking that the arrays were created, but never actually looking at the
values.

For one of the gradient tests, this change computes these 3 values and
checks the results, which look reasonable compared to ParaView.
2022-03-18 12:58:57 -06:00
Kenneth Moreland
13a3560f40 Merge topic 'rename-field-associations'
f8f41e0ef Update use of field association enumerations
56670dbba Rename field associations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !2733
2022-03-18 13:39:13 -04:00
Kenneth Moreland
97f5ed640f Remove testing include from ZFP worklet headers
Several of the ZFP worklet headers included `vtkm/cont/testing/
MakeTestDataSet.h`. This is a problem because if testing is turned off,
then `MakeTestDataSet.h` attempts to include a file that is not
generated, so the compile just fails if testing is off (and the testing
library is not on). This include must be a remanent of some old testing
code during development. It can be safely removed.
2022-03-18 11:04:37 -06:00
Kenneth Moreland
d0679d868c Merge topic 'histogram-range'
df24ea138 Fix Histogram filter range for DataSet

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2731
2022-03-18 11:08:01 -04:00
Kenneth Moreland
5d90102f1b Remove deprecated use of vtkm::CellClassification 2022-03-17 15:34:01 -06:00
Kenneth Moreland
ccef4d2dbf Fix scoping of vtkm::CellClassification
The cell classifications were using an unscoped enum to define them. The
problem was that the symbols of the enum littered the `vtkm` namespace
without qualification. For example, it defined `vtkm::NORMAL`, which
could easily collide with some other meaning of normal.

Change the cell classification flags to be scoped within
`vtkm::CellClassification`. This thing behaves mostly like a scoped
enum. You can use the values declared within and reference
`vtkm::CellClassification` as a type itself. However, unlike a scoped
enum, `vtkm::CellClassification` items can automatically be cast to and
from `vtkm::UInt8`.
2022-03-17 15:33:57 -06:00
Kenneth Moreland
2fd8a9b9aa Remove deprecated use of old unscoped enums in rendering 2022-03-17 15:28:11 -06:00
Kenneth Moreland
e051565d96 Use scoped enums in rendering classes
We should try to favor scoped enums over unscoped enums for their
enhanced type safety.
2022-03-17 15:28:11 -06:00
Kenneth Moreland
e6b37f7a48 Remove deprecated use of old unscoped enums in FieldToColors 2022-03-17 15:14:13 -06:00
Kenneth Moreland
f37cc7657f Use scoped enum for FieldToColors modes 2022-03-17 15:14:13 -06:00
Kenneth Moreland
f8f41e0ef5 Update use of field association enumerations
The enumerations in `vtkm::cont::Field::Association` were renamed in the
previous commit. The old names still exist, but are deprecated. Change
the rest of the code to use the new names.
2022-03-17 11:02:37 -06:00
Kenneth Moreland
56670dbbaa Rename field associations
The symbols in `vtkm::cont::Field::Association` have been changed from
`ANY`, `WHOLE_MESH`, `POINTS`, and `CELL_SET` to `Any`, `WholeMesh`,
`Points`, and `Cells`, respectively. The reason for this change is twofold:

  * The general standard that VTK-m follows for `enum struct` enumerators
    is to use camel case (with the first character capitalized), not all
    upper case.
  * The use of `CELL_SET` for fields associated with cells is obsolete. A
    `DataSet` used to support having more than one `CellSet`, and so a
    field association on cells was actually bound to a particular
    `CellSet`. However, that is no longer the case. A `DataSet` has exactly
    one `CellSet`, so a cell field no longer has to point to a `CellSet`.
    Thus the enumeration symbol for `Cells` should match the one for
    `Points`.

For backward compatibility, the old enumerations still exist. They are
aliases for the new names, and they are marked as deprecated, so using them
will result in a compiler warning (on some systems).
2022-03-17 09:36:44 -06:00
Kenneth Moreland
df24ea138d Fix Histogram filter range for DataSet
In the transition of the `Histogram` filter to the new filter types, a
bug was introduced. The `Histogram` filter has an option to set the
range for which to compute the histogram. (The range of the data will be
used instead if none is specified.) This range was properly used when
computing the histogram on a `PartitionedDataSet`. However, when running
on a single `DataSet`, the new filter structure skipped over the
partition code that checked to see if the range was specified. (It also
skipped over the code that properly computed the range in MPI.)

This change properly checks to see if `Execute` was called with a single
`DataSet` and updates the `ComputedRange` appropriately.
2022-03-16 15:47:59 -06:00
Kenneth Moreland
9d6f63b677 Add vtkm_cont_testing to interface of vtkm_cont
Recent changes to VTK-m include changes to MakeDataSet.h that require
the vtkm_cont_testing library to be loaded. This is problematic for
software using an earlier minor revision as they do not expect to need
to include this library.

For now, include vtkm_cont_testing in the interface of vtkm_cont so that
downstream code will load it. This should be a temporary solution. As we
move to new versions of VTK-m, we should break this link and require
downstream components to include it themselves.
2022-03-16 14:44:42 -06:00
Kenneth Moreland
2723cd082b Include UncertainCellSet.h from UnknownCellSet.h
This is mostly to support external code that expects deprecated
behavior. UnknownCellSet/UncertainCellSet replace DynamicCellSet. In the
deprecated class, you could use `ResetCellSetList` without having to
include a secondary file. It would be better to support that now so the
minor change does not break things.
2022-03-16 14:24:29 -06:00
Manish Mathai
27825778e8 Fix color rendering when using MapperQuad
This fix lerps the scalar field values at points of ray intersection,
ensuring rendering of quads pick the correct lerped color instead of
using the same color for the entire quad.
2022-03-11 13:36:35 -08:00
Kenneth Moreland
2b64630674 Enable predicate parameter to ListAll and ListAny
In pretty much any practical circumstance, whenusing `ListAll` or
`ListAny`, you have a list of types on which you run some sort of
predicate on each item in the list to determine whether any or all of
the items match the predicate. To make this easier, add a second
argument to `ListAll` and `ListAny` to provide a predicate that will
automatically be added.

If no predicate is given, then the operation is run directly on the
list. This is implemented by just using an identity operation.
2022-03-08 09:26:35 -07:00
Kenneth Moreland
0f96a6b0be Remove brigand.hpp
GCC 11 is having trouble compiling brigand.hpp at all, even before we
instantiate any templates. Since we no longer need it, let's get rid of
it. It was always placed in an internal namespace.
2022-03-08 07:25:08 -07:00
Kenneth Moreland
8d00bb1644 Deprecate brigand.hpp
Add deprecation warnings to the code whenever someone uses brigand.hpp.
We are no longer supporting this header file, but we'll give code a
chance to transition off of it.

Also added some other deprecation warnings to other header files that
are themselves deprecated but only issued warnings if you used something
in it.
2022-03-08 07:25:08 -07:00
Kenneth Moreland
9562de9457 Remove brigand from DispatcherBase 2022-03-08 07:25:08 -07:00
Kenneth Moreland
a771359d72 Remove brigand from FunctionInterface
Replace with features in `vtkm::List`.
2022-03-08 07:25:08 -07:00
Kenneth Moreland
be8004b01a Remove brigand from ArrayHandleDecorator
Replaced with features provided by `vtkm::List` and some simple
templates now in `vtkm/internal/Meta.h`.
2022-03-08 07:24:53 -07:00
Kenneth Moreland
2eb6fb9dd1 Remove brigand from ArrayHandleCompositeVector
Use new features of vtkm::List instead.
2022-03-08 06:53:05 -07:00