-
Notifications
You must be signed in to change notification settings - Fork 248
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][MPI] Adding SpatialSearchResultContainer
and SpatialSearchResultContainerMap
(v.2.0)
#11416
[Core][MPI] Adding SpatialSearchResultContainer
and SpatialSearchResultContainerMap
(v.2.0)
#11416
Conversation
Ping @pooyan-dadvand |
/***********************************************************************************/ | ||
|
||
template <class TObjectType> | ||
std::vector<Vector> SpatialSearchResultContainer<TObjectType>::GetResultShapeFunctions(const array_1d<double, 3>& rPoint) |
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.
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.
As we discussed with @roigcarlo and @RiccardoRossi and @jcotela we will pass the new interface to a new meta search class for MPI and leave the one by one interface only for local searches as before
@@ -54,6 +56,8 @@ class KRATOS_API(KRATOS_CORE) GeometricalObjectsBins | |||
/// The type of geometrical object to be stored in the bins | |||
using CellType = std::vector<GeometricalObject*>; | |||
using ResultType = SpatialSearchResult<GeometricalObject>; | |||
using ResultTypeContainer = SpatialSearchResultContainer<GeometricalObject>; |
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.
ResultContainerType
@@ -54,6 +56,8 @@ class KRATOS_API(KRATOS_CORE) GeometricalObjectsBins | |||
/// The type of geometrical object to be stored in the bins | |||
using CellType = std::vector<GeometricalObject*>; | |||
using ResultType = SpatialSearchResult<GeometricalObject>; | |||
using ResultTypeContainer = SpatialSearchResultContainer<GeometricalObject>; | |||
using ResultTypeContainerMap = SpatialSearchResultContainerMap<GeometricalObject>; |
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.
ResultContainerMapType
} | ||
mBoundingBox.Extend(mTolerance); |
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.
Why moving inside?
|
||
// Synchronize if needed | ||
if (SyncronizeResults) { | ||
rResults.SynchronizeAll(ParallelEnvironment::GetDefaultDataCommunicator()); |
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 am not sure using only the default communicator is not very limiting
Closing as included in #11719 |
📝 Description
#11205 + addressed comments
This PR introduces a new class named
SpatialSearchResultContainer
andSpatialSearchResultContainerMap
. The class provides storage and operations related to spatial search results. This is a transition PR to finally give support for MPI search usingGeometricalObjectBins
.The
SpatialSearchResultContainer
class stores:PointerVectorSet
)The class includes functions such as,
SynchronizeAll
,HasResult
,GetResultIndices
,AddResult
... The interesting part is that integrates a global pointer communicator, so it is possible to calculate anything passing a functor. The most common operations required are already implemented:GetResultShapeFunctions
,GetResultIndices
andGetResultCoordinates
,The
SynchronizeAll
method synchronizes the container between partitions. TheAddResult
method adds a result to the local pointers. There is apush_back
which does the same.The
SpatialSearchResultContainerMap
class stores an unordered map ofSpatialSearchResultContainer
, using an integer as hash. The hash is computed from the point coordinates pointer address (comment from #11205 by @pooyan-dadvand ) which we are computing the results.This commit seems to be a significant enhancement, providing a new means of handling and manipulating spatial search results in the Kratos library.
We need to derive
SpatialSearchResult
from indexed object in order to be able to usePointerVectorSet
in #11416, seeKratos/kratos/spatial_containers/spatial_search_result_container.h
Line 62 in b506cc1
SpatialSearchResult
theGlobalPointerUtilities
in pourpose, with the corresponding debugging, problematics and error prone due to code duplication. This solution is therefore much cleaner.🆕 Changelog
spatial_search_result_container.cpp
andspatial_search_result_container.h
files have been added, representing the implementation and header for theSpatialSearchResultContainer
andSpatialSearchResultContainerMap
classes.SpatialSearchResultContainer
andSpatialSearchResultContainerMap
SpatialSearchResultContainer
andSpatialSearchResultContainerMap
GlobalPointer
class in global_pointer.h #11206== operator
inSpatialSearchResult
#11221SpatialSearchResult
derived fromIndexedObject
#11414