Commit Graph

26 Commits

Author SHA1 Message Date
Kenneth Moreland
29c96a24fa Rename structured connectivity index conversion methods
The structured connectivity classes are templated on two tags to
determine what 2 incident topological elements are being accessed. Back
in the day, these were called the "from" elements and "to" elements, as
taken from VTK filter names like `PointDataToCellData`. However, these
names were found to be very confusion, and after much debate they have
been renamed to the visit element type and the incident element type.
Meaning that a worklet is "visiting" elements of a particular type (such
as visiting each cell) and can access "incident" elements of a
particular type (such as the points incident on the cell).

I found a few methods converting flat and logical indices using the old,
confusing from/to convention. This changes them to the new convention.
2023-06-02 15:31:24 -04:00
Kenneth Moreland
d2d9ba3321 Make connectivity structures trivially copyable
It always worked to trivially copy these classes, but the compiler did
not think so because copy constructors were defined. Change these
constructors to be default so that the compler can properly check
triviality.
2021-03-30 12:59:07 -06:00
Li-Ta Lo
e52b8fa88a Add CellNeighborhood 2020-07-15 14:41:32 -06:00
Robert Maynard
65347bf948 Correct warnings found by GCC 9.2 2019-12-02 09:33:35 -05:00
Allison Vacanti
5db762ee71 Refactor topology mappings to clarify meaning.
The `From` and `To` nomenclature for topology mapping has been confusing for
both users and developers, especially at lower levels where the intention of
mapping attributes from one element to another is easily conflated with the
concept of mapping indices (which maps in the exact opposite direction).

These identifiers have been renamed to `VisitTopology` and `IncidentTopology`
to clarify the direction of the mapping. The order in which these template
parameters are specified for `WorkletMapTopology` have also been reversed,
since eventually there may be more than one `IncidentTopology`, and having
`IncidentTopology` at the end will allow us to replace it with a variadic
template parameter pack in the future.

Other implementation details supporting these worklets, include `Fetch` tags,
`Connectivity` classes, and methods on the various `CellSet` classes (such as
`PrepareForInput` have also reversed their template arguments. These will need
to be cautiously updated.

The convenience implementations of `WorkletMapTopology` have been renamed for
clarity as follows:

```
WorkletMapPointToCell --> WorkletVisitCellsWithPoints
WorkletMapCellToPoint --> WorkletVisitPointsWithCells
```

The `ControlSignature` tags have been renamed as follows:

```
FieldInTo --> FieldInVisit
FieldInFrom --> FieldInMap
FromCount --> IncidentElementCount
FromIndices --> IncidentElementIndices
```
2019-08-06 11:27:26 -04:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Sujin Philip
6d81bc8b06 Implement extents support
Adds a variable `GlobalPointIndexStart` to `CellSetStructured`.
Adding this to the cell-set, instead of the coordinate system, enables this
feature for different types of datasets like uniform grid, rectilinear, etc.,
with this one change.
The extents can be computed using `GlobalPointIndexStart` and `PointDimensions`.
2018-12-03 15:56:45 -05:00
Robert Maynard
1147edb192 MarchingCubes now uses Gradient fast paths when possible.
When running on image data we now use central differences to compute the point
gradient
2017-09-25 14:25:28 -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
Kenneth Moreland
897ec9ff5e Test and fix issues with WholeCellSetIn with structured grids 2017-07-28 15:02:05 -06:00
Kitware Robot
4ade5f5770 clang-format: apply to the entire tree 2017-05-25 07:51:37 -04:00
Robert Maynard
6da48cf3c1 Remove unneeded methods from the Connectivity classes. 2017-05-23 10:49:19 -04: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
6883a5ac94 Simplify using CellSetPermutation by providing a default permutation type.
Previously you had to explicitly state you wanted a CellSetPermutation
with an ArrayHanlde of Id's, now that is done automatically.
2016-04-12 14:24:51 -04:00
mclarsen
03a95c44b1 adding rendering from other branch 2016-03-28 08:50:04 -04:00
Kenneth Moreland
bf03243516 Add ability to multiply any Vec by vtkm::Float64.
This has been requested on the mailing list to make it easier to
interpolate integer vectors.

There are a couple of downsides to this addition. First, it implicitly
casts doubles back to whatever the vector type is, which can cause a
loss of precision. Second, it makes it more likely to get overload
errors when multiplying with Vec. In particular, the operator to cast
Vec of size 1 to the component class had to be removed.
2015-11-07 06:33:50 -07:00
Kenneth Moreland
99ce66c6fe Change Fetches to use ThreadIndices instead of Invocation.
Previously, all Fetch objects received an Invocation object in their
Load and Store methods. The point of this was that it allowed the Fetch
to get data from any of the execution objects. However, every Fetch
either just got data directly from its associated execution object or
else used a secondary execution object (the input domain) to get indices
into their own execution object.

This left two potential areas for improvement. First, pulling data out
of the Invocation object was unnecessarily complicated. It would be much
nicer to get data directly from the associated execution object. Second,
when getting index information from the input domain, it was often the
case that extra computations were necessary (particularly on structured
cell sets). There was no way to share the index information among
Fetches, and therefore the computations were replicated.

This change removes the Invocation from the Fetch Load and Store.
Instead, it passes the associated execution object and a new object type
called the ThreadIndices. The ThreadIndices are customized for the input
domain and therefore have all the information needed for a redirected
lookup. It is also a thread-local object so it can cache computed
indices and save on computation time.
2015-10-07 17:01:42 -06:00
Kenneth Moreland
08f9c04fab Add specialization of topology map fetch for regular point coords
In the special case where you are loading the point coordinates for a
structured grid in a point to cell map (an important use case), create a
VecRectilinearPointCoordinates rather than build a Vec of the values.
This will activate the cell specalizations in previous commits.

These changes also added some flat-to-logical index conversion and vice
versa in ConnectivityStructuredInternals. This change also fixed a bug
in getting cells attached to points in 2D grids. (Actually, technically
someone else fixed it and checked it in first. The changes were merged
during a rebase.)

I also added a specalization to Vec for 1D that implicitly converts
between the 1D Vec and the component. This can be convenient when
templating on the Vec length.
2015-09-02 13:54:51 -07: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
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
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
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