-
Notifications
You must be signed in to change notification settings - Fork 119
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
PreprocessVertexTriangles 2D Unstructured Grid #83
Comments
CharlesGueunet
changed the title
ProprocessVertexTriangle 2D Unstructured Grid
PreprocessVertexTriangle 2D Unstructured Grid
Feb 14, 2018
CharlesGueunet
changed the title
PreprocessVertexTriangle 2D Unstructured Grid
PreprocessVertexTriangles 2D Unstructured Grid
Feb 14, 2018
hi Charles,
thanks for the issue.
This function bug in the case of a 2D VTK Unstructured Grid (Segmentation
Fault).
that's a problem indeed.
As far as I understand, it seems that this function should not be used in
2D.
absolutely, but at least it should not crash.
I started a series of edits to fix this (see commit f629e75), such that
triangles always mean triangles (even in 2D where the notion of cell was
preferred so far for this) and that edges always mean edges (even in 1D where
the notion of cell was preferred so far for this).
technically, this adds one if statement for a bunch of low-level access
functions. for instance, getVertexTriangle() now needs to check the dimension
of the triangulation to understand what to return (an actual triangle in 3D,
or a "cell" in 2D).
this will have an effect on performance. but it seems that in your case, such
an if statement is mandatory: either in your code or in the triangulation API.
it seems it might be best to put that in the triangulation API like I did
(that may make the API more intuitive to other users).
can you check that my commit fixes your issue?
I'll progressively take care of the other functions in the near future.
cheers,
--
Dr Julien Tierny
CNRS Researcher
Sorbonne Universite
http://lip6.fr/Julien.Tierny
…On Wednesday, February 14, 2018 4:54:47 PM CET Charles Gueunet wrote:
Dear TTK Team,
I am actually developing a TTK plugin and I have encountered a strange
behavior. My plugin needs to recover the triangles attached to a vertex of
the mesh, so I call the `preprocessVertexTriangles()`.
This function bug in the case of a 2D VTK Unstructured Grid (Segmentation
Fault).
## Steps to reproduce
1- Create a new plugin with the createTTKmodule.sh
2- Add `triangulation_->preprocessVertexTriangles()` in the
`setupTriangulation()` line 117. 3- Compile your plugin
4- Open a 2D VTU (surface) in paraview and apply your plugin
You should have a Seg Fault here.
## Expected result
As far as I understand, it seems that this function should not be used in
2D. We should use `preprocessVertexStar()` instead. But in the case of my
plugin, I try to retrieve *triangles* for both 2D and 3D mesh. Would it be
possible to have `preprocessVertexTriangles()` to do the same
pre-processing than `preprocessVertexStar()` in 2D, to have only one
function call for all data sets ? Thank you for your help
Charles
|
Hi Julien,
I started a series of edits to fix this (see commit f629e75), such that
triangles always mean triangles (even in 2D where the notion of cell was
preferred so far for this) and that edges always mean edges (even in 1D
where
the notion of cell was preferred so far for this).
technically, this adds one if statement for a bunch of low-level access
functions. for instance, getVertexTriangle() now needs to check the
dimension
of the triangulation to understand what to return (an actual triangle in
3D,
or a "cell" in 2D).
this will have an effect on performance. but it seems that in your case,
such
an if statement is mandatory: either in your code or in the triangulation
API.
it seems it might be best to put that in the triangulation API like I did
(that may make the API more intuitive to other users).
can you check that my commit fixes your issue?
I'll progressively take care of the other functions in the near future.
These changes have fixed the issue. Thank you for your fast answer.
Charles
|
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dear TTK Team,
I am actually developing a TTK plugin and I have encountered a strange behavior.
My plugin needs to recover the triangles attached to a vertex of the mesh, so I call the
preprocessVertexTriangles()
.This function bug in the case of a 2D VTK Unstructured Grid (Segmentation Fault).
Steps to reproduce
triangulation_->preprocessVertexTriangles()
in thesetupTriangulation()
line 117You should have a Seg Fault here.
Expected result
As far as I understand, it seems that this function should not be used in 2D. We should use
preprocessVertexStar()
instead.But in the case of my plugin, I try to retrieve triangles for both 2D and 3D mesh.
Would it be possible to have
preprocessVertexTriangles()
to do the same pre-processing thanpreprocessVertexStar()
in 2D, to have only one function call for all data sets ?Thank you for your help
Charles
The text was updated successfully, but these errors were encountered: