Commit Graph

27 Commits

Author SHA1 Message Date
Kenneth Moreland
2a41428fe4 Add implementation of ArrayRangeCompute for UnknownArrayHandle
This allows you to easily compute the range of any ArrayHandle, even if
you don't know the type.

A unit test for ArrayRangeCompute was also added.
2021-02-17 09:18:31 -07:00
Kitware Robot
cf0cdcf7d1 clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
luz.paz
80b11afa24 Misc. typos
Found via `codespell -q 3` via downstream VTK
2018-01-30 06:51:47 -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
b85cdd9080 Convert VTK-m over to use 'using' instead of 'typedef' 2017-08-07 14:05:43 -04:00
Kitware Robot
4ade5f5770 clang-format: apply to the entire tree 2017-05-25 07:51:37 -04:00
Ben Boeckel
7d09befc9f Merge topic 'vector-gradients'
2e05c1dd Support derivatives of vectors
dd45b568 Vec of Vec fixes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !630
2016-12-09 09:31:48 -05:00
Kenneth Moreland
dd45b5684b Vec of Vec fixes
Fix a couple of places where having a Vec of a Vec (for example
vtkm::Vec<vtkm::Vec<vtkm::Float32, 3>, 3>) did not work as it should.

One major place was in the test_equal function used in the testing
framework. If given a Vec of Vec, it would try to convert the Vec to
Float64 and fail. Now the comparison decends as many levels as need be.

The second place was in TypeTraits::ZeroInitialization() for all Vec
types. Originally it initialized the Vec using the default constructor
of the component type. This works fine when the component type is a
standard type, but if the component type is itself a Vec, then the
default constructor does not actually set any of the sub components.
Solved the issue by using the result of ZeroInitialization for the
component type, which will work for basic types and Vecs and anything
else supported by TypeTraits.
2016-12-05 14:41:33 -07:00
Kenneth Moreland
f53cd748f3 Add VecC and VecCConst structs
These structs behave much like Vec except that they work on a short C
array given to them rather than having the statically sized short array
defined within.

I expect to use this in the short term to help implement cell face
classes, but there are probably many other uses.
2016-12-01 15:04:22 -06: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
Robert Maynard
4a7085f415 Update VecTraits/TypeTraits to include types that VTK uses. 2016-02-22 14:20:25 -05:00
Kenneth Moreland
77568789ea Make vtkm::Pair behave as a better core type
These changes are basically to support some upcoming changes to
ArrayHandleZip. The major additions are an implementation of VecTraits
for Pair and an overloaded << operator to ostream for Pair.

I also had to declare the operator<< for Pair to be in Types.h. Under
some circumstances the operator has to either be declared before the
template is declared or declared in the vtkm namespace. (The reasons are
described at <http://clang.llvm.org/compatibility.html#dep_lookup> but I
still don't understand.) I tried adding it to the vtkm namespace, but
that caused several of the other operator<< to fail. Since there is no
way to guarantee that Pair.h is declared before, say, ArrayHandle.h, I
moved the implementation to Types.h.

Since I was moving operator<< to Types.h, I went ahead and moved the
TypeTraits and VecTraits to their respective headers. Since Pair is
declared (but not implemented) in Types.h, these templated classes can
be implemented without including Pair.h.
2015-09-20 00:01:04 -06:00
Kenneth Moreland
d0508264fa Fix typo TypeTraitsUnkownTag -> TypeTraitsUnknownTag
There was a simple typo in the tag. Since the tag is basically a
placeholder for an invalid value, the typo was missed.
2015-07-07 10:23:10 -06:00
Robert Maynard
eb7e388adc Properly initialize vtkm::Pair, and remove the TypeTrait for it.
vtkm::Pair can hold vtkm::Vec so we need to call the proper constructor
for vtkm::Vec.

Now that vtkm::TypeTraits don't error out on unknown types, we don't need
the weird specialization for vtkm::Pair.
2015-06-16 13:06:08 -04:00
Robert Maynard
095f25c3ac vtkm::TypeTraits now work on all types. Plus has ZeroInit helper function. 2015-06-16 08:34:29 -04:00
Robert Maynard
ee4687f8ee Allow vtkm::Pair Dimension and Numeric Tab to be found.
For now the pair's numeric type is determined by the first elements type.
2015-06-10 14:15:39 -04:00
Robert Maynard
6b8e7822be The Copyright statement now has all the periods in the correct location. 2015-05-21 10:30:11 -04:00
Kenneth Moreland
7f94eafc9c Remove vtkm::Scalar and vtkm::Vector# types
Providing these types tends to "lock in" the precision of the algorithms
used in VTK-m. Since we are using templating anyway, our templates
should be generic enough to handle difference precision in the data.
Usually the appropriate type can be determined by the data provided. In
the case where there is no hint on the precision of data to use (for
example, in the code that provides coordinates for uniform data), there
is a vtkm::FloatDefault.
2014-10-09 08:54:56 -06:00
Kenneth Moreland
0cc9d27e26 Expand the list of types to include multiple widths.
Since we want our code to generally handle data of different precision
(for example either float or double) expand the types in our list types
to include multiple precision.
2014-10-08 15:40:20 -06:00
Kenneth Moreland
c3fbe073e8 Change VectorTraits to VecTraits.
Matches the previous move from Tuple to Vec. We can unify on this name.
2014-10-08 10:09:43 -06:00
Kenneth Moreland
2139d93206 Change vtkm::Tuple to vtkm::Vec
There are multiple reasons for this name change:

* The name Tuple conflicts with the boost::Tuple class, which as a
different interface and feature set. This gets confusing, especially
since VTK-m uses boost quite a bit.

* The use of this class is usually (although not always) as a
mathematical vector.

* The vtkm::Scalar and vtkm::Vector* classes are going to go away soon
to better support multiple base data type widths. Having this
abbriviated name will hopefully make the code a bit nicer when these
types have to be explicitly specified.

Also modified the implementation a bit to consolidate some of the code.
2014-10-08 10:09:43 -06:00
Kenneth Moreland
cbe6284b83 Add IdComponent and other base types with explicit widths
In preparation for supporting base types with more widths, add typedefs
for the base types with explicit widths (number of bits).

Also added a IdComponent type that should be used for indices for
components into tuples and vectors. There now should be no reason to use
"int" inside of VTK-m code (especially for indexing). This change cleans
up many of the int types that were used throughout.
2014-10-08 10:09:42 -06:00
Kenneth Moreland
ed9cf46a17 Make sure all header wrapper macros start with vtk_m_ rather than vtkm_
We made this change a while ago to help with completion in IDEs.
(Completion was matching a bunch of wrapper macros that were almost
never used anywhere.) Most of the changes are in comments, but there are
a few bad macro definitions.
2014-06-11 10:43:36 -06:00
Robert Maynard
2b7a0e0490 revise the header guard naming convention to not conflict with macro names. 2014-03-07 10:22:36 -05:00
Robert Maynard
c80fb9259f Update the initial repository to use the correct indentation style. 2014-02-11 16:20:30 -05:00
Robert Maynard
c07301a993 Add in primitive types to vtkm (Id, Scalar, Tuple).
This includes the configure scripts to setup if you want a 32bit or
64bit build.
2014-02-10 15:00:17 -05:00