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

[Core] Transition changes geometrical object bins, add PointIsInsideBoundingBox functionality #11678

Merged

Conversation

loumalouomega
Copy link
Member

📝 Description

This PR introduces new functionality to the GeometricalObjectsBins class. Here are the key changes made:

  1. Added a new function bool GeometricalObjectsBins::PointIsInsideBoundingBox(const array_1d<double,3>& rCoords) that checks if a point is inside the bounding box of geometrical objects.
  2. Added another function bool GeometricalObjectsBins::PointIsInsideBoundingBoxWithTolerance(const array_1d<double,3>& rCoords) that checks if a point is inside the bounding box with tolerance.
  3. Modified the GeometricalObjectsBins::CalculateCellSize function to include additional logic.
  4. Updated test cases in test_geometrical_objects_bins.cpp.

These changes seem to be aimed at improving the functionality of the GeometricalObjectsBins class by adding methods to check if a point lies within the bounding box of geometrical objects, with and without tolerance. The changes also include updates to test cases to ensure the new functionality works as expected.

🆕 Changelog

@@ -79,8 +79,8 @@ class KRATOS_API(KRATOS_CORE) GeometricalObjectsBins
for (TIteratorType i_object = GeometricalObjectsBegin ; i_object != GeometricalObjectsEnd ; i_object++){
mBoundingBox.Extend(i_object->GetGeometry().begin() , i_object->GetGeometry().end());
}
mBoundingBox.Extend(Tolerance);
Copy link
Member

@roigcarlo roigcarlo Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the default tolerance of this function be std::numeric_limits<double>::epsilon() instead of 1e-12 then?

Edit: The function on which this line is being called, github didnt let me ping the header.

Aside from that all ok. I approve because its just a question.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the current tolerance, better don't touch to avoid break things

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@loumalouomega loumalouomega merged commit b381bf4 into master Oct 16, 2023
@loumalouomega loumalouomega deleted the core/minor-transition-changes-geometrical-object-bins branch October 16, 2023 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants