Commit Graph

65 Commits

Author SHA1 Message Date
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
1f8030a6e8 Add non-const version of DataSet::Get methods
A non-const version of GetCoordinateSystem was added to implement a
change to the point transform filter. To make things symmetric (and
provide likely future needs), also add non-const versions of getting the
fields and cell sets.
2019-08-26 13:58:11 -06:00
Kenneth Moreland
69226803c2 Make PointTransform actually transform the points
The primary (likely only) use of PointTransform is to perform affine
transform on the position of the mesh. However, PointTransform did not
actually move the mesh. Rather, it just created a new field with the
transformed points.

Now, the output has its coordinate system replaced with the transformed
one generated (in addition to be added as a field). This can be turned
off (but defaults to on).

Also changed the constructor to turn on UseCoordinateSystemAsField so
that by default the filter operates on the existing coordinate system
and replaces it with the new coordinate system.

Also removed the template parameter on the filter. That added an
unnecessary complication to using it.
2019-08-26 12:29:24 -06:00
Robert Maynard
b0c6e18ea7 DataSet queries for cellset and coordinate index won't trow
Queries for cellset and coordinates by name will not throw exceptions
when looking just for the index value. Instead they will return -1
2019-08-19 09:36:03 -04:00
Robert Maynard
031407443d Provide simplified way to construct point and cell fields 2019-08-15 11:03:41 -04:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Robert Maynard
ad98d818ce VTK-m now doesn't clobber external DIY installations
Fixes #334
2019-02-05 13:05:14 -05:00
Robert Maynard
0a40c620ac Rename ArrayHandleVariant to VariantArrayHandle. 2018-12-27 14:35:56 -05:00
Robert Maynard
ef83adf3bd Field, CoordinateSystem, VirtualCoordinates all use the new virtual code 2018-12-27 14:35:56 -05:00
Robert Maynard
0da7830d9a Make sure important vtkm::cont classes have noexcept move ops.
This is important so they can be stored efficiently inside
containers such as std::vector that require strong move guarantees.
2018-12-10 10:33:18 -05:00
Sujin Philip
365d3d3921 Implement DataSet Serialization 2018-09-25 13:58:39 -04: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
cb7cbdbcf9 fixes #220: pass only requested fields.
Adding API to DataSet to `CopyStructure` from another dataset. This
copies the cellsets and coordinate systems while leaving the fields
unchanged.

CreateResult no longer copies all input fields to the output dataset
created.

Furthermore, if a Filter subclass doesn't provide `MapFieldOntoOutput`,
then the default implementation simply copies only the selected fields
to the output dataset.
2018-04-20 14:22:47 -04:00
Robert Maynard
3eb8294b24 Build vtkm::cont::DataSet into the vtkm_cont library. 2017-12-19 15:14:30 -05: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
Robert Maynard
5dd346007b Respect VTK-m convention of parameters all or nothing on a line
clang-format BinPack settings have been disabled to make sure that the
VTK-m style guideline is obeyed.
2017-05-26 13:53:28 -04:00
Kitware Robot
4ade5f5770 clang-format: apply to the entire tree 2017-05-25 07:51:37 -04:00
Kitware Robot
efbde1d54b clang-format: sort include directives 2017-05-18 12:59:33 -04:00
David C. Lonie
f601e38ba8 Simplify exception hierarchy.
Remove the ErrorControl class such that all subclasses now inherit from
error. Renamed all exception classes via s/ErrorControl/Error/.

See issue #57.
2017-02-07 15:42:38 -05:00
David C. Lonie
5020a8482f Add convenience getters for accessing field data by association. 2017-01-31 14:50:52 -05:00
Kenneth Moreland
fdaccc22db Remove exports for header-only functions/methods
Change the VTKM_CONT_EXPORT to VTKM_CONT. (Likewise for EXEC and
EXEC_CONT.) Remove the inline from these macros so that they can be
applied to everything, including implementations in a library.

Because inline is not declared in these modifies, you have to add the
keyword to functions and methods where the implementation is not inlined
in the class.
2016-11-15 22:22:13 -07:00
T.J. Corona
8ad8eeda77 In DynamicCellSet, expose CellSet API.
Also changes GetCellSet() to CastToBase().
2016-08-02 13:39:25 -04:00
Kenneth Moreland
f4362a4902 Give result classes their own header file.
VTK-m style guidelines dictate that all classes part of the API should
be in their own header file. Thus, we have moved the result classes out
of the filter header files and into their own headers.

We have also renamed these clases to ResultField and ResultDataSet to
better match the class naming conventions of VTK-m.

Since we are moving around these result classes, we have also revamped
their structure. They are now in a hierarchy with a common ResultBase
class. Additionally, all result classes have a reference to a complete
DataSet that can be considered the output of the filter. This will make
it easier for users to consistently deal with filter results.

These changes cover issues #60 and #62.
2016-05-05 15:07:55 -06: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
Kenneth Moreland
e863ee991a Change interface of VTKDataSetWriter
Make it match VTKDataSetReader better. It's also a bit easier to use
because you just have to give it a filename rather than open your own file
stream.
2016-03-16 15:35:38 -06:00
dpugmire
25a1e3c36f Cleanup and fix an issue in Explicit dataset testing with the initial merge. 2015-12-04 16:15:51 -05:00
T.J. Corona
0223f69a9c Adding Clear() method to DataSet. 2015-11-02 16:51:04 -05:00
T.J. Corona
a9425ac1bb In DataSet, add the ability to retrieve a cell set by name. 2015-10-02 08:31:57 -04:00
Kenneth Moreland
5b47354058 Rename CellType to CellShape.
We have been using the term "shape" in the cell set and connectivity
classes. To be consistent, use the term "shape" for the geometric
identify of the cell everywhere.
2015-08-27 16:25:59 -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
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
926f04e1d4 Move ExplicitConnectivity to ConnectivityExplicit
This is more consistent with VTK-m's naming convention.

Also made some minor changes and corrections.
2015-07-31 14:18:13 -06:00
Kenneth Moreland
b8febd1c01 DataSet now holds DynamicCellSet instead of smart_ptr<CellSet>
The Invoke of the topology dispatcher is also changed to expect a
concrete cell set (which the DynamicCellSet is automatically cast to)
rather than a connectivity structure. The dispatcher calls the
GetNodeToCellConnectivity method for you. (That is currently the only
one supported.)
2015-07-28 17:33:52 -06: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
342a9989a5 Correct double to float conversion warnings. 2015-06-04 09:06:47 -04:00
Robert Maynard
a61989a6d5 Redesign RegularStructure and RegularConnectivity to use vtkm::Vec.
By having them use vtkm::Vec the code becomes safer ( no bad indexes on dim=2).
Plus CellSetStructured becomes super simple.
2015-05-28 16:49:40 -04:00
Robert Maynard
a7bfc99579 DataSet now holds all CellSets by shared pointer.
This clarifies the ownership semantics of the CellSets.
2015-05-28 15:30:13 -04:00
Dave Pugmire
e1bbda8cae Add PrintSummary() for DataSet. 2015-05-20 15:26:10 -04:00
Jeremy Meredith
c55d764c50 adding coordinate systems instead of axis indices. 2015-05-20 12:46:00 -04:00
Jeremy Meredith
019e30a263 allow requesting fields by name, and make test data set names more sensible. 2015-05-20 11:46:04 -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
Dave Pugmire
5ddc1230bd Make regular conn/struct cont and export. Update other files to reflect the changes. 2015-05-15 15:29:55 -04:00
Robert Maynard
7c95b314b9 Allow user to get number of cellsets and number of fields. 2015-05-12 14:57:32 -04:00
Jeremy Meredith
8a382f138a fleshing out cell set and data set more. 2015-05-11 16:54:16 -04:00
Jeremy Meredith
5e2c22d9fa switching to using cell sets instead of connectivity objects in data set. 2015-04-15 13:01:00 -04:00
Jeremy Meredith
1629045986 adding initial cell set structures 2015-04-15 12:43:12 -04:00
Jeremy Meredith
2e7e3fff64 using dynamic array handle in field. 2015-04-15 12:33:27 -04:00
Jeremy Meredith
aadd307332 renaming to fix build errors. 2015-04-15 11:07:37 -04:00
Dave Pugmire
8294d500fe move connectivity into their own files 2015-04-15 10:45:39 -04:00