Commit Graph

48 Commits

Author SHA1 Message Date
Kenneth Moreland
282aa82957 Add guide chapter on working with cells 2024-03-13 09:18:33 -04:00
Kenneth Moreland
3e1339f9a7 Remove deprecated features from VTK-m
With the major revision 2.0 of VTK-m, many items previously marked as
deprecated were removed. If updating to a new version of VTK-m, it is
recommended to first update to VTK-m 1.9, which will include the deprecated
features but provide warnings (with the right compiler) that will point to
the replacement code. Once the deprecations have been fixed, updating to
2.0 should be smoother.
2022-11-17 07:12:31 -06:00
Robert Maynard
3029994a97 Remove some unneeded include statements from vtkm/exec 2020-06-22 09:28:51 -04:00
Kenneth Moreland
0748725806 Make sure return value of cell operations is initialized
Even if an error condition occurs, the output parameter should be
initialized to something. This makes the behavior predicatable on error
conditions and prevents uninitialized variable warnings.
2020-03-14 00:24:13 -06:00
Kenneth Moreland
51e817adc1 Introduce vtkm::ErrorCode
This is a flag that functions in the execution environment can return to
report on the status of the operation. This way they can report an error
without forcing the entire invocation to shut down.
2020-03-13 18:58:33 -06:00
Kenneth Moreland
04edc3d202 Avoid raising errors when operating on cells
Cell operations like interpolate and finding parametric coordinates can
fail under certain conditions. Typically these call RaiseError on the
worklet. But that can make a worklet unstable, so provide paths where no
error is raised.
2020-03-12 07:50:01 -06:00
Sujin Philip
b0592ce4c8 Switch from VTK-c to LCL 2019-10-07 15:38:36 -04:00
Sujin Philip
e08d862f94 Use Light-Weight Cell Library 2019-09-24 21:22:10 -04:00
Kenneth Moreland
6c136b978e Remove vtkm::BaseComponent
This functionality has been superseded by VecTraits::BaseComponentType.
The new functionality also supports replacing the BaseComponentType.
2019-09-09 13:01:03 -06:00
Kenneth Moreland
74e0c58046 Fix some precision warnings 2019-08-30 11:33:17 -06:00
Kenneth Moreland
75a060a243 Fix cell derivatives for polygon cell shape
For polygon cell shapes (that are not triangles or quadrilaterals),
interpolations are done by finding the center point and creating a
triangle fan around that point. Previously, the gradient was computed in
the same way as interpolation: identifying the correct triangle and
computing the gradient for that triangle.

The problem with that approach is that makes the gradient discontinuous
at the boundaries of this implicit triangle fan. To make things worse,
this discontinuity happens right at each vertex where gradient
calculations happen frequently. This means that when you ask for the
gradient at the vertex, you might get wildly different answers based on
floating point imprecision.

Get around this problem by creating a small triangle around the point in
question, interpolating values to that triangle, and use that for the
gradient. This makes for a smoother gradient transition around these
internal boundaries.
2019-08-29 17:37:42 -06:00
Kenneth Moreland
c19b312e58 Fix gradient issue at apex of pyramid cells
The gradient is malformed at the apex of a pyramid. To get around this,
steal a trick from the VTK source where in this case interpolate some
values a little bit into the interior of the cell.

Also expand the gradient worklet tests to include all cell types.
2019-08-19 16:40:58 -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
Dave Pugmire
d6898b8052 Fix cell deriv for polylines and remove print statements. 2019-05-28 13:25:23 -04:00
Dave Pugmire
489995782f Support for polylines. 2019-05-17 13:35:35 -04:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Sujin Philip
50248aec9c Fix implicit conversion loses floating-point precision warning 2018-06-22 13:45:42 -04:00
David Thompson
00c7905afb Rename vtkm::dot() to vtkm::Dot().
This keeps the old name around but prepares it for removal
in the next release.
2018-05-17 08:51:01 -04:00
Utkarsh Ayachit
1644451715 CellDerivative: fix type conversion warnings 2018-05-08 14:52:22 -04:00
Robert Maynard
6267deb67e CellDerivativeFor3DCell has a better version for Vec of Vec fields.
Previously we would compute a 3x3 matrix where each element was a Vec. Using
the jacobain of a single component is sufficient so by using that we safe 2 to
3 times the memory space.

Additionally by moving to doing the derivative as a per component algorithm
we work around the issues found in bug
https://gitlab.kitware.com/vtk/vtk-m/issues/221. In effect when trying to
construct a Vec of Vec from a component of a different floating type e.g.:

  Vec3d x(0.0, 1.0, 2.0);

  Vec3f a = x;
  Vec3x3f b = x;
  Vec3x3f c(x, x, x);

Generates bad values vectors such as b which look like:

b: [[0,0,0],[1,1,1],[2,2,2]]
c: [[0,1,2],[0,1,2],[0,1,2]]
2018-04-27 08:14:34 -04:00
Kenneth Moreland
43da67f747 Fix Jacobian cases for wedge and pyramid
When the implementation for the cell derivative functions was made, the
special cases for creating the Jacobian for wedge and pyramid cell
shapes was not working. Instead, it just used the hexahedra case for a
degenerate cell. This fixes the issues with the special cases.

There were multiple issues to be fixed. There were some complaints
by the compiler about types. There was a mistake in the pyramid table.
But the biggest issue was a problem with macro expansions. It was
the classic tale of forgetting that you have to encase parameters
in parenthesis to make sure that operator precedence comes out as
expected.
2018-01-31 15:45:12 -07:00
Allison Vacanti
40441e78e6 Fix some additional warnings. 2017-10-23 11:48:19 -04: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
f68635941e Convert VTK-m over to use 'using' instead of 'typedef' 2017-08-17 10:47:25 -04:00
David C. Lonie
fb2d36be1e Refactor VecRectilinearPointCoordinates.
See #163.
2017-07-07 13:49:35 -04: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
Sujin Philip
b455636bcd Move BaseComponentOf to vtkm::BaseComponent 2017-03-07 14:46:55 -05:00
Robert Maynard
d1336c7f84 CellDerivativeFor2DCell now creates Space2D of the correct type.
Previously vtkm::Vec<> fields would construct Space2D types incorrectly
2016-12-12 13:26:16 -05:00
Kenneth Moreland
2e05c1dd03 Support derivatives of vectors
The cell derivative/gradient functions were all designed with scalars in
mind. Although the field type is templated and you could pass in a
vector type for the field, many of these classes would perform the
computation incorrectly. These changes specifically support derivatives
of vector types.
2016-12-05 23:04:35 -07: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
d53f43fb48 CellDerivaties now support computing the derivatives of vtkm::Vec fields. 2016-11-15 18:54:53 -05:00
Robert Maynard
7c07afffba Reduce the compilation size of the gradient computations. 2016-11-11 14:36:51 -05:00
Kenneth Moreland
b87cac7492 Fix warnings about unused parameters. 2016-04-21 09:32:02 -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
Robert Maynard
ec1e1a3adf Fix warnings about unreachable break statement in CellDerivative. 2016-04-01 13:47:41 -04:00
Chuck Atkins
f74c0d3c88 Remove type conversion related warnings for GCC 2016-03-17 13:05:38 -04:00
Kenneth Moreland
1a538ca196 Merge branch 'scatter-worklets' into 'master'
Scatter in worklets

Add the functionality to perform a scatter operation from input to output in a worklet invocation. This allows you to, for example, specify a variable amount of outputs generated for each input.

See merge request !221
2015-11-11 13:09:47 -05:00
Kenneth Moreland
8ef0a4ee50 Fix conversion warnings.
Recent changes to algorithm implementations caused CellDerivative to be
called in a way such that it gave conversion warnings on some compilers.
Fix that.
2015-11-07 13:13:17 -07:00
Kenneth Moreland
0d394db0ce Fix conversion warnings when using double precision.
There were some conversion warnings issued when the default float was set
to 64-bit. Fixed these (on clang).
2015-11-07 06:35:24 -07:00
Kenneth Moreland
20c5819397 Remove unused typedef
A typedef in a method was left over from a copy/paste. Although
harmless, it was causing a (valid) warning on some compilers.
2015-09-02 13:54:54 -07:00
Kenneth Moreland
b58543297a Special implementation of cell derivative for rectilinear cells 2015-09-02 13:50:31 -07: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
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