-
Notifications
You must be signed in to change notification settings - Fork 261
[Core] Replace geometry container with PVS #13377
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks Ricky! This'll definitely need a peek from the TC though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work Ricky! All the CI Tests passed, so it's completely fine from my side. Thanks a lot
I will wait for the approval from the TC, as this involves changes in the core. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guys, who approved this? it should be approved by the @KratosMultiphysics/technical-committee
That's what we're waiting for. An approval is just that: someone expressing support for the PR. It doesn't mean the PR is merged. The fact that the PR is mergable without approval from the technical committee is the fault of an improperly set up code owner file. |
I would say this is a good opportunity to move the |
// Check that the connectivities are the same | ||
// note that we deliberately check the node ids and not the pointer adresses as there might be very rare situations | ||
|
||
// (e.g., creating nodes bypassing the model part interface) with same connectivities but different pointer addresses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't understand why pointer would fail. Nevertheless, checking the Id is ok for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they're mimicking what we did for elements/conditions not many years ago (I remember discussing this in the @KratosMultiphysics/technical-committee). Am I wrong @rickyaristio?
Edit: well, I think I remember...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rubenzorrilla , you are right.
I am modifying these files, this is going to be a conflict :P |
@@ -1812,7 +1810,7 @@ void ModelPartIO::ReadGeometriesBlock(NodesContainerType& rThisNodes, GeometryCo | |||
temp_geometry_nodes.push_back( *(FindKey(rThisNodes, ReorderedNodeId(node_id), "Node").base())); | |||
} | |||
|
|||
rThisGeometries.AddGeometry(r_clone_geometry.Create(ReorderedGeometryId(id), temp_geometry_nodes)); | |||
rThisGeometries.insert(r_clone_geometry.Create(ReorderedGeometryId(id), temp_geometry_nodes)); //TO DO! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is exactly the remaining TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One remaining problem with geometries is their IDs.
It's not the straight and simple index-based ID we have on everything else, but a hash that encodes some unrelated data in the two most significant bits.
I imagine he tagged every place that uses geometry IDs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well...this is NOT insignificant eh ... actually it is the reason for which we were using a special container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One remaining problem with geometries is their IDs.
It's not the straight and simple index-based ID we have on everything else, but a hash that encodes some unrelated data in the two most significant bits.
I imagine he tagged every place that uses geometry IDs.
guys this is a killer...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guys this is a killer...
Why? The special container (a hash table) has been swapped out for PVS for over a year, and we never saw a performance regression.
The only reason for the hash-based IDs is the option to construct a Geometry
without providing an ID (in that case, it gets automatically generated). The last two bits store information on how the ID was assigned: provided or generated.
I don't see why this ID auto-generation feature is necessary. On the other hand, it creates quite a few headaches:
- the hash function does not guarantee uniqueness, so we're always running the risk of silent bugs
Geometry
IDs are not consistent between runs (the hashing is unique to each run)- they are discontiguous, huge integers, terrible for debugging
- bit-twiddling magic that is hard to read/understand/maintain
@RiccardoRossi why do you think auto-generated IDs are necessary? I don't see a valid use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, the use case was to identify as given triangle (say) but its connectivity. If this is not any longer supported than my review does not make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If anything used that feature, it would have broken after merging #12843.
@@ -1,177 +0,0 @@ | |||
// | / | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we reuse all these as tests for the PVS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me try it after we move the geometry container to mesh (so it is consistent with the elements/conditions). #13423
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only have a few minor observations. Aside of these, I don't see any error.
As a comment aside, I think that at some point we should consider doing a search&replace of all the GeometryName
as these are very misleading. IMO, GeometryName
in Kratos context means Triangle2D3
, Line2D3
, etc. What we have in here should be GeometryTextId
or something of this sort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good from my side as well
Co-authored-by: Rubén Zorrilla <rubenzorrillamartinez@hotmail.com>
📝 Description
This PR serves two main goals:
Replace
GeometryContainer
withPointerVectorSet
:As discussed in GeometryContainer #11609 in order to have a standard interface.
Fully remove
GeometryContainer
:Following up on [Core] Use PointerVectorSet as geometry container #12843, this PR fully removes the
GeometryContainer
and aliases it to thePointerVectorSet
of the geometries.@sunethwarna @matekelemen