Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexible cell arrays? #484

Open
dsakurai opened this issue Sep 7, 2020 · 1 comment
Open

Flexible cell arrays? #484

dsakurai opened this issue Sep 7, 2020 · 1 comment

Comments

@dsakurai
Copy link
Contributor

dsakurai commented Sep 7, 2020

This is a discussion / feature request.

TTK has a new implementation of setInputCells due to VTK9.
Although most application may be unaffected by the new design, the requirements are at least redundant for most non-VTK applications of TTK and increases the RAM usage for somewhat. I wanted to shed light on the topic with this issue.

I am neutral about this issue since it is not a bug.
Core TTK devs may be interested in taking time for a flexible approach if that's worth (fixing this issue does not take too much time).

Problems

TTK's new ExplicitTriangluation::setInputCells method assumes the VTK9's new convention, that takes as input LongSimplexId* connectivity and LongSimplexId* offset.

I have used it from a non-VTK application and had a few thoughts that may be relevant to a wider range of third-party app developers:

These arrays are of ttk::LongSimplexId, i.e. long long int, where the rest of TTK assumes ttk::SimplexId, i.e. int.

For desktop applications, and actually for most HPC applications I know, there's no point of using long long int is an overkill. (Edit: strike through words and add italic ones.)
It merely increases the RAM usage for four times to store cells.
My program copies its own cell array in ttk::SimplexId to a new one in ttk::LongSimplexId just for passing it to TTK's triangulation (edit: this is not critical but redundant).

i'th element of the offset array is always (d+1) x i for d-dimensional triangulated domain (with the exception of the last element)

This is a waste of RAM if the domain is made only of triangles, which is quite often the case for topological analysis even in VTK and ParaView. (Edit: setInputCells apparently assumes this, so this array is probably unnecessary indeed.)

The last element of offset array is unnecessary for TTK
Because setInputCells takes an integer input to receive the same information anyway.

Fix?

For example, the data type of connectivity could be templatized to allow ttk::SimplexId or even a custom function.
The last element of offset, as well as this array itself, can be made optional.

@julien-tierny
Copy link
Collaborator

julien-tierny commented Sep 7, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants