Commit Graph

244 Commits

Author SHA1 Message Date
nadavi
78e3cbb501 Move regression test images into subdirs, implement io library support 2021-03-24 22:57:32 +00:00
Nick Thompson
4cb661006e Implement GetIndices. 2021-03-12 14:40:27 -05:00
Nick Thompson
2d35ab05ac Write CellSetExtrude as CellSetExplicit. 2021-03-08 10:18:42 -05:00
mclarsen
1c060d9c50 more missing sstream headers 2021-02-26 13:49:42 -08:00
mclarsen
5be6fb0c50 add another missing header 2021-02-26 07:35:26 -08:00
mclarsen
572840f492 add another missing header 2021-02-26 07:29:18 -08:00
Kenneth Moreland
04f020ae65 Update Field to use new ArrayRangeCompute features
Reduces the amount of code that has to be generated. Also improves the
number of arrays supported and has better support for deprecated
versions of `GetRange`.
2021-02-17 09:18:36 -07:00
Caitlin Ross
40185ee440 attempting to fix various build and linking errors 2021-02-10 15:20:35 -05:00
Kenneth Moreland
26ea2ab420 Break circular dependency of ArrayCopy.h and UnknownArrayHandle.h
The circular dependency came from UnknownArrayHandle.h needing
VTKmDefaultTypes.h, which needed all the cell set types. Some of those
cell sets used ArrayCopy in templated functions. Changed those functions
to directly deep copy the ArrayHandle.
2021-02-02 17:33:08 -07:00
Kenneth Moreland
8b133288ce Fix deprecation warnings
There was an error that caused deprecation warnings in VTK-m to be
suppressed, which meant that many uses of deprecated features went
unnoticed. This fixes those deprecation warnings.

The majority of the warnings were caused by the use of the deprecated
`Cast`, `CopyTo`, and `ResetTypes` methods of `UnknownArrayHandle` (or
`VariantArrayHandle`). Both `Cast` and `CopyTo` have been subsumed by
`AsArrayHandle` (to make the functionality more clear). `ResetTypes` now
requires a second template argument to define the storage types to try.

Also fixed some issues with `SerializableField` being deprecated.
This class is no longer necessary because `Field` can now be directly
serialized.
2021-01-26 07:56:39 -07:00
Li-Ta Lo
081f8aaea8 reformat if statements, add comments on the HDF5 macros 2021-01-15 15:05:52 -07:00
Li-Ta Lo
e65c0713b8 move #include of hdf5.h into .cxx files 2021-01-15 09:12:52 -07:00
Li-Ta Lo
ff0b8fd0bb changed to CMake files based on Robert's feedback 2021-01-14 14:23:05 -07:00
Li-Ta Lo
ca0ce4de7b Merge branch 'master' into hdf5_image_io 2021-01-14 14:08:00 -07:00
Kenneth Moreland
a6edc832da Merge topic 'soa-array-default'
cecd81d5d Add types appropriate for Ascent
865855ea0 Add changelog for making ArrayHandleSOA a default array
50ff9c22a Add support of `ArrayHandleSOA` as a default storage type
bc09a9cd1 Add precompiled versions of `ArrayRangeCompute` for `ArrayHandleSOA`
77f9ae653 Support `ArrayHandleSOA` only for `Vec` value types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2349
2021-01-14 12:40:58 -05:00
Kenneth Moreland
b4ca18607c Merge topic 'recombine-vec-array'
f941cb607 Move Fetch specializations to vtkm/exec/arg
439c18cfc Add changedoc for ArrayHandleRecombineVec
9833f3d0d Fix issue with using recombined vec as an output array
7dd9b4252 Add UnknownArrayHandle::ExtractArrayFromComponents
755af739e Add ArrayHandleRecombineVec

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2372
2021-01-11 13:50:57 -05:00
Kenneth Moreland
50ff9c22aa Add support of ArrayHandleSOA as a default storage type 2021-01-06 13:20:58 -07:00
Li-Ta Lo
d81f08eedb correct copyright mesage 2021-01-05 13:29:35 -07:00
Li-Ta Lo
6af7c3122a making WriteDataSet virtual 2021-01-05 12:59:52 -07:00
Kenneth Moreland
7dd9b4252a Add UnknownArrayHandle::ExtractArrayFromComponents
This method allows you to extract an `ArrayHandle` from
`UnknownArrayHandle` when you only know the base component type.

Also removed the `Read/WritePortalForBaseComponentType` method
from `UnknownArrayHandle`. This functionality is subsumed by
`ExtractArrayFromComponents`.
2021-01-04 14:17:24 -07:00
Li-Ta Lo
fac489644f HDF5 unit tests
Move HDF5ImageWriter/Reader to its own unit test. Use user supplied
field name as HDF5 dataset name.
2021-01-04 10:01:49 -07:00
Li-Ta Lo
03cb5cb43c rename file names and add reference to the specification 2021-01-04 09:04:08 -07:00
Robert Maynard
90c607c999 Correct CMake checking for targets before creation 2020-12-30 12:42:51 -05:00
Robert Maynard
7897d23c39 Cleanup some minor CMake style issues 2020-12-28 10:36:00 -05:00
Li-Ta Lo
da7d6aaf19 Add HDF5 Image file support 2020-12-25 16:02:08 -07:00
Kenneth Moreland
67507185ce Add ability to extract components in UnknownArrayHandle
This allows you to handle just about every type of array with about 10
basic types. It allows you to ignore both the size of `Vec`s and the
actual storage of the data.
2020-12-16 17:23:27 -07:00
nadavi
1818a885bf Generate and test regression-test images with io library updates 2020-12-02 16:24:07 +00:00
Nick Thompson
2addc19eac Merge topic 'less_verbose_logging'
5d4c3f0c6 Less verbose logging.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2329
2020-11-25 13:54:23 -05:00
Nick Thompson
5d4c3f0c61 Less verbose logging. 2020-11-20 15:12:23 -05:00
Nick Thompson
0019c0b3af Missing include file. 2020-11-20 13:46:59 -05:00
Nick Thompson
3a9e97bb88 Write more digits in VTKDataSetWriter.cxx. 2020-11-20 11:39:30 -05:00
Kenneth Moreland
07d6c06c73 Convert ArrayHandleCartesianProduct to new buffer-style array 2020-11-17 12:17:28 -07:00
Kenneth Moreland
f7cc03107d Fix deprecated warnings
Supress the deprecated class warnings for the implementation of
deprecated features.
2020-09-09 06:13:07 -06:00
Kenneth Moreland
63ef84ed78 Optionally remove all use of ArrayHandleVirtual
As we remove more and more virtual methods from VTK-m, I expect several
users will be interested in completely removing them from the build for
several reasons.

1. They may be compiling for hardware that does not support virtual
methods.
2. They may need to compile for CUDA but need shared libraries.
3. It should go a bit faster.

To enable this, a CMake option named `VTKm_NO_DEPRECATED_VIRTUAL` is
added. It defaults to `OFF`. But when it is `ON`, none of the code that
both uses virtuals and is deprecated will be built.

Currently, only `ArrayHandleVirtual` is deprecated, so the rest of the
virtual classes will still be built. As we move forward, more will be
removed until all virtual method functionality is removed.
2020-09-04 22:52:45 -06:00
Kenneth Moreland
66a4a23ebf Fix issue of getting pointer from std::vector of size 0
C++11 introduced the `std::vector::data()` method. In addition to being
more syntatically pleasing, it should correctly handle the condition
when the `std::vector` is size 0 and therefore has no real pointer.
(Expressions like `&v[0]` are undefined when the `vector` is empty.)
2020-09-02 12:04:34 -06:00
Kenneth Moreland
3f8da6e7e1 Fix some debugging code that should not have been there 2020-09-01 14:21:09 -06:00
Kenneth Moreland
52cecefba0 Fix crash when loading poly data with no cells 2020-09-01 14:20:11 -06:00
Kenneth Moreland
a8fa143351 Move UnitTestVTKDataSetReader files to git-lfs
The `UnitTestVTKDataSetReader` test reads in .vtk files of multiple
formats. The origins of this test predate the use of git-lfs and a data
directory, so the test defined in the source code several strings
containing the contents of the files.

That is no longer necessary. This change removes those strings from the
file and creates actual files in the data directory. This is easier to
manage as well as more convenient if you want to use the same data in a
different test or just take a look at the data in a different program
(such as VisIt or ParaView).
2020-08-25 07:23:13 -06: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
Vicente Adolfo Bolea Sanchez
ab0fecda7f VTKDataSetWriter: remove just_points argument
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-07-24 15:54:13 -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
453e314044 Deprecate ArrayHandleVirtualCoordinates
We are in the process of deprecating virtual classes in VTK-m
(that run in the execution environment).
2020-07-14 08:51:47 -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
058927c82f Write uniform and rectilinear grids to legacy VTK files
As a programming convenience, all `vtkm::cont::DataSet` written by
`vtkm::io::VTKDataSetWriter` were written as a structured grid. Although
technically correct, it changed the structure of the data. This meant that
if you wanted to capture data to run elsewhere, it would run as a different
data type. This was particularly frustrating if the data of that structure
was causing problems and you wanted to debug it.

Now, `VTKDataSetWriter` checks the type of the `CoordinateSystem` to
determine whether the data should be written out as `STRUCTURED_POINTS`
(i.e. a uniform grid), `RECTILINEAR_GRID`, or `STRUCTURED_GRID`
(curvilinear).
2020-07-08 19:12:14 -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
dpugmire
447e8aff04 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into betterParticleAdvectionDiffs2 2020-06-16 11:49:21 -04:00
dpugmire
27c39217d4 remove debug statements 2020-06-16 11:43:20 -04:00
dpugmire
1a2910165c debug for dashboard. 2020-06-16 08:43:29 -04:00
dpugmire
b5270f5fae change float/double to vtkm typedefs. 2020-06-15 14:09:42 -04:00
NAThompson
0f0c465c1b Deprecate Camera::Activate() and Camera::Finish() 2020-06-14 11:04:06 -04:00
NAThompson
755137a822 Particle advection tests with file. 2020-06-13 10:58:45 -04:00
NAThompson
db8f3c9fc9 Remove Initialize() boilerplate. 2020-06-05 13:38:18 -04:00
Kenneth Moreland
7ded85f012 Remove reference to Canvas in ImageReaderBase
It is no longer necessary for the image reader to access a Canvas, and
this does not work anyway if rendering is turned off.
2020-06-03 09:25:19 -06:00
Kenneth Moreland
1949cad400 Add get/set filename methods for image reader/writer 2020-06-01 10:33:20 -06:00
Kenneth Moreland
e8c5ee5e69 Remove pixel type selection from PNG reader
Selecting the pixel type just means that lodepng casts it to that type
for it then to be cast to the type VTK-m uses. Since VTK-m always uses
the same type, there is little value for changing the intermediate cast.
2020-06-01 10:00:37 -06:00
Kenneth Moreland
6c97054b7f Update image writes to style and library
Updated the image writer classes to better follow VTK-m naming
convention (i.e. use `ImageWriterPNG` instead of `PNGWriter`). The
structure of the image writer class now also better matches the
interface for the VTK writer.

Also put the implementation of the image writers into the `vtkm_io`
library so that it only has to be compiled once.
2020-06-01 10:00:36 -06:00
Kenneth Moreland
1e91b32ace Update image readers to style and library
Updated the image reader classes to better follow VTK-m naming
convention (i.e. use `ImageReaderPNG` instead of `PNGReader`).
The structure of the image reader class now also better matches
the interface for the VTK reader.

Also put the implementation of the image readers into the `vtkm_io`
library so that it only has to be compiled once.
2020-06-01 10:00:18 -06:00
Robert Maynard
d7af19ea8f Merge topic 'deprecated_bov_reader_still_constructible'
0f867c05f vtkm::io::reader::BOVDataSet fix 'constructor delegates to itself'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2107
2020-05-28 13:10:53 -04:00
Robert Maynard
0f867c05f2 vtkm::io::reader::BOVDataSet fix 'constructor delegates to itself'
Fixes #517
2020-05-28 08:34:31 -04:00
NAThompson
fe4f71ab92 Deprecate DataSetFieldAdd. 2020-05-27 15:27:47 -04:00
Kenneth Moreland
05fcda6c76 Compile IO library with device compilers
Because the IO classes use ArrayHandle, they have to be compiled with
device compilers (even though they do not directly produce any device
code). This is a dumb requirement, but it is a requirement nonetheless.
2020-05-19 15:04:08 -06:00
Kenneth Moreland
dce576bd11 Add BOVDataSetReader implementation to vtkm_io 2020-05-19 14:33:45 -06:00
Kenneth Moreland
8657a9b3c8 Update VTKDataSetWriter to compile into vtkm_io 2020-05-19 14:32:48 -06:00
Kenneth Moreland
086439e71e Update variants of VTKDataSetReaders to compile into vtkm_io 2020-05-19 13:04:12 -06: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
Nick Thompson
5d20506a5d Remove overly verbose log pring. 2020-05-18 22:25:29 -04:00
Nick
a55596b38c Reorder member functions. 2020-05-14 16:10:33 -04:00
Nick
6fba7347a9 Mark pixel destructors as virtual to fix build error. 2020-05-14 14:29:34 -04:00
nadavi
24d022b02b Implement and test ImageReader and ImageWriter capabilities in the io library 2020-05-13 16:10:21 -06:00
NAThompson
2fc636c276 Test BOV reader. Fix slow WritePortal().Set(idx, val) loop. 2020-05-11 17:08:44 -04:00
NAThompson
46faf574fa ReadPortal().Get(idx) is slow in a loop. 2020-05-08 11:30:59 -04:00
NAThompson
697369fc14 Remove deprecation warnings throughout the project. 2020-04-30 08:12:04 -04:00
NAThompson
d610176aba First commit demos backwards compatibility and printing of warnings. 2020-04-30 07:37:55 -04:00
NAThompson
b82051746c Test that no warnings are generated and tests pass. 2020-04-29 11:30:18 -04:00
NAThompson
20c6e69338 Deprecate writer/ directory. 2020-04-29 11:11:02 -04:00
Nick
54e15e8f14 Export symbol as VTK_IO_EXPORT. 2020-04-28 09:12:11 -04:00
Nick
1a16299b8c Fix build error. 2020-04-28 07:47:31 -04:00
Nick
981f0ed0d9 First stab at building a vtkm_io library target. 2020-04-28 07:13:27 -04:00
Nick
cad7b593d2 Fix warning. 2020-03-26 12:12:54 -04:00
Nick
7da30d2540 Write data in fixed point, not scientific notation. Increase performance by removing buffer flushes. 2020-03-20 07:05:08 -04:00
Nick
98dbf7c1a9 Replace spaces by underscores in SCALAR name field. 2020-03-17 10:00:46 -04:00
Nick
b3d170f2d9 Compound datatypes for writer. 2020-03-16 11:41:52 -04:00
Kenneth Moreland
ec34cb56c4 Use new ways to get array portal in control environment
Also fix deadlocks that occur when portals are not destroyed
in time.
2020-02-26 13:10:46 -07:00
Kenneth Moreland
cd302effb3 Update lists in TypeListTag.h
A new header named TypeList.h and the type lists have been redefined in
this new file. All the types have been renamed from `TypeListTag*` to
`TypeList*`. TypeListTag.h has been gutted to provide deprecated
versions of the old type list names.

There were also some other type lists that were changed from using the
old `ListTagBase` to the new `List`.
2019-12-05 11:05:19 -07:00
Allison Vacanti
3886b7dfb8 Refactor CellSetExplicit to remove NumIndices.
See #408 for details.
2019-09-30 12:27:13 -04:00
Kenneth Moreland
82a58c2f0a Fix error with whitespace at end of file
The VTK file reader caused an error to be thrown when reading a file
that had a METADATA section at the end of the file. The problem was that
the METADATA section had some whitespace after its last line (which is
probably typical). This caused an eof check to pass and then a
subsequent search for a token to fail.

The solution was to eat the whitespace after the METADATA section to get
the reader at the next token or in eof condition if it is at the end of
the file.
2019-09-25 16:20:20 -06:00
Robert Maynard
3b89bc0db2 CellSet classes don't require a name 2019-09-02 10:39:58 -04:00
Robert Maynard
89fa2c0293 Remove multiple vtkm::cont::CellSet from vtkm::cont::DataSet
By removing the ability to have multiple CellSets in a DataSet
we can simplify the following things:

  - Cell Fields now don't require a CellSet name when being constructed
  - Filters don't need to manage what the active cellset is
2019-09-02 09:04:51 -04:00
Kenneth Moreland
b0b000263e Write out all test data sets in VTKDataSetWriter
Although convenient, one of the issues of creating data with
MakeTestDataSet is that it is hard to look at the data created. It is
often helpful to be able to bring in the data into something like
ParaView or VisIt to play with it. To enable that, write them all out as
part of UnitTestVTKDataSetWriter.
2019-08-29 16:48:53 -06:00
Kenneth Moreland
a9bbb6ead9 Permute cells inline
The poly data and unstructured grid readers have to permute the cell
data to componsate for differences between VTK and VTK-m cell shapes.
Previously, this permutation was implemented by casting the read data to
a type and then changing the data. However, some code paths caused the
cast to fail. Get around that by doing the permutation in line when the
data are read.
2019-08-26 13:35:20 -06:00
Kenneth Moreland
d37ab77326 Add ability to read FIELD section in vtk legacy files
Previously, the VTK file readers just skipped over everything in FIELD
sections. However, it is common for many point and cell fields to be
written in this section (it is how ParaView writes out most of its
data). This change will allow these fields to be read in correctly.
2019-08-26 12:36:55 -06:00
Kenneth Moreland
19a610f5e9 Fix skipping over information in vtk files
Previously, if a legacy VTK file had a METADATA section with an
INFORMATION subsection, the reader did not skip over it correctly.
Instead, it just read the rest of the file (and often encountered an
error). Change this to read and skip over the INFORMATION subsection
correctly.
2019-08-26 12:36:54 -06:00
Kenneth Moreland
0be50c119d Update VTK-m code to use new Vec aliases
Should make the code easier to read.
2019-07-31 12:55:40 -06:00
Hank Childs
2fc7cb02a3 remove unused variable 2019-07-16 10:58:40 -07:00
Hank Childs
5064854a0d Add error message with bad file open 2019-07-12 18:19:48 -07:00
Kenneth Moreland
fbbc185901 Use logging to output status of VTKDataSetReaderBase
The original implementation predates the logging and so just outputted
error and warning messages to stderr. Changed these to the more
appropriate logging mechanism.
2019-06-12 09:40:54 -06:00
Sujin Philip
b74ab327dc Improve VTK DataSet Reader
1. Support reading Tensors (Vec<T, 9>)
2. Support reading files having `METADATA`.
2019-05-13 15:26:15 -04:00
Robert Maynard
ff687016ee For VTK-m libs all includes of DeviceAdapterTagCuda happen from cuda files
It is very easy to cause ODR violations with DeviceAdapterTagCuda.
If you include that header from a C++ file and a CUDA file inside
the same program we an ODR violation. The reasons is that the C++
versions will say the tag is invalid, and the CUDA will say the
tag is valid.

The solution to this is that any compilation unit that includes
DeviceAdapterTagCuda from a version of VTK-m that has CUDA enabled
must be invoked by the cuda compiler.
2019-04-22 10:39:54 -04:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00