56 template<
class TConfigure>
200 TConfigure::CalculateBoundingBox(ThisObject, Low, High);
204 return Result.size();
219 TConfigure::CalculateBoundingBox(ThisObject, Low, High);
221 SearchInBoxLocal(ThisObject, Result, NumberOfResults, MaxNumberOfResults, Box );
223 return NumberOfResults;
234 KRATOS_ERROR <<
"Missing implementation of SearchObjectsInCell(PointerType, ResultIteratorType)" << std::endl;
247 if(
mCells[icell].
Size() < MaxNumberOfResults) {
251 return mCells[icell].Size();
268 TConfigure::CalculateBoundingBox(ThisObject, Low, High);
272 return Result.size();
287 TConfigure::CalculateBoundingBox(ThisObject, Low, High);
291 return NumberOfResults;
303 KRATOS_ERROR <<
"Missing implementation of SearchObjectsInRadius(PointerType, const double, ResultIteratorType)" << std::endl;
319 TConfigure::CalculateBoundingBox(ThisObject, Low, High, Radius);
321 SearchInRadius(ThisObject, Radius, Results, NumberOfResults, MaxNumberOfResults, Box );
323 return NumberOfResults;
336 KRATOS_ERROR <<
"Missing implementation of SearchObjectsInRadius(PointerType, const double, ResultIteratorType, DistanceIteratorType)" << std::endl;
353 TConfigure::CalculateBoundingBox(ThisObject, Low, High, Radius);
355 SearchInRadius(ThisObject, Radius, Results, ResultDistances, NumberOfResults, MaxNumberOfResults, Box );
357 return NumberOfResults;
370 KRATOS_ERROR <<
"Missing implementation of SearchObjectsInRadiusExclusive(PointerType, const double, ResultIteratorType)" << std::endl;
386 TConfigure::CalculateBoundingBox(ThisObject, Low, High, Radius);
390 return NumberOfResults;
403 KRATOS_ERROR <<
"Missing implementation of SearchObjectsInRadiusExclusive(PointerType, const double, ResultIteratorType, DistanceIteratorType)" << std::endl;
420 TConfigure::CalculateBoundingBox(ThisObject, Low, High, Radius);
422 SearchInRadiusExclusive(ThisObject, Radius, Results, ResultDistances, NumberOfResults, MaxNumberOfResults, Box );
424 return NumberOfResults;
449 NumberOfResults[
i] = 0;
451 TConfigure::CalculateBoundingBox(ThisObjects[
i], rTLS.Low, rTLS.High, Radius[
i]);
454 SearchInRadius(ThisObjects[
i], Radius[
i], ResultsPointer, NumberOfResults[
i], MaxNumberOfResults, rTLS.Box );
468 void SearchObjectsInRadius(
IteratorType const& ThisObjects,
SizeType const& NumberOfObjects,
const std::vector<double>& Radius, std::vector<std::vector<PointerType> >& Results, std::vector<std::vector<double> >& ResultsDistances, std::vector<SizeType>& NumberOfResults,
SizeType const& MaxNumberOfResults) {
472 #pragma omp parallel for private(Low,High,Box)
473 for(
int i = 0; i < static_cast<int>(NumberOfObjects);
i++) {
477 NumberOfResults[
i] = 0;
479 TConfigure::CalculateBoundingBox(ThisObjects[
i], Low, High, Radius[
i]);
482 SearchInRadius(ThisObjects[
i], Radius[
i], ResultsPointer, ResultsDistancesPointer, NumberOfResults[
i], MaxNumberOfResults, Box );
499 #pragma omp parallel for private(Low,High,Box)
500 for(
int i = 0; i < static_cast<int>(NumberOfObjects);
i++) {
503 NumberOfResults[
i] = 0;
505 TConfigure::CalculateBoundingBox(ThisObjects[
i], Low, High, Radius[
i]);
522 virtual void SearchObjectsInRadiusExclusive(
IteratorType const& ThisObjects,
SizeType const& NumberOfObjects,
const std::vector<double>& Radius, std::vector<std::vector<PointerType> >& Results, std::vector<std::vector<double> >& ResultsDistances, std::vector<SizeType>& NumberOfResults,
SizeType const& MaxNumberOfResults) {
526 #pragma omp parallel for private(Low,High,Box)
527 for(
int i = 0; i < static_cast<int>(NumberOfObjects);
i++) {
531 NumberOfResults[
i] = 0;
533 TConfigure::CalculateBoundingBox(ThisObjects[
i], Low, High, Radius[
i]);
536 SearchInRadiusExclusive(ThisObjects[
i], Radius[
i], ResultsPointer, ResultsDistancesPointer, NumberOfResults[
i], MaxNumberOfResults, Box );
550 TConfigure::CalculateBoundingBox(ThisObject, Low, High);
565 TConfigure::CalculateBoundingBox(ThisObject, Low, High);
587 template<
class GenericCoordType>
604 template<
class GenericCoordType>
628 return (index >
mN[ThisDimension]-1) ?
mN[ThisDimension]-1 : index;
690 virtual std::string
Info()
const {
691 return "BinsObjectDynamic" ;
707 virtual void PrintData(std::ostream& rOStream, std::string
const& Perfix = std::string())
const {
708 rOStream <<
" BinsSize: ";
710 rOStream <<
"[" <<
mN[
i] <<
"]";
712 rOStream << std::endl;
713 rOStream <<
" CellSize: ";
717 rOStream << std::endl;
722 rOStream <<
"NumPointers: " << nn << std::endl;
730 rout <<
" BinsSize: ";
732 rout <<
"[" <<
mN[
i] <<
"]";
742 rout <<
" BinsBox: Min [";
748 rout <<
"]" << std::endl;
780 SizeType number_of_threads = omp_get_max_threads();
785 std::vector<SizeType> node_partition;
788 std::vector<PointType> Max(number_of_threads);
789 std::vector<PointType> Min(number_of_threads);
800 for (
IteratorType i_object = i_begin ; i_object != i_end ; i_object++ )
802 TConfigure::CalculateBoundingBox(*i_object, Low, High);
828 std::size_t average_number_of_cells =
static_cast<std::size_t
>(std::pow(
static_cast<double>(ApproximatedSize), 1.00 /
Dimension));
830 std::array<double, 3> lengths;
831 double average_length = 0.00;
835 average_length += lengths[
i];
837 average_length *= 1.00 / 3.00;
839 if (average_length < std::numeric_limits<double>::epsilon()) {
847 mN[
i] =
static_cast<std::size_t
>(lengths[
i] / average_length * (
double)average_number_of_cells) + 1;
883 TConfigure::CalculateBoundingBox(*i_object, Low, High);
899 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell))
916 MinCell[1] = MinBox[1];
917 MaxCell[1] = MaxBox[1];
920 MinCell[0] = MinBox[0];
921 MaxCell[0] = MaxBox[0];
924 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell))
945 MinCell[2] = MinBox[2];
946 MaxCell[2] = MaxBox[2];
949 MinCell[1] = MinBox[1];
950 MaxCell[1] = MaxBox[1];
953 MinCell[0] = MinBox[0];
954 MaxCell[0] = MaxBox[0];
957 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell))
959 mCells[I].SearchObjects(ThisObject, Result, NumberOfResults, MaxNumberOfResults);
979 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell))
997 MinCell[1] = MinBox[1];
998 MaxCell[1] = MaxBox[1];
1002 MinCell[0] = MinBox[0];
1003 MaxCell[0] = MaxBox[0];
1006 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell))
1025 MinCell[2] = MinBox[2];
1026 MaxCell[2] = MaxBox[2];
1030 MinCell[1] = MinBox[1];
1031 MaxCell[1] = MaxBox[1];
1032 for(
IndexType II = III + Box.
Axis[1].Begin() ; II <= III + Box.
Axis[1].End() ; II += Box.
Axis[1].Block )
1034 MinCell[0] = MinBox[0];
1035 MaxCell[0] = MaxBox[0];
1038 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell))
1040 mCells[I].SearchObjects(ThisObject, Result);
1058 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell))
1075 MinCell[1] = MinBox[1];
1076 MaxCell[1] = MaxBox[1];
1079 MinCell[0] = MinBox[0];
1080 MaxCell[0] = MaxBox[0];
1083 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell))
1104 MinCell[2] = MinBox[2];
1105 MaxCell[2] = MaxBox[2];
1108 MinCell[1] = MinBox[1];
1109 MaxCell[1] = MaxBox[1];
1112 MinCell[0] = MinBox[0];
1113 MaxCell[0] = MaxBox[0];
1116 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell))
1118 mCells[I].SearchObjectsExclusive(ThisObject, Result, NumberOfResults, MaxNumberOfResults);
1136 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell))
1154 MinCell[1] = MinBox[1];
1155 MaxCell[1] = MaxBox[1];
1159 MinCell[0] = MinBox[0];
1160 MaxCell[0] = MaxBox[0];
1163 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell))
1182 MinCell[2] = MinBox[2];
1183 MaxCell[2] = MaxBox[2];
1187 MinCell[2] = MinBox[2];
1188 MaxCell[2] = MaxBox[2];
1189 for(
IndexType II = III + Box.
Axis[1].Begin() ; II <= III + Box.
Axis[1].End() ; II += Box.
Axis[1].Block )
1191 MinCell[0] = MinBox[0];
1192 MaxCell[0] = MaxBox[0];
1195 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell))
1197 mCells[I].SearchObjectsExclusive(ThisObject, Result);
1217 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell, Radius))
1218 mCells[I].SearchObjectsInRaius(ThisObject, Radius, Result, NumberOfResults, MaxNumberOfResults);
1234 MinCell[1] = MinBox[1];
1235 MaxCell[1] = MaxBox[1];
1238 MinCell[0] = MinBox[0];
1239 MaxCell[0] = MaxBox[0];
1242 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell, Radius))
1243 mCells[I].SearchObjectsInRaius(ThisObject, Radius, Result, NumberOfResults, MaxNumberOfResults);
1262 MinCell[2] = MinBox[2];
1263 MaxCell[2] = MaxBox[2];
1266 MinCell[1] = MinBox[1];
1267 MaxCell[1] = MaxBox[1];
1270 MinCell[0] = MinBox[0];
1271 MaxCell[0] = MaxBox[0];
1274 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell, Radius))
1276 mCells[I].SearchObjectsInRadius(ThisObject, Radius, Result, NumberOfResults, MaxNumberOfResults);
1296 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell, Radius))
1297 mCells[I].SearchObjectsInRaius(ThisObject, Radius, Result, ResultDistances, NumberOfResults, MaxNumberOfResults);
1313 MinCell[1] = MinBox[1];
1314 MaxCell[1] = MaxBox[1];
1317 MinCell[0] = MinBox[0];
1318 MaxCell[0] = MaxBox[0];
1321 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell, Radius))
1322 mCells[I].SearchObjectsInRaius(ThisObject, Radius, Result, ResultDistances, NumberOfResults, MaxNumberOfResults);
1341 MinCell[2] = MinBox[2];
1342 MaxCell[2] = MaxBox[2];
1345 MinCell[1] = MinBox[1];
1346 MaxCell[1] = MaxBox[1];
1349 MinCell[0] = MinBox[0];
1350 MaxCell[0] = MaxBox[0];
1353 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell, Radius))
1355 mCells[I].SearchObjectsInRadius(ThisObject, Radius, Result, ResultDistances, NumberOfResults, MaxNumberOfResults);
1375 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell, Radius))
1392 MinCell[1] = MinBox[1];
1393 MaxCell[1] = MaxBox[1];
1396 MinCell[0] = MinBox[0];
1397 MaxCell[0] = MaxBox[0];
1400 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell, Radius))
1420 MinCell[2] = MinBox[2];
1421 MaxCell[2] = MaxBox[2];
1424 MinCell[1] = MinBox[1];
1425 MaxCell[1] = MaxBox[1];
1428 MinCell[0] = MinBox[0];
1429 MaxCell[0] = MaxBox[0];
1432 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell, Radius))
1434 mCells[I].SearchObjectsInRadiusExclusive(ThisObject, Radius, Result, NumberOfResults, MaxNumberOfResults);
1454 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell, Radius))
1471 MinCell[1] = MinBox[1];
1472 MaxCell[1] = MaxBox[1];
1475 MinCell[0] = MinBox[0];
1476 MaxCell[0] = MaxBox[0];
1479 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell, Radius))
1499 MinCell[2] = MinBox[2];
1500 MaxCell[2] = MaxBox[2];
1503 MinCell[1] = MinBox[1];
1504 MaxCell[1] = MaxBox[1];
1507 MinCell[0] = MinBox[0];
1508 MaxCell[0] = MaxBox[0];
1511 if(TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell, Radius))
1513 mCells[I].SearchObjectsInRadiusExclusive(ThisObject, Radius, Result, ResultDistances, NumberOfResults, MaxNumberOfResults);
1529 if(TConfigure::IntersectionBox(i_object, MinCell, MaxCell))
1546 MinCell[1] = MinBox[1];
1547 MaxCell[1] = MaxBox[1];
1550 MinCell[0] = MinBox[0];
1551 MaxCell[0] = MaxBox[0];
1554 if(TConfigure::IntersectionBox(i_object,MinCell,MaxCell))
1572 MinCell[2] = MinBox[2];
1573 MaxCell[2] = MaxBox[2];
1576 MinCell[1] = MinBox[1];
1577 MaxCell[1] = MaxBox[1];
1580 MinCell[0] = MinBox[0];
1581 MaxCell[0] = MaxBox[0];
1584 if(TConfigure::IntersectionBox(i_object,MinCell,MaxCell))
1600 if(TConfigure::IntersectionBox(i_object, MinCell, MaxCell))
1601 mCells[I].Remove(i_object);
1617 MinCell[1] = MinBox[1];
1618 MaxCell[1] = MaxBox[1];
1621 MinCell[0] = MinBox[0];
1622 MaxCell[0] = MaxBox[0];
1625 if(TConfigure::IntersectionBox(i_object,MinCell,MaxCell))
1626 mCells[I].Remove(i_object);
1643 MinCell[2] = MinBox[2];
1644 MaxCell[2] = MaxBox[2];
1647 MinCell[1] = MinBox[1];
1648 MaxCell[1] = MaxBox[1];
1651 MinCell[0] = MinBox[0];
1652 MaxCell[0] = MaxBox[0];
1655 if(TConfigure::IntersectionBox(i_object,MinCell,MaxCell))
1656 mCells[I].Remove(i_object);
1672 partitions.resize(number_of_threads+1);
1673 SizeType partition_size = number_of_rows / number_of_threads;
1675 partitions[number_of_threads] = number_of_rows;
1677 partitions[
i] = partitions[
i-1] + partition_size ;
1795 template<
class TConfigure>
1804 template<
class TConfigure>
1809 rOStream << std::endl;
Short class definition.
Definition: bins_dynamic_objects.h:57
BinsObjectDynamic(const BinsObjectDynamic< T > &rOther)
Copy constructor.
Definition: bins_dynamic_objects.h:1776
virtual void CalculateBoundingBox()
It computes each object's boundinx box and uses it to find the max and min points.
Definition: bins_dynamic_objects.h:774
void FillObject(SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 1 > &Box, const PointerType &i_object)
Definition: bins_dynamic_objects.h:1521
void RemoveObject(const PointerType &ThisObject)
Definition: bins_dynamic_objects.h:561
TreeNodeType::CoordinateType CoordinateType
Definition: bins_dynamic_objects.h:75
SizeType SearchObjectsInRadius(PointerType &ThisObject, const double &Radius, ResultIteratorType &Results, const SizeType &MaxNumberOfResults)
Definition: bins_dynamic_objects.h:314
TreeNode< Dimension, PointType, PointerType, IteratorType, typename TConfigure::DistanceIteratorType > TreeNodeType
Definition: bins_dynamic_objects.h:73
CellContainerType mCells
Definition: bins_dynamic_objects.h:1721
void SearchInBoxLocal(PointerType &ThisObject, ResultContainerType &Result, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 2 > &Box)
Definition: bins_dynamic_objects.h:985
virtual void SearchInRadiusExclusive(PointerType &ThisObject, CoordinateType const &Radius, ResultIteratorType &Result, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 3 > &Box)
Definition: bins_dynamic_objects.h:1407
virtual SizeType SearchObjectsInRadiusExclusive(PointerType &ThisObject, const double &Radius, ResultIteratorType &Results, const SizeType &MaxNumberOfResults)
Definition: bins_dynamic_objects.h:381
Tvector< SizeType, Dimension > SizeArray
Definition: bins_dynamic_objects.h:80
virtual void FillObject(SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 3 > &Box, const PointerType &i_object)
Definition: bins_dynamic_objects.h:1561
void SearchInRadius(PointerType &ThisObject, CoordinateType const &Radius, ResultIteratorType &Result, DistanceIteratorType ResultDistances, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 2 > &Box)
Definition: bins_dynamic_objects.h:1301
void SearchInRadius(PointerType &ThisObject, CoordinateType const &Radius, ResultIteratorType &Result, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 2 > &Box)
Definition: bins_dynamic_objects.h:1222
BinsObjectDynamic< TConfigure > & operator=(const BinsObjectDynamic< TConfigure > &rOther)
Assignment operator.
Definition: bins_dynamic_objects.h:1754
void SearchInBoxLocal(PointerType &ThisObject, ResultIteratorType &Result, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 3 > &Box)
Definition: bins_dynamic_objects.h:931
TConfigure::ContainerType ContainerType
Definition: bins_dynamic_objects.h:67
virtual SizeType SearchObjectsInRadiusExclusive(PointerType &ThisObject, const double &Radius, ResultIteratorType &Results, DistanceIteratorType ResultDistances)
Definition: bins_dynamic_objects.h:401
virtual void SearchObjectsInRadiusExclusive(IteratorType const &ThisObjects, SizeType const &NumberOfObjects, const std::vector< double > &Radius, std::vector< std::vector< PointerType > > &Results, std::vector< std::vector< double > > &ResultsDistances, std::vector< SizeType > &NumberOfResults, SizeType const &MaxNumberOfResults)
Definition: bins_dynamic_objects.h:522
IteratorType mObjectsEnd
Definition: bins_dynamic_objects.h:1715
TConfigure::PointerType PointerType
Definition: bins_dynamic_objects.h:66
IndexArray CalculateCell(const GenericCoordType &ThisObject)
Definition: bins_dynamic_objects.h:588
TConfigure::PointType PointType
Definition: bins_dynamic_objects.h:65
PointType & GetMaxPoint()
Get the Max Point object.
Definition: bins_dynamic_objects.h:676
PointType mMinPoint
Definition: bins_dynamic_objects.h:1710
void SearchInBoxLocal(PointerType &ThisObject, ResultContainerType &Result, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 3 > &Box)
Definition: bins_dynamic_objects.h:1013
void SearchInRadius(PointerType &ThisObject, CoordinateType const &Radius, ResultIteratorType &Result, DistanceIteratorType ResultDistances, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 3 > &Box)
Definition: bins_dynamic_objects.h:1328
CoordinateArray mCellSize
Definition: bins_dynamic_objects.h:1717
void SearchObjectLocalExclusive(PointerType &ThisObject, ResultContainerType &Result, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 2 > &Box)
Definition: bins_dynamic_objects.h:1142
void SearchInBoxLocal(PointerType &ThisObject, ResultIteratorType &Result, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 1 > &Box)
Definition: bins_dynamic_objects.h:891
void SearchObjectLocalExclusive(PointerType &ThisObject, ResultContainerType &Result, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 3 > &Box)
Definition: bins_dynamic_objects.h:1170
void SearchInRadius(PointerType &ThisObject, CoordinateType const &Radius, ResultIteratorType &Result, DistanceIteratorType ResultDistances, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 1 > &Box)
Definition: bins_dynamic_objects.h:1286
virtual SizeType SearchObjectsInRadiusExclusive(PointerType &ThisObject, const double &Radius, ResultIteratorType &Results, DistanceIteratorType ResultDistances, const SizeType &MaxNumberOfResults)
Definition: bins_dynamic_objects.h:415
BinsObjectDynamic(const PointType &MinPoint, const PointType &MaxPoint, SizeType NumPoints)
Constructs a new BinsObjectDynamic object.
Definition: bins_dynamic_objects.h:173
Cell< Configure > CellType
Definition: bins_dynamic_objects.h:88
virtual void PrintData(std::ostream &rOStream, std::string const &Perfix=std::string()) const
Definition: bins_dynamic_objects.h:707
TreeNodeType::SearchStructureType SearchStructureType
Definition: bins_dynamic_objects.h:85
SizeType SearchObjectsInRadius(PointerType &ThisObject, const double &Radius, ResultIteratorType &Results, DistanceIteratorType ResultDistances)
Definition: bins_dynamic_objects.h:334
BinsObjectDynamic(const BinsObjectDynamic &rOther)
Copy constructor.
Definition: bins_dynamic_objects.h:1769
void RemoveObjectLocal(SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 3 > &Box, const PointerType &i_object)
Definition: bins_dynamic_objects.h:1632
void SearchObjectLocalExclusive(PointerType &ThisObject, ResultIteratorType &Result, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 1 > &Box)
Definition: bins_dynamic_objects.h:1050
virtual void PrintInfo(std::ostream &rOStream) const
Definition: bins_dynamic_objects.h:698
TConfigure::IteratorType IteratorType
Definition: bins_dynamic_objects.h:68
Tvector< IndexType, Dimension > IndexArray
Definition: bins_dynamic_objects.h:81
SizeType SearchObjectsInCell(const PointType &ThisPoint, ResultIteratorType Result)
Definition: bins_dynamic_objects.h:232
PointType mMaxPoint
Definition: bins_dynamic_objects.h:1711
virtual void SearchInRadiusExclusive(PointerType &ThisObject, CoordinateType const &Radius, ResultIteratorType &Result, DistanceIteratorType ResultDistances, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 3 > &Box)
Definition: bins_dynamic_objects.h:1486
TConfigure::ResultContainerType ResultContainerType
Definition: bins_dynamic_objects.h:69
SizeType SearchObjectsExclusive(PointerType &ThisObject, ResultIteratorType &Result, const SizeType &MaxNumberOfResults)
Definition: bins_dynamic_objects.h:282
void AllocateContainer()
Definition: bins_dynamic_objects.h:1662
void SearchObjectsInRadius(IteratorType const &ThisObjects, SizeType const &NumberOfObjects, const std::vector< double > &Radius, std::vector< std::vector< PointerType > > &Results, std::vector< std::vector< double > > &ResultsDistances, std::vector< SizeType > &NumberOfResults, SizeType const &MaxNumberOfResults)
Definition: bins_dynamic_objects.h:468
void SearchObjectLocalExclusive(PointerType &ThisObject, ResultIteratorType &Result, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 2 > &Box)
Definition: bins_dynamic_objects.h:1063
TConfigure::ResultIteratorType ResultIteratorType
Definition: bins_dynamic_objects.h:70
void SearchInRadius(PointerType &ThisObject, CoordinateType const &Radius, ResultIteratorType &Result, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 3 > &Box)
Definition: bins_dynamic_objects.h:1249
void SearchInBoxLocal(PointerType &ThisObject, ResultIteratorType &Result, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 2 > &Box)
Definition: bins_dynamic_objects.h:904
void FillObject(SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 2 > &Box, const PointerType &i_object)
Definition: bins_dynamic_objects.h:1535
SizeType SearchObjectsInCell(const PointType &ThisPoint, ResultIteratorType Result, const SizeType &MaxNumberOfResults)
Definition: bins_dynamic_objects.h:244
TConfigure::DistanceIteratorType DistanceIteratorType
Definition: bins_dynamic_objects.h:71
void PrintBox(std::ostream &rout)
Definition: bins_dynamic_objects.h:741
TreeNodeType::IndexType IndexType
Definition: bins_dynamic_objects.h:77
TreeNodeType::IteratorIteratorType IteratorIteratorType
typedef TreeNodeType LeafType;
Definition: bins_dynamic_objects.h:84
IteratorType mObjectsBegin
Definition: bins_dynamic_objects.h:1714
PointType & GetMinPoint()
Get the Min Point object.
Definition: bins_dynamic_objects.h:667
void CalculateCellSize(std::size_t ApproximatedSize)
Calculates the cell size of the bins.
Definition: bins_dynamic_objects.h:826
BinsObjectDynamic()
Default constructor.
Definition: bins_dynamic_objects.h:100
SizeType SearchObjects(PointerType &ThisObject, ResultContainerType &Result)
Single search API.
Definition: bins_dynamic_objects.h:196
SizeArray mN
Definition: bins_dynamic_objects.h:1719
BinsObjectDynamic(IteratorType const &ObjectsBegin, IteratorType const &ObjectsEnd, CoordinateType CellSize)
Constructs a new BinsObjectDynamic.
Definition: bins_dynamic_objects.h:131
void RemoveObjectLocal(SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 2 > &Box, const PointerType &i_object)
Definition: bins_dynamic_objects.h:1606
void PrintSize(std::ostream &rout)
Definition: bins_dynamic_objects.h:729
virtual void SearchInRadiusExclusive(PointerType &ThisObject, CoordinateType const &Radius, ResultIteratorType &Result, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 2 > &Box)
Definition: bins_dynamic_objects.h:1380
SizeType SearchObjectsInRadius(PointerType &ThisObject, const double &Radius, ResultIteratorType &Results)
Definition: bins_dynamic_objects.h:301
virtual void AddObject(const PointerType &ThisObject)
Add/Remove.
Definition: bins_dynamic_objects.h:546
CellContainerType & GetCellContainer()
Get the Cell Container object.
Definition: bins_dynamic_objects.h:640
void SearchInRadius(PointerType &ThisObject, CoordinateType const &Radius, ResultIteratorType &Result, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 1 > &Box)
Definition: bins_dynamic_objects.h:1207
void SearchInBoxLocal(PointerType &ThisObject, ResultContainerType &Result, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 1 > &Box)
Definition: bins_dynamic_objects.h:969
SizeType mObjectsSize
Definition: bins_dynamic_objects.h:1713
void AssignCellSize(CoordinateType CellSize)
Assigns the cell size of the bins using the provided CellSize.
Definition: bins_dynamic_objects.h:866
CoordinateArray mInvCellSize
Definition: bins_dynamic_objects.h:1718
virtual std::string Info() const
Turn back information as a string.
Definition: bins_dynamic_objects.h:690
virtual SizeType SearchObjectsInRadiusExclusive(PointerType &ThisObject, const double &Radius, ResultIteratorType &Results)
Definition: bins_dynamic_objects.h:368
virtual void SearchInRadiusExclusive(PointerType &ThisObject, CoordinateType const &Radius, ResultIteratorType &Result, DistanceIteratorType ResultDistances, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 1 > &Box)
Definition: bins_dynamic_objects.h:1444
virtual void SearchInRadiusExclusive(PointerType &ThisObject, CoordinateType const &Radius, ResultIteratorType &Result, DistanceIteratorType ResultDistances, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 2 > &Box)
Definition: bins_dynamic_objects.h:1459
virtual ~BinsObjectDynamic()
Destructor.
Definition: bins_dynamic_objects.h:186
virtual IndexType CalculatePosition(CoordinateType const &ThisCoord, const SizeType &ThisDimension)
Definition: bins_dynamic_objects.h:624
virtual void SearchInRadiusExclusive(PointerType &ThisObject, CoordinateType const &Radius, ResultIteratorType &Result, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 1 > &Box)
Definition: bins_dynamic_objects.h:1365
void SearchObjectLocalExclusive(PointerType &ThisObject, ResultIteratorType &Result, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 3 > &Box)
Definition: bins_dynamic_objects.h:1090
BinsObjectDynamic(IteratorType const &ObjectsBegin, IteratorType const &ObjectsEnd)
Constructor de bins a bounding box.
Definition: bins_dynamic_objects.h:111
KRATOS_CLASS_POINTER_DEFINITION(BinsObjectDynamic)
Pointer definition of BinsObjectDynamic.
TConfigure Configure
Definition: bins_dynamic_objects.h:64
void RemoveObjectLocal(SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 1 > &Box, const PointerType &i_object)
Definition: bins_dynamic_objects.h:1592
@ Dimension
Definition: bins_dynamic_objects.h:62
BinsObjectDynamic(const PointType &MinPoint, const PointType &MaxPoint, CoordinateType CellSize)
Constructs a new BinsObjectDynamic.
Definition: bins_dynamic_objects.h:151
void SearchObjectsInRadius(IteratorType const &ThisObjects, SizeType const &NumberOfObjects, const std::vector< double > &Radius, std::vector< std::vector< PointerType > > &Results, std::vector< SizeType > &NumberOfResults, SizeType const &MaxNumberOfResults)
Batch search API (needs to be extended with the missing functions)
Definition: bins_dynamic_objects.h:438
std::vector< CellType > CellContainerType
Definition: bins_dynamic_objects.h:89
SizeType SearchObjectsInRadius(PointerType &ThisObject, const double &Radius, ResultIteratorType &Results, DistanceIteratorType ResultDistances, const SizeType &MaxNumberOfResults)
Definition: bins_dynamic_objects.h:348
virtual void SearchObjectsInRadiusExclusive(IteratorType const &ThisObjects, SizeType const &NumberOfObjects, const std::vector< double > &Radius, std::vector< std::vector< PointerType > > &Results, std::vector< SizeType > &NumberOfResults, SizeType const &MaxNumberOfResults)
Definition: bins_dynamic_objects.h:495
Tvector< CoordinateType, Dimension > CoordinateArray
Definition: bins_dynamic_objects.h:79
void SearchObjectLocalExclusive(PointerType &ThisObject, ResultContainerType &Result, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 1 > &Box)
Definition: bins_dynamic_objects.h:1128
CellContainerType::iterator CellContainerIterator
Definition: bins_dynamic_objects.h:90
IndexType CalculateIndex(const GenericCoordType &ThisObject)
Definition: bins_dynamic_objects.h:605
SizeArray & GetDivisions()
Get the Divisions object.
Definition: bins_dynamic_objects.h:649
SizeType SearchObjects(PointerType &ThisObject, ResultIteratorType &Result, const SizeType &MaxNumberOfResults)
Definition: bins_dynamic_objects.h:214
CoordinateArray & GetCellSize()
Get the Cell Size object.
Definition: bins_dynamic_objects.h:658
void CreatePartition(SizeType number_of_threads, const SizeType number_of_rows, std::vector< SizeType > &partitions)
Definition: bins_dynamic_objects.h:1670
virtual void GenerateBins()
Definition: bins_dynamic_objects.h:876
SizeType SearchObjectsExclusive(PointerType &ThisObject, ResultIteratorType &Result)
Definition: bins_dynamic_objects.h:264
TreeNodeType::SizeType SizeType
Definition: bins_dynamic_objects.h:76
This class is useful for index iteration over containers.
Definition: parallel_utilities.h:451
void for_each(TUnaryFunction &&f)
Definition: parallel_utilities.h:514
Definition: search_structure.h:309
void Set(IndexVector const &IndexCell, SizeVector const &_MaxSize, IteratorIteratorType const &IteratorBegin)
Definition: search_structure.h:363
SubBinAxis< IndexType, SizeType > Axis[3]
Definition: search_structure.h:326
Short class definition.
Definition: tree.h:61
typename std::vector< IteratorType >::iterator IteratorIteratorType
Define IteratorIteratorType as an iterator type for a vector of IteratorType.
Definition: tree.h:94
double CoordinateType
Define CoordinateType as double.
Definition: tree.h:76
std::size_t IndexType
Define IndexType as std::size_t.
Definition: tree.h:73
std::size_t SizeType
Define SizeType as std::size_t.
Definition: tree.h:70
#define KRATOS_ERROR
Definition: exception.h:161
static double max(double a, double b)
Definition: GeometryFunctions.h:79
TSpaceType::IndexType Size(TSpaceType &dummy, typename TSpaceType::VectorType const &rV)
Definition: add_strategies_to_python.cpp:111
std::size_t PointerDistance(TPointerType const &PointerBegin, TPointerType const &PointerEnd)
Definition: search_structure.h:91
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
TABLE_NUMBER_ANGULAR_VELOCITY TABLE_NUMBER_MOMENT I33 BEAM_INERTIA_ROT_UNIT_LENGHT_Y KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, BEAM_INERTIA_ROT_UNIT_LENGHT_Z) typedef std double
Definition: DEM_application_variables.h:182
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
int k
Definition: quadrature.py:595
integer i
Definition: TensorModule.f:17
Configure::ResultIteratorType ResultIteratorType
Definition: transfer_utility.h:252
Configure::IteratorType IteratorType
Definition: transfer_utility.h:249
Configure::PointType PointType
Definition: transfer_utility.h:245
Configure::ResultContainerType ResultContainerType
Definition: transfer_utility.h:250
Configure::ContainerType ContainerType
Definition: transfer_utility.h:247