Commit Graph

107 Commits

Author SHA1 Message Date
Kenneth Moreland
33edcc940d Make sure variables are initialized in error conditions
There are several switch statements in ParametricCoordinates.h that have
a default clause that is an error condition. The code was simply calling
the RaiseError method on the worklet before quiting. Although the
behavior is supposed to be similar to throwing an exception, flow
actually does still continue. These error default clauses kept going
without breaking from the switch or initializing the variables the
method is supposed to set. Although the values should not matter once
the error is raised, I was getting compiler warnings about it. It's also
bad practice as certain NaN values can cause the program to signal out,
so it is best to set the data to something.
2015-08-27 22:13:19 -06:00
Kenneth Moreland
9abaf0190f Fix gcc warnings
Fixed some gcc warnings about unused scoped typedefs and implicit
conversion issues.
2015-08-27 17:39:45 -06:00
Kenneth Moreland
947178e7e4 Remove pixel and voxel cell types
These cell types are inherited from VTK, but they are basically the same
as quad and hexahedron, respectively. The only useful difference is that
pixel and voxel are supposed to be axis aligned, but you cannot
determine that by the cell shape alone (at least not just from the cell
set).

A big issue with these is that their indexing is different that of quad
and hex. The development team had a long discussion about the benefits
of the alternate indexing, but after consulting with Berk Geveci and
Will Schroder from the VTK team, that indexing is not really taken
advantage of at the cell level. Thus, it is really just a nuisance in
VTK-m.
2015-08-27 17:03:13 -06:00
Kenneth Moreland
fe65124922 Change the way polygons are interpolated.
The original way was overconstrained with respect to the number of
parametric coordinates.

Also implemented WorldCoordinatesToParametricCoordinates for polygons.
2015-08-27 16:31:08 -06:00
Kenneth Moreland
5bcad152e0 WorldCoordinatesToParametricCoordinates functions
The general polygon version is not implemented yet because I need to
change the way it is interpolated.

To get wedge to work correctly, I had to change the interpolation
slightly there. Previously the interpolation had a singularity at
the tip.
2015-08-27 16:31:07 -06:00
Kenneth Moreland
936bbd33d0 Add Newton's Method function. 2015-08-27 16:31:07 -06:00
Kenneth Moreland
a7c33b5c07 Make cell code more consistent.
The functions for doing interpolations and derivatives were called
CellInterpolate and CellDerivative, but the file names were
Interpolate.h and Derivative. Now the files are CellInterpolate.h and
CellDerivative.h so they are more consistent and a bit easier to find.

The interpolate and derivative functions has the shape tag at end of the
function arguments (just before the "worklet" parameter, which is just
the error handling mechanism). However, the parametric coordinate
functions had the shape tag at the beginning. Moved the shape tag to the
end to be more consistent within these functions and also in other uses
throughtout VTK-m.
2015-08-27 16:31:07 -06:00
Kenneth Moreland
457720bd63 Add derivative functions. 2015-08-27 16:31:07 -06:00
Kenneth Moreland
5a896c6ce7 Add tests for interpolate functions.
Also tests the current parametric coordinates methods. The added test
lead to some minor corrections and additions.
2015-08-27 16:31:06 -06:00
Kenneth Moreland
29766bd3a2 Add queries for standard parametric coordinates.
Be able to get the parametric coordinates for the center and the nodes
of each cell shape.
2015-08-27 16:31:06 -06:00
Kenneth Moreland
9551824c8e Add methods to interpolate all cell types. 2015-08-27 16:31:06 -06:00
Kenneth Moreland
3e251de469 The CellShape fetch returns a tag rather than ID.
Previously, when you requested a CellShape in the ExecutionSignature,
you just got an ID stored in a vtkm::IdComponent. This change returns a
cell shape tag of the appropriate type (or generic if the type is not
known at compile time). This will allow functions called from the
worklet to specialize on the cell type better.
2015-08-27 16:31:06 -06:00
Kenneth Moreland
c81bc3d501 Add CellShapeTag classes
Each cell shape id has an associated cell shape tag. There is also a
macro to write functions that are conditional on the cell shape.
2015-08-27 16:30:58 -06: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
Sujin Philip
e2129364a4 Fix ExecutionWholeArray
The constructor for execution whole array was wrong and would result in compilation error if used. This fixes that and adds a test path for testing ExecutionWholeArray with ExecutionWholeArrayConst.
2015-08-24 14:42:22 -04:00
Kenneth Moreland
cf6af174eb Merge branch 'variable-topology-fields' into 'master'
Variable topology fields

Changes to fetching in topology maps that lets you properly deal with cases where you do not know how many values are being fetched at compile time. For example, explicit cell sets can have any number of cell shapes that have different numbers of nodes.

This change should resolve issue #26.

See merge request !128
2015-08-19 11:27:43 -04:00
Robert Maynard
c49684a2df Merge branch 'workaround_thrust18_inc_scan_bug' into 'master'
Workaround thrust 1.8 inclusive scan issue.

Starting in thrust 1.8 the implementation of scan inclusive inside
thrust became highly optimized by using parallel task groups. This
new implementation has a bug that only exists when using custom
binary operators, large size arrays, release mode, and no
debugger or mem-checker attached.

While I have submitted the issue to thrust, we need to be able
to work around the existing issue. The solution I have chosen is
to mark all vtkm::exec::cuda::interal::WrappedBinaryOperators
as being commutative as far as thrust is concerened. To make
sure we don't get any unexpected behavior I have also had
to create WrappedBinaryPredicate so that we don't mark any
predicate as commutative.

See merge request !129
2015-08-17 14:36:26 -04:00
Robert Maynard
157d8efee4 Workaround thrust 1.8 inclusive scan issue.
Starting in thrust 1.8 the implementation of scan inclusive inside
thrust became highly optimized by using parallel task groups. This
new implementation has a bug that only exists when using custom
binary operators, large size arrays, release mode, and no
debugger or mem-checker attached.

While I have submitted the issue to thrust, we need to be able
to work around the existing issue. The solution I have chosen is
to mark all vtkm::exec::cuda::interal::WrappedBinaryOperators
as being commutative as far as thrust is concerened. To make
sure we don't get any unexpected behavior I have also had
to create WrappedBinaryPredicate so that we don't mark any
predicate as commutative.
2015-08-17 10:39:14 -04:00
Kenneth Moreland
e301ba0a98 Replace BOOST_MPL_ASSERT with BOOST_STATIC_ASSERT
BOOST_MPL_ASSERT is causing warnings in the PGI compiler. Apparently,
when BOOST_MPL_ASSERT succeeds it declares a static object with a unqiue
name scoped to the file. The problem is that the PGI compiler is pretty
picky about things being declared without being used, so it was emitting
useless warnings about successful BOOST_MPL_ASSERTs. However,
BOOST_STATIC_ASSERT does not seem to have this problem, so for the benefit
of PGI change the compile-time assert method.
2015-08-14 21:16:12 +00:00
Kenneth Moreland
50ac3af910 Fix PGI compiler issues.
The PGI compiler is fussy about finding declared variables and methods
that have limited scope and are never used. Thus, it is complaining about
some internal test classes that are properly implementing the ArrayPortal
interface even though not all of it is being accessed.

To get around the problem, put them in a non-anonymous namespace with a
name unlikely to conflict with anything. The compiler will recognize that
it is possible to access these classes outside the scope of the file and
shut up about items not being used.
2015-08-14 21:03:38 +00:00
Kenneth Moreland
07ca62e2af Add some documentation on how ConnectivityExplicit::GetIndices works. 2015-08-14 12:01:52 -06:00
Kenneth Moreland
6598b296a6 Remove TopologyData class.
This class was used to store a group of from field data in a topology
map. However, the fetching has been changed to use a customized class
for each type of fetch that can be optimized for the fetch type and does
not require to know the number of items in the fetch at compile time.
Thus, this class is no longer needed, so it is being removed.
2015-08-14 09:17:34 -06:00
Kenneth Moreland
f7a6946d9a Use variable Vec-like objects for topology map fetching
This change removes the requirement to specify some maximum cell length
in each of the worklets, which is basically impossible. It also makes
some of the loading more lazy, which might help reduce the number of
registers required in a worklet.
2015-08-14 09:17:13 -06:00
Kenneth Moreland
891979e3fa Added VecFromPortalPermute class. 2015-08-14 09:15:47 -06:00
Kenneth Moreland
2394de8c95 Fetch explicit indices as vec-like
Previously when you fetched the indices from an explicit cell set, you
would get back a Vec of a fixed length an expected to use a subset of
it. Now you get back a Vec-like object that reports the exact length.

This Vec-like is implemented with VecFromPortal, so that the data does
not need to be copied to the stack. Rather, it is pulled from memory as
requested.
2015-08-14 09:15:47 -06:00
Kenneth Moreland
c9d95298b0 Added VecFromPortal class. 2015-08-14 09:15:47 -06:00
Kenneth Moreland
c847f0b148 Get FromIndices as unknown type.
We want to be able to get topological connections where it is difficult
to know how many values you get each time. In this change, the type of
the vector holding the from indices is determined from the connectivity
object, and the worklet does not know the type (it must be templated).

Although you do not need to specify the max number for this value set
(you still currently do for field values), we still need to change the
type for explicit sets that uses something that does not rely on the Vec
class. The cell-to-point method also needs a Vec wrapper that allows it
to shorten the vector dynamically.
2015-08-14 09:15:46 -06:00
Robert Maynard
ab59e34a2f Rename pragma header guard so it makes sense for tbb and thrust.
Boost is not the only thirdparty that we are supressing warnings for, so
make the name more generic.
2015-08-13 09:04:23 -04:00
Robert Maynard
8204db2f6a Use VTKM_BOOST_PRE_INCLUDE around thrust headers too. 2015-08-13 08:26:41 -04:00
Kenneth Moreland
42aba97728 Add in-place (in-out) arrays to worklets.
Previously, all arrays passed to worklets were designated as either
input or output. No in-place operation was permitted. This change adds
the FieldInOut tag for ControlSignature in both WorkletMapField and
WorkletMapTopology that allows you to read and write from the same
array.
2015-08-12 14:41:56 -06:00
Kenneth Moreland
1862970a0b Reintroduce explicit connectivity class for cont environment
(Re-) Add a helper structure that holds the connectivity information for
a particular topology connection (e.g. from points to cells) to make it
easier to manage connections in multiple different directions in
CellSetExplicit.

Unlike the previous version of connectivity, this structure is
considered "internal" and not exposed through the API so that
CellSetExplicit can better manage the data. Also, many of the helper
methods remain in CellSetExplicit since they were specific for point-to-

Also, CellSetExplicit has a mechanism to take an arbitrary pair of
TopologyElementTags and get the appropriate connectivity. This should
simplify adding connections in the future.
2015-08-11 12:42:34 -06:00
Kenneth Moreland
63b45ad1e5 Consistently use from/to for topological links
In the CellSet and related classes, a connection was referred to by a
"from" topology element and a "to" topology element. However, in the
worklet control signature tags the elements were referred to by "src"
and "dest." To make things consistent, use "from" and "to" everywhere.
2015-08-03 10:48:50 -06: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
Kenneth Moreland
7212469d04 Roll connectivity information into CellSet in control environment
Previously there was a Connectivity* structure for both the control
environment and the execution environment. This was necessary before
because the connectivity is explicit to the from and to topology
elements, so you would get this structure from the appropriate call to
CellSet*. However, the symantics are changed so that the type of
connectivity is selected in the worklet's dispatcher. Thus, it is now
much cleaner to manage the CellSet structure in the CellSet class itself
and just have a single set of Connectivity* classes in the execution
environment.
2015-08-02 15:59:44 -06:00
Kenneth Moreland
b392dc509e Move RegularStructure to ConnectivityStructuredInternals
Also moved from vtkm namespace to vtkm::internal namespace. This change
is to then move the structured connectivity classes to the cont and exec
namespaces.
2015-07-31 15:48:06 -06: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
04fce28ae3 Deal with small integer promotions
C and C++ has a funny feature where operations on small integers (char
and short) actually promote the result to a 32 bit integer. Most often
in our code the result is pushed back to the same type, and picky compilers
can then give a warning about an implicit type conversion (that we
inevitably don't care about). Here are a lot of changes to suppress
the warnings.
2015-07-30 17:41:58 -06:00
Kenneth Moreland
21b3b318ba Always disable conversion warnings when including boost header files
On one of my compile platforms, GCC was giving conversion warnings from
any boost include that was not wrapped in pragmas to disable conversion
warnings. To make things easier and more robust, I created a pair of
macros, VTKM_BOOST_PRE_INCLUDE and VTKM_BOOST_POST_INCLUDE, that should
be wrapped around any #include of a boost header file.
2015-07-30 17:40:40 -06:00
Robert Maynard
bb582ae4ec Update the cuda IteratorFromArrayPortal to use ptrdiff_t.
This make the advance / distance_to function signatures constant no matter
if we are building with 32/64 bit ids.
2015-07-29 09:57:42 -04:00
Robert Maynard
98d6e99275 Correct some warnings about 64bit to 32bit conversion. 2015-07-23 09:29:10 -04:00
Robert Maynard
e74ded809a Defer more thrust iterator deduction logic to ArrayPortalToIterators. 2015-07-14 10:11:12 -04:00
Robert Maynard
4ba1f7c853 Remove the need for any portal to define an IteratorType. 2015-07-13 17:16:27 -04:00
Kenneth Moreland
4fc3626712 Fix compiler directives for icc
The Intel icc compiler tries to pretend it is gcc, but it sometimes
behaves differently. Add more explicit checks for what compiler is
being used.
2015-07-06 10:35:06 -06:00
Kenneth Moreland
e19e0ea551 Merge branch 'mesh-simplify-changes' into 'master'
Some fixes to VertexClustering

VertexClustering previously only worked with data of a specific floating
point type (32 bit for point coordinates). Add some templates to accept
either 32 bit or 64 bit floating points for point coordintes and be a
bit more careful about implicit type conversions.

I also made some changes to conform better with the VTK-m coding
standards. The most common changes are using 2 space indentation for all
block levels, capitolizing and using camel case for all class members,
and prefixing "this->" to all use of internal class members.

See merge request !64
2015-06-29 18:14:19 -04:00
Kenneth Moreland
cc8a5d35ec Some fixes to VertexClustering
VertexClustering previously only worked with data of a specific floating
point type (32 bit for point coordinates). Add some templates to accept
either 32 bit or 64 bit floating points for point coordintes and be a
bit more careful about implicit type conversions.

I also made some changes to conform better with the VTK-m coding
standards. The most common changes are using 2 space indentation for all
block levels, capitolizing and using camel case for all class members,
and prefixing "this->" to all use of internal class members.
2015-06-29 15:14:50 -06:00
Robert Maynard
d7e85bb6ae Implement a way to pass a portal to worklet as a parameter.
This is built ontop of the ExecutionObjectBase work, and is designed to show
other developers how they can create custom objects that are shared among
all worklets, but are passed as parameters to the worklet.
2015-06-26 16:26:51 -04:00
Robert Maynard
2d7e44de62 Make it so that we actually use cuda texture memory loads.
By mistake the cuda texture memory load code was not being used, so correct
that issue and allow loading of vtkm::Vec and primitive types. Currently
the only issue is loading int8/int16 uint8/uint16 through texture memory.
2015-06-25 08:21:49 -04:00
Robert Maynard
9ef7fa9b3a Merge branch 'iterator_operator_square_bracket_corrected' into 'master'
Make sure we use ptrdiff_t for index into arrays.

This is a requirement since you can use negative indices into arrays.

See merge request !41
2015-06-16 13:09:17 -04:00
Robert Maynard
726c914ee5 Make sure we use ptrdiff_t for index into arrays.
This is a requirement since you can use negative indices into arrays.
2015-06-16 11:00:01 -04:00
Robert Maynard
eb6c698e63 Remove un-needed overloads from WrappedOperators for cuda. 2015-06-16 09:48:12 -04:00