Commit Graph

35 Commits

Author SHA1 Message Date
Kenneth Moreland
b5415169e2 Change Field and related methods to use Range and Bounds
First, be more explicit when we mean a range of values in a field or a
spacial bounds. Use the Range and Bounds structs in Field and
CoordinateSystem to make all of this more clear (and reduce a bit of
code as well).
2016-05-29 18:49:36 -06:00
Robert Maynard
06a06b529d Simplify the bounds computation code to reduce library size.
The previous version of the bounds code required once less pass across
the data, but significantly increase the size of the resulting library:

Data for VTK-VTK-m interop:
  - 7k more symbol table entries
  - 1.5MB larger library

Because of the significant savings we need to use a less efficient
implementation that minimized the code size.
2016-05-26 13:48:30 -04:00
Kenneth Moreland
cc497e6a1b Remove cont/Assert.h and exec/Assert.h
These asserts are consolidated into the unified Assert.h. Also made some
minor edits to add asserts where appropriate and a little bit of
reconfiguring as found.
2016-04-20 15:41:14 -06:00
Jeremy Meredith
ba8517eb67 removing all references to field order. 2016-03-23 10:38:14 -04:00
Robert Maynard
52d8a4d9b7 Fix vtkm::cont::Field default constructor to have valid values. 2016-03-14 08:39:17 -04:00
Kenneth Moreland
f9750e83f7 Fix issues with Field constructor overloads
I ran into a few minor issues with the constructors to the Field class.

The big change I made was that I removed the Field constructors that
take an example type and create an empty field of that type. The problem
was that the example type was easily confused with some other type that
was supposed to describe an array. This lead to some odd behavior in the
compiler and resulted in errors in unexpected places.

The use case for this constructor is dubious. There were several tests
in the code that would create an empty field, add it to a data set, then
get it back out to pass to the worklet. The code is much simpler if you
just make an ArrayHandle of the right type and use that in the worklet
invoke directly. It is also faster to compile with smaller code because
the type is known statically (whereas it is lost the other way).

The other change was to declare references to ArrayHandle and
DynamicArrayHandle as const. There is nothing in the behavior that
invalidates the const, and it accepts arrays constructed in the
parameter.
2016-01-21 13:54:05 -07:00
Robert Maynard
c2ba8baf7c Allow vtkm::cont::Field to have a default constructor.
When designing vtkm::filter we needed the ability to construct invalid Fields.
This now allows us to do exactly that.
2016-01-04 15:40:37 -05:00
Kenneth Moreland
9cd8cb22eb Make PrintSummary actually work for Field and CoordinateSystem.
The PrintSummary for CoordinateSystem went in an infinite loop. It was
supposed to call PrintSummary of its superclass (Field), but instead it
called itself.

The PrintSummary for Field only worked for fields of type vtkm::Float32.
To make it work for all array types, I added a PrintSummary method to
DynamicArrayHandle, and Field calls that without trying to cast to a
static type.
2015-08-27 10:20:30 -06:00
Kenneth Moreland
a99f828ca3 CoordinateSystem handles uniform point coordinates.
The point of making CoordinateSystem a special type of Field object
was so that it could handle special array types like implicit regular
point coordinates. Overload the GetData and GetBounds methods to
properly handle this type of array.
2015-08-25 14:38:50 -06:00
Kenneth Moreland
51f0100b26 Refactor DynamicArrayHandle to have a common base.
Originally, DynamicArrayHandle only automatically handled the default
type and storage lists. There was an internal subclass that expanded
that to user defined lists, but it was a bit inaccessible. This change
makes DynamicArrayHandle match the structure of DynamicCellSet. There is
now a templated base class named DynamicArrayHandleBase that can accept
any pair of lists. DynamicArrayHandle itself is really just a typedef of
DynamicArrayHandleBase with the default lists.
2015-08-25 14:38:50 -06:00
Kenneth Moreland
9f624f0a36 Have CoordinateSystem inherit from Field
Previously, coordinate systems in a DataSet simply pointed to field data
specifying the coordinate information (although the ability to get that
back out of the DataSet was missing). This makes sense since point
coordinates are in fact just fields with a particular semantic meaning
to them.

However, there is an issue with this approach. It turns out that there
are special representations that are very common for point coordinates
and very uncommon for other types of fields. For example, a uniform
(a.k.a. regular or image) grid has point coordinates that are easily
derived from the point index, but such fields are quite uncommon
elsewhere.

Representing this kind of structure in the Field list of a DataSet is
problematic. Either all fields have to check to see if they are this
type, which will cause an explosion of unnecessary generated code, or
you will have to actually write out the coordinates in memory, which is
really wasteful but what was done previously.

However, by storing fields representing coordinate systems in a separate
batch, we can use these special types without the stated explosion.
2015-08-25 14:38:41 -06:00
Jeremy Meredith
34112645b9 adding case for new "ANY" association. 2015-08-25 10:58:18 -04:00
Jeremy Meredith
9c77b56b4a adding ability to specify an association type when requesting fields.
also adding testing of GetField to UnitTestDataSet tests.
2015-08-25 10:58:09 -04:00
Kenneth Moreland
01757ea136 Change Node -> Point
Most of VTK-m follows the convention of calling the 0D topology elements
"points" (which follows the convention of VTK). However, there were
several places where they were referred to as "nodes." Make things
consistent by calling them points everywhere.

Also merged some redundant ExecutionSignature tags.
2015-08-03 10:06:59 -06:00
Sujin Philip
b8e23e3736 Minor fixes to Field class 2015-07-30 11:16:07 -04:00
Kenneth Moreland
19db32f084 Conform DataSet classes to coding practices better
The most common changes were making class members uppercase and spelled
out, adding "this->" whenever a class member is used, and declare
functions and members with export macros. Also fixed some uses of int
(instead of vtkm::Id or something similar) and a bit of indentation. I
also sprinkled some const goodness over the code.

It should be noted that I had about a week delay between first making
these changes and checking them in. In the mean time Sujin also made
some similar changes, so there might be some repetative changes.
2015-07-27 12:49:42 -06:00
Robert Maynard
98d6e99275 Correct some warnings about 64bit to 32bit conversion. 2015-07-23 09:29:10 -04:00
Sujin Philip
91b191bf83 Add compute bounds to Fields 2015-07-22 12:17:33 -04:00
Sujin Philip
1b74eb6073 Add all data members to vtkm::cont::Field constructors' initializer lists 2015-07-13 17:14:57 -04:00
Sujin Philip
c95f265ec0 Make vtkm::cont::Field class const correct 2015-07-13 16:20:39 -04:00
Sujin Philip
9f1f1727a4 Consturct Field from given DynamicArrayHandle
Add un-templated contructors to Field that construct a Field from the given DynamicArrayHandle, without knowing the underlying type.
2015-07-13 15:50:07 -04:00
Sujin Philip
9a20b9e4b7 Changes to follow VTK-m coding conventions 2015-07-13 15:43:48 -04:00
Robert Maynard
44deb3c870 Allow creation of vtkm::cont::Field without any data.
This is needed to allow Field's to be used as output.
2015-06-08 16:14:49 -04:00
Robert Maynard
342a9989a5 Correct double to float conversion warnings. 2015-06-04 09:06:47 -04:00
Robert Maynard
0a433303e6 Correct headers to have the new copyright. 2015-06-03 15:06:43 -04:00
Robert Maynard
25722fec2e Merge 'origin/datamodel-design' into datamodel-design
Conflicts:
	vtkm/cont/ExplicitConnectivity.h
	vtkm/cont/Field.h
2015-05-29 13:54:10 -04:00
Dave Pugmire
089864d6f3 minor fixes and code cleanup for merge to trunk.
added vtkm_cont_export to ExplicitConnectivity classes.
2015-05-29 12:48:31 -04:00
Robert Maynard
42dc45c8b7 Correct the include guards on vtkm::cont::Field. 2015-05-29 09:51:11 -04:00
Robert Maynard
b8ac6d6a81 Field now uses ArrayHandle.allocate + std::copy in CopyData.
The original implementation use the naive approach of the device adapter
to copy the memory to the dynamic array handle. The issue with this approach
is that it would do a upload to device, and than a copy on device. Instead
we should prefer a copy on host, and than an upload to device.
2015-05-29 09:48:48 -04:00
Dave Pugmire
e1bbda8cae Add PrintSummary() for DataSet. 2015-05-20 15:26:10 -04:00
Jeremy Meredith
4e36d05fac moderately substantial cleanup to fields. 2015-05-19 16:49:17 -04:00
Jeremy Meredith
68d2353e6c starting some field/dataset cleanup 2015-05-19 16:21:15 -04:00
Jeremy Meredith
ed5ddc849e completing field. 2015-05-11 16:15:58 -04:00
Jeremy Meredith
2e7e3fff64 using dynamic array handle in field. 2015-04-15 12:33:27 -04:00
Jeremy Meredith
6d7e2012ab encapsulating field for data set. 2015-02-10 12:36:10 -05:00