KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
bins_dynamic.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Nelson Lafontaine
11 // Carlos Roig
12 //
13 
14 #pragma once
15 
16 // System includes
17 #include <array>
18 #include <cmath>
19 #include <algorithm>
20 
21 // External includes
22 
23 // Project includes
24 #include "tree.h"
26 
27 namespace Kratos
28 {
29 
46 template<
47 std::size_t TDimension,
48  class TPointType,
49  class TContainerType,
50  class TPointerType = typename TContainerType::value_type,
51  class TIteratorType = typename TContainerType::iterator,
52  class TDistanceIteratorType = typename std::vector<double>::iterator,
54  >
56  : public TreeNode<TDimension,TPointType, TPointerType, TIteratorType, TDistanceIteratorType, typename std::vector<TPointerType>::iterator >
57 {
58 public:
61 
62  // Helper template to extract ObjectType or default to void
63  template <typename T, typename = void>
64  struct GetObjectType {
65  using type = void;
66  };
67 
68  template <typename T>
69  struct GetObjectType<T, std::void_t<typename T::ObjectType>> {
70  using type = typename T::ObjectType;
71  };
72 
75 
76  enum { Dimension = TDimension };
77 
78  using PointType = TPointType;
81  using ContainerType = TContainerType;
82  using IteratorType = TIteratorType;
83  using DistanceIteratorType = TDistanceIteratorType;
84  using PointerType = TPointerType;
85  using DistanceFunction = TDistanceFunction;
86 
88 
89  using CoordinateType = typename TreeNodeType::CoordinateType; // double
90  using SizeType = typename TreeNodeType::SizeType; // std::size_t
91  using IndexType = typename TreeNodeType::IndexType; // std::size_t
92 
96 
99 
100  using LocalContainerType = std::vector<PointerType>;
101  using LocalIterator = typename LocalContainerType::iterator;
102 
104  using CellContainerType = std::vector<LocalContainerType>;
105 
109 
110  using CoordinateVectorType = std::vector<CoordinateType>;
111  using IteratorVectorType = std::vector<IteratorType>;
112  using DistanceIteratorVectorType = std::vector<DistanceIteratorType>;
113 
114  // Legacy typedef (to preserve compatibility in case someone was using these definitions)
118 
122 
129  : mitPointsBegin(this->NullIterator()), mitPointsEnd(this->NullIterator()), mNumCells(0)
130  {};
131 
138  BinsDynamic(IteratorType const& PointBegin, IteratorType const& PointEnd, SizeType BucketSize = 1)
139  : mitPointsBegin(PointBegin), mitPointsEnd(PointEnd)
140  {
141  if (mitPointsBegin == mitPointsEnd)
142  return;
143  mNumCells = std::distance(mitPointsBegin, mitPointsEnd);
145  CalculateCellSize(mNumCells);
147  GenerateBins();
148  }
149 
158  BinsDynamic(IteratorType const& PointBegin, IteratorType const& PointEnd, PointType const& MinPoint, PointType const& MaxPoint, SizeType BucketSize = 1)
159  : mitPointsBegin(PointBegin), mitPointsEnd(PointEnd), mBoundingBox(MinPoint, MaxPoint)
160  {
161  if (mitPointsBegin == mitPointsEnd)
162  return;
163 
164  mNumCells = std::distance(mitPointsBegin, mitPointsEnd);
165  CalculateCellSize(mNumCells);
167  GenerateBins();
168  }
169 
176  BinsDynamic(PointType const& MinPoint, PointType const& MaxPoint, SizeType BucketSize)
177  : mBoundingBox(MinPoint, MaxPoint), mNumCells(0)
178  {
179  AssignCellSize(BucketSize);
181  }
182 
190  BinsDynamic(IteratorType const& PointBegin, IteratorType const& PointEnd, CoordinateType BoxSize, SizeType BucketSize = 1)
191  : mitPointsBegin(PointBegin), mitPointsEnd(PointEnd)
192  {
193  if (mitPointsBegin == mitPointsEnd)
194  return;
195  mNumCells = std::distance(mitPointsBegin, mitPointsEnd);
197  AssignCellSize(BoxSize);
199  GenerateBins();
200  }
201 
202  // Destructor
203  ~BinsDynamic() override {}
204 
208 
212 
218  {
219  return mitPointsBegin;
220  }
221 
227  {
228  return mitPointsBegin;
229  }
230 
238  {
239  return mCellSize[iDim];
240  }
241 
249  {
250  return mN[iDim];
251  }
252 
258  {
259  return mCells;
260  }
261 
267  {
268  return mN;
269  }
270 
276  {
277  return mCellSize;
278  }
279 
285  {
286  return mBoundingBox.GetMinPoint();
287  }
288 
294  {
295  return mBoundingBox.GetMaxPoint();
296  }
297 
304  {
305  return mBoundingBox;
306  }
307 
311 
317  {
318  auto& r_min_point = GetMinPoint();
319  auto& r_max_point = GetMaxPoint();
320  noalias(r_min_point.Coordinates()) = (**mitPointsBegin).Coordinates();
321  noalias(r_max_point.Coordinates()) = (**mitPointsBegin).Coordinates();
322 
323  for (IteratorType it_point = mitPointsBegin; it_point != mitPointsEnd; it_point++) {
324  const auto& r_coordinates = (**it_point).Coordinates();
325  for (SizeType i = 0; i < Dimension; i++) {
326  if (r_coordinates[i] < r_min_point[i]) {
327  r_min_point[i] = r_coordinates[i];
328  }
329  if (r_coordinates[i] > r_max_point[i]) {
330  r_max_point[i] = r_coordinates[i];
331  }
332  }
333  }
334  }
335 
341  void CalculateCellSize(const std::size_t ApproximatedSize)
342  {
343  std::size_t average_number_of_cells = static_cast<std::size_t>(std::pow(static_cast<double>(ApproximatedSize), 1.00 / Dimension));
344 
345  std::array<double, 3> lengths;
346  double average_length = 0.0;
347 
348  for (int i = 0; i < Dimension; i++) {
349  lengths[i] = GetMaxPoint()[i] - GetMinPoint()[i];
350  average_length += lengths[i];
351  }
352  average_length *= 1.0 / 3.0;
353 
354  if (average_length < std::numeric_limits<double>::epsilon()) {
355  for(int i = 0; i < Dimension; i++) {
356  mN[i] = 1;
357  }
358  return;
359  }
360 
361  for (int i = 0; i < Dimension; i++) {
362  mN[i] = static_cast<std::size_t>(lengths[i] / average_length * (double)average_number_of_cells) + 1;
363 
364  if (mN[i] > 1) {
365  mCellSize[i] = lengths[i] / mN[i];
366  } else {
367  mCellSize[i] = average_length;
368  }
369 
370  mInvCellSize[i] = 1.00 / mCellSize[i];
371  }
372  }
373 
380  {
381  for (SizeType i = 0; i < Dimension; i++) {
382  mCellSize[i] = BoxSize;
383  mInvCellSize[i] = 1.0 / mCellSize[i];
384  mN[i] = static_cast<SizeType>((GetMaxPoint()[i] - GetMinPoint()[i]) / mCellSize[i]) + 1;
385  }
386  }
387 
393  {
394  SizeType Size = 1;
395  for (SizeType i = 0; i < Dimension; i++)
396  Size *= mN[i];
397  // Resize Global Container
398  mCells.resize(Size);
399  }
400 
406  {
407  for (IteratorType i_point = mitPointsBegin; i_point != mitPointsEnd; i_point++)
408  mCells[CalculateIndex(**i_point)].push_back(*i_point);
409  }
410 
417  IndexType CalculatePosition(CoordinateType const& ThisCoord, SizeType ThisDimension)
418  {
419  CoordinateType d_index = (ThisCoord - GetMinPoint()[ThisDimension]) * mInvCellSize[ThisDimension];
420  IndexType index = static_cast<IndexType>((d_index < 0.00) ? 0.00 : d_index);
421  return (index > mN[ThisDimension] - 1) ? mN[ThisDimension] - 1 : index;
422  }
423 
430  {
431  IndexType Index = 0;
432  for (SizeType iDim = Dimension - 1; iDim > 0; iDim--) {
433  Index += CalculatePosition(ThisPoint[iDim], iDim);
434  Index *= mN[iDim - 1];
435  }
436  Index += CalculatePosition(ThisPoint[0], 0);
437  return Index;
438  }
439 
446  {
447  IndexType Index = 0;
448  for (SizeType iDim = Dimension - 1; iDim > 0; iDim--) {
449  Index += ThisIndex[iDim];
450  Index *= mN[iDim - 1];
451  }
452  Index += ThisIndex[0];
453  return Index;
454  }
455 
462  CellType CalculateCell(PointType const& ThisPoint)
463  {
464  CellType Cell;
465  for (SizeType i = 0; i < Dimension; i++)
466  Cell[i] = CalculatePosition(ThisPoint[i], i);
467  return Cell;
468  }
469 
477  CellType CalculateCell(PointType const& ThisPoint, CoordinateType Radius)
478  {
479  CellType Cell;
480  for (SizeType i = 0; i < Dimension; i++)
481  Cell[i] = CalculatePosition(ThisPoint[i] + Radius, i);
482  return Cell;
483  }
484 
490  void AddPoint(PointerType const& ThisPoint)
491  {
492  mCells[CalculateIndex(*ThisPoint)].push_back(ThisPoint);
493  mNumCells++;
494  }
495 
496  //************************************************************************
497 
498  PointerType ExistPoint( PointerType const& ThisPoint, CoordinateType const Tolerance = static_cast<CoordinateType>(10.0*DBL_EPSILON) )
499  {
500  PointerType Nearest;
501  CoordinateType Distance = static_cast<CoordinateType>(DBL_MAX);
502  bool Found;
503  SearchStructureType Box( CalculateCell(*ThisPoint,-Tolerance), CalculateCell(*ThisPoint,Tolerance), mN );
504  SearchNearestInBox( *ThisPoint, Nearest, Distance, Box, Found );
505  if(Found)
506  return Nearest;
507  return this->NullPointer();
508  }
509 
510  //************************************************************************
511 
513  {
514  if( mitPointsBegin == mitPointsEnd )
515  return this->NullPointer();
516 
517  PointerType Result = *mitPointsBegin;
518  CoordinateType ResultDistance = static_cast<CoordinateType>(DBL_MAX);
519  SearchStructureType Box( CalculateCell(ThisPoint), mN );
520  SearchNearestPointLocal( ThisPoint, Result, ResultDistance, Box );
521  return Result;
522  }
523 
524  //************************************************************************
525 
526  PointerType SearchNearestPoint( PointType const& ThisPoint, CoordinateType& ResultDistance )
527  {
528  if( mitPointsBegin == mitPointsEnd )
529  return this->NullPointer();
530 
531  PointerType Result = *mitPointsBegin;
532  ResultDistance = static_cast<CoordinateType>(DBL_MAX);
533  SearchStructureType Box( CalculateCell(ThisPoint), mN );
534  SearchNearestPointLocal( ThisPoint, Result, ResultDistance, Box);
535  return Result;
536  }
537 
538  //************************************************************************
539 
540  // New Thread Safe!!!
541  PointerType SearchNearestPoint( PointType const& ThisPoint, CoordinateType& rResultDistance, SearchStructureType& Box )
542  {
543  PointerType Result = *mitPointsBegin; //static_cast<PointerType>(NULL);
544  rResultDistance = static_cast<CoordinateType>(DBL_MAX);
545  Box.Set( CalculateCell(ThisPoint), mN );
546  SearchNearestPointLocal( ThisPoint, Result, rResultDistance, Box);
547  return Result;
548  }
549 
550  //************************************************************************
551 
552  void SearchNearestPoint( PointType const& ThisPoint, PointerType& rResult, CoordinateType& rResultDistance ) override
553  {
555  Box.Set( CalculateCell(ThisPoint), mN );
556  SearchNearestPointLocal(ThisPoint,rResult,rResultDistance,Box);
557  }
558 
559  //************************************************************************
560 
561  void SearchNearestPoint( PointType const& ThisPoint, PointerType& rResult, CoordinateType& rResultDistance, SearchStructureType& Box ) override
562  {
563  // This case is when BinStatic is a LeafType in Other Spacial Structure
564  // Then, it is possible a better Result before this search
565  Box.Set( CalculateCell(ThisPoint), mN );
566  SearchNearestPointLocal( ThisPoint, rResult, rResultDistance, Box );
567  }
568 
569  //************************************************************************
570 
571  void SearchNearestPoint( PointType* const& ThisPoints, SizeType const& NumberOfPoints, IteratorType &Results, std::vector<CoordinateType> ResultsDistances)
572  {
573  IndexPartition<SizeType>(NumberOfPoints).for_each(
574  [&](SizeType iPoint)
575  { Results[iPoint] = SearchNearestPoint(ThisPoints[iPoint],ResultsDistances[iPoint]); }
576  );
577  }
578 
579  //************************************************************************
580 
581  void SearchNearestPointLocal( PointType const& ThisPoint, PointerType& rResult, CoordinateType& rResultDistance, SearchStructureType& Box )
582  {
583  if( mitPointsBegin == mitPointsEnd )
584  return;
585 
586  bool Found = false;
587 
588  // set mBox
589  Box.Set( CalculateCell(ThisPoint), mN );
590 
591  // initial search
592  ++Box;
593  SearchNearestInBox( ThisPoint, rResult, rResultDistance, Box, Found );
594  // increase mBox and try again
595  while(!Found) {
596  ++Box;
597  SearchNearestInBox( ThisPoint, rResult, rResultDistance, Box, Found );
598  }
599 
600  }
601 
602  //************************************************************************
603 
604  SizeType SearchInRadius( PointType const& ThisPoint, CoordinateType const& Radius, IteratorType Results,
605  DistanceIteratorType ResultsDistances, SizeType const& MaxNumberOfResults )
606  {
607  CoordinateType Radius2 = Radius * Radius;
608  SizeType NumberOfResults = 0;
609  SearchStructureType Box( CalculateCell(ThisPoint,-Radius), CalculateCell(ThisPoint,Radius), mN );
610  SearchInRadiusLocal( ThisPoint, Radius, Radius2, Results, ResultsDistances, NumberOfResults, MaxNumberOfResults, Box );
611  return NumberOfResults;
612  }
613 
614  //************************************************************************
615 
616  SizeType SearchInRadius( PointType const& ThisPoint, CoordinateType const& Radius, IteratorType Results,
617  DistanceIteratorType ResultsDistances, SizeType const& MaxNumberOfResults, SearchStructureType& Box )
618  {
619  CoordinateType Radius2 = Radius * Radius;
620  SizeType NumberOfResults = 0;
621  Box.Set( CalculateCell(ThisPoint,-Radius), CalculateCell(ThisPoint,Radius), mN );
622  SearchInRadiusLocal( ThisPoint, Radius, Radius2, Results, ResultsDistances, NumberOfResults, MaxNumberOfResults, Box );
623  return NumberOfResults;
624  }
625 
626  //************************************************************************
627 
628  void SearchInRadius( PointType const& ThisPoint, CoordinateType const& Radius, CoordinateType const& Radius2, IteratorType& Results,
629  DistanceIteratorType& ResultsDistances, SizeType& NumberOfResults, SizeType const& MaxNumberOfResults ) override
630  {
631  SearchStructureType Box( CalculateCell(ThisPoint,-Radius), CalculateCell(ThisPoint,Radius), mN );
632  SearchInRadiusLocal( ThisPoint, Radius, Radius2, Results, ResultsDistances, NumberOfResults, MaxNumberOfResults, Box);
633  }
634 
635  //************************************************************************
636 
637  void SearchInRadius( PointType const& ThisPoint, CoordinateType const& Radius, CoordinateType const& Radius2, IteratorType& Results,
638  DistanceIteratorType& ResultsDistances, SizeType& NumberOfResults, SizeType const& MaxNumberOfResults, SearchStructureType& Box ) override
639  {
640  Box.Set( CalculateCell(ThisPoint,-Radius), CalculateCell(ThisPoint,Radius), mN );
641  SearchInRadiusLocal( ThisPoint, Radius, Radius2, Results, ResultsDistances, NumberOfResults, MaxNumberOfResults, Box);
642  }
643 
644  //************************************************************************
645 
646  void SearchInRadius( PointerType const& ThisPoints, SizeType const& NumberOfPoints, CoordinateVectorType const& Radius, IteratorVectorType Results,
647  DistanceIteratorVectorType ResultsDistances, std::vector<SizeType>& NumberOfResults, SizeType const& MaxNumberOfResults )
648  {
649  IndexPartition<SizeType>(NumberOfPoints).for_each(
650  [&](SizeType iPoint)
651  { NumberOfResults[iPoint] = SearchInRadius(ThisPoints[iPoint],Radius[iPoint],Results[iPoint],ResultsDistances[iPoint],MaxNumberOfResults); }
652  );
653  }
654 
655  // **** THREAD SAFE
656 
657  // Dimension = 1
658  void SearchInRadiusLocal( PointType const& ThisPoint, CoordinateType const& Radius, CoordinateType const& Radius2, IteratorType& Results,
659  DistanceIteratorType& ResultsDistances, SizeType& NumberOfResults, SizeType const& MaxNumberOfResults,
661  {
662  for(IndexType I = Box.Axis[0].Begin() ; I <= Box.Axis[0].End() ; I += Box.Axis[0].Block )
663  SearchRadiusInRange()(mCells[I].begin(),mCells[I].end(),ThisPoint,Radius2,Results,ResultsDistances,NumberOfResults,MaxNumberOfResults);
664  }
665 
666  // Dimension = 2
667  void SearchInRadiusLocal( PointType const& ThisPoint, CoordinateType const& Radius, CoordinateType const& Radius2, IteratorType& Results,
668  DistanceIteratorType& ResultsDistances, SizeType& NumberOfResults, SizeType const& MaxNumberOfResults,
670  {
671  for(IndexType II = Box.Axis[1].Begin() ; II <= Box.Axis[1].End() ; II += Box.Axis[1].Block )
672  for(IndexType I = II + Box.Axis[0].Begin() ; I <= II + Box.Axis[0].End() ; I += Box.Axis[0].Block )
673  SearchRadiusInRange()(mCells[I].begin(),mCells[I].end(),ThisPoint,Radius2,Results,ResultsDistances,NumberOfResults,MaxNumberOfResults);
674  }
675 
676  // Dimension = 3
677  void SearchInRadiusLocal( PointType const& ThisPoint, CoordinateType const& Radius, CoordinateType const& Radius2, IteratorType& Results,
678  DistanceIteratorType& ResultsDistances, SizeType& NumberOfResults, SizeType const& MaxNumberOfResults,
680  {
681  for(IndexType III = Box.Axis[2].Begin() ; III <= Box.Axis[2].End() ; III += Box.Axis[2].Block )
682  for(IndexType II = III + Box.Axis[1].Begin() ; II <= III + Box.Axis[1].End() ; II += Box.Axis[1].Block )
683  for(IndexType I = II + Box.Axis[0].Begin() ; I <= II + Box.Axis[0].End() ; I += Box.Axis[0].Block )
684  SearchRadiusInRange()(mCells[I].begin(),mCells[I].end(),ThisPoint,Radius2,Results,ResultsDistances,NumberOfResults,MaxNumberOfResults);
685  }
686 
687  //************************************************************************
688 
689  SizeType SearchInRadius( PointType const& ThisPoint, CoordinateType Radius, IteratorType Results, SizeType MaxNumberOfResults )
690  {
691  CoordinateType Radius2 = Radius * Radius;
692  SizeType NumberOfResults = 0;
693  SearchStructureType Box( CalculateCell(ThisPoint,-Radius), CalculateCell(ThisPoint,Radius), mN );
694  SearchInRadiusLocal( ThisPoint, Radius, Radius2, Results, NumberOfResults, MaxNumberOfResults, Box );
695  return NumberOfResults;
696  }
697 
698  //************************************************************************
699 
700  SizeType SearchInRadius( PointType const& ThisPoint, CoordinateType Radius, IteratorType Results,
701  SizeType MaxNumberOfResults, SearchStructureType& Box )
702  {
703  CoordinateType Radius2 = Radius * Radius;
704  SizeType NumberOfResults = 0;
705  Box.Set( CalculateCell(ThisPoint,-Radius), CalculateCell(ThisPoint,Radius), mN );
706  SearchInRadiusLocal( ThisPoint, Radius, Radius2, Results, NumberOfResults, MaxNumberOfResults, Box );
707  return NumberOfResults;
708  }
709 
710  //************************************************************************
711 
712  void SearchInRadius( PointType const& ThisPoint, CoordinateType const& Radius, CoordinateType const& Radius2, IteratorType& Results,
713  SizeType& NumberOfResults, SizeType const& MaxNumberOfResults ) override
714  {
715  SearchStructureType Box( CalculateCell(ThisPoint,-Radius), CalculateCell(ThisPoint,Radius), mN );
716  SearchInRadiusLocal( ThisPoint, Radius, Radius2, Results, NumberOfResults, MaxNumberOfResults, Box );
717  }
718 
719  //************************************************************************
720 
721  void SearchInRadius( PointType const& ThisPoint, CoordinateType const& Radius, CoordinateType const& Radius2, IteratorType& Results,
722  SizeType& NumberOfResults, SizeType const& MaxNumberOfResults, SearchStructureType& Box ) override
723  {
724  Box.Set( CalculateCell(ThisPoint,-Radius), CalculateCell(ThisPoint,Radius), mN );
725  SearchInRadiusLocal( ThisPoint, Radius, Radius2, Results, NumberOfResults, MaxNumberOfResults, Box );
726  }
727 
728  //************************************************************************
729 
730  // **** THREAD SAFE
731 
732  // Dimension = 1
733  void SearchInRadiusLocal( PointType const& ThisPoint, CoordinateType const& Radius, CoordinateType const& Radius2, IteratorType& Results,
734  SizeType& NumberOfResults, SizeType const& MaxNumberOfResults,
736  {
737  for(IndexType I = Box.Axis[0].Begin() ; I <= Box.Axis[0].End() ; I++ )
738  SearchRadiusInRange()(mCells[I].begin(),mCells[I].end(),ThisPoint,Radius2,Results,NumberOfResults,MaxNumberOfResults);
739  }
740 
741  // Dimension = 2
742  void SearchInRadiusLocal( PointType const& ThisPoint, CoordinateType const& Radius, CoordinateType const& Radius2, IteratorType& Results,
743  SizeType& NumberOfResults, SizeType const& MaxNumberOfResults,
745  {
746  for(IndexType II = Box.Axis[1].Begin() ; II <= Box.Axis[1].End() ; II += Box.Axis[1].Block )
747  for(IndexType I = II + Box.Axis[0].Begin() ; I <= II + Box.Axis[0].End() ; I++ )
748  SearchRadiusInRange()(mCells[I].begin(),mCells[I].end(),ThisPoint,Radius2,Results,NumberOfResults,MaxNumberOfResults);
749  }
750 
751  // Dimension = 3
752  void SearchInRadiusLocal( PointType const& ThisPoint, CoordinateType const& Radius, CoordinateType const& Radius2, IteratorType& Results,
753  SizeType& NumberOfResults, SizeType const& MaxNumberOfResults,
755  {
756  for(IndexType III = Box.Axis[2].Begin() ; III <= Box.Axis[2].End() ; III += Box.Axis[2].Block )
757  for(IndexType II = III + Box.Axis[1].Begin() ; II <= III + Box.Axis[1].End() ; II += Box.Axis[1].Block )
758  for(IndexType I = II + Box.Axis[0].Begin() ; I <= II + Box.Axis[0].End() ; I++ )
759  SearchRadiusInRange()(mCells[I].begin(),mCells[I].end(),ThisPoint,Radius2,Results,NumberOfResults,MaxNumberOfResults);
760  }
761 
762  //************************************************************************
763  //************************************************************************
764 
765  // Dimension = 1
766  void SearchNearestInBox( PointType const& ThisPoint, PointerType& ResultPoint, CoordinateType& ResultDistance,
768  {
769  Found = false;
770  for(IndexType I = Box.Axis[0].Begin() ; I <= Box.Axis[0].End() ; I += Box.Axis[0].Block )
771  SearchNearestInRange()( mCells[I].begin(), mCells[I].end(), ThisPoint, ResultPoint, ResultDistance, Found );
772  }
773 
774  // Dimension = 2
775  void SearchNearestInBox( PointType const& ThisPoint, PointerType& ResultPoint, CoordinateType& ResultDistance,
777  {
778  Found = false;
779  for(IndexType II = Box.Axis[1].Begin() ; II <= Box.Axis[1].End() ; II += Box.Axis[1].Block )
780  for(IndexType I = II + Box.Axis[0].Begin() ; I <= II + Box.Axis[0].End() ; I += Box.Axis[0].Block )
781  SearchNearestInRange()( mCells[I].begin(), mCells[I].end(), ThisPoint, ResultPoint, ResultDistance, Found );
782  }
783 
784  // Dimension = 3
785  void SearchNearestInBox( PointType const& ThisPoint, PointerType& ResultPoint, CoordinateType& ResultDistance,
787  {
788  Found = false;
789  for(IndexType III = Box.Axis[2].Begin() ; III <= Box.Axis[2].End() ; III += Box.Axis[2].Block )
790  for(IndexType II = III + Box.Axis[1].Begin() ; II <= III + Box.Axis[1].End() ; II += Box.Axis[1].Block )
791  for(IndexType I = II + Box.Axis[0].Begin() ; I <= II + Box.Axis[0].End() ; I += Box.Axis[0].Block )
792  SearchNearestInRange()( mCells[I].begin(), mCells[I].end(), ThisPoint, ResultPoint, ResultDistance, Found );
793  }
794 
795  //************************************************************************
796  //************************************************************************
797 
798  SizeType SearchInBox( PointType const& SearchMinPoint, PointType const& SearchMaxPoint, IteratorType Results,
799  SizeType MaxNumberOfResults )
800  {
801  SizeType NumberOfResults = 0;
802  SearchStructureType Box( CalculateCell(SearchMinPoint), CalculateCell(SearchMaxPoint), mN );
803  SearchInBoxLocal( SearchMinPoint, SearchMaxPoint, Results, NumberOfResults, MaxNumberOfResults, Box );
804  return NumberOfResults;
805  }
806 
807  //************************************************************************
808 
809  void SearchInBox(PointType const& SearchMinPoint, PointType const& SearchMaxPoint, IteratorType& Results, SizeType& NumberOfResults,
810  SizeType const& MaxNumberOfResults ) override
811  {
812  NumberOfResults = 0;
813  SearchStructureType Box( CalculateCell(SearchMinPoint), CalculateCell(SearchMaxPoint), mN );
814  SearchInBoxLocal( SearchMinPoint, SearchMaxPoint, Results, NumberOfResults, MaxNumberOfResults, Box );
815  }
816 
817  //************************************************************************
818 
819  // Dimension = 1
820  void SearchInBoxLocal( PointType const& SearchMinPoint, PointType const& SearchMaxPoint, IteratorType& ResultsPoint,
821  SizeType& NumberOfResults, SizeType const& MaxNumberOfResults,
823  {
824  for(IndexType I = Box.Axis[0].Begin() ; I <= Box.Axis[0].End() ; I += Box.Axis[0].Block )
825  SearchBoxInRange()(SearchMinPoint,SearchMaxPoint,mCells[I].begin(),mCells[I].end(),ResultsPoint,NumberOfResults,MaxNumberOfResults);
826  }
827 
828  // Dimension = 2
829  void SearchInBoxLocal( PointType const& SearchMinPoint, PointType const& SearchMaxPoint, IteratorType& ResultsPoint,
830  SizeType& NumberOfResults, SizeType const& MaxNumberOfResults,
832  {
833  for(IndexType II = Box.Axis[1].Begin() ; II <= Box.Axis[1].End() ; II += Box.Axis[1].Block )
834  for(IndexType I = II + Box.Axis[0].Begin() ; I <= II + Box.Axis[0].End() ; I += Box.Axis[0].Block )
835  SearchBoxInRange()(SearchMinPoint,SearchMaxPoint,mCells[I].begin(),mCells[I].end(),ResultsPoint,NumberOfResults,MaxNumberOfResults);
836  }
837 
838  // Dimension = 3
839  void SearchInBoxLocal( PointType const& SearchMinPoint, PointType const& SearchMaxPoint, IteratorType& ResultsPoint,
840  SizeType& NumberOfResults, SizeType const& MaxNumberOfResults,
842  {
843  for(IndexType III = Box.Axis[2].Begin() ; III <= Box.Axis[2].End() ; III += Box.Axis[2].Block )
844  for(IndexType II = III + Box.Axis[1].Begin() ; II <= III + Box.Axis[1].End() ; II += Box.Axis[1].Block )
845  for(IndexType I = II + Box.Axis[0].Begin() ; I <= II + Box.Axis[0].End() ; I += Box.Axis[0].Block )
846  SearchBoxInRange()(SearchMinPoint,SearchMaxPoint,mCells[I].begin(),mCells[I].end(),ResultsPoint,NumberOfResults,MaxNumberOfResults);
847  }
848 
849  //************************************************************************
850 
852  virtual std::string Info() const
853  {
854  return "BinsDynamic";
855  }
856 
858  virtual void PrintInfo(std::ostream& rOStream) const
859  {
860  rOStream << "BinsDynamic";
861  }
862 
864  void PrintData(std::ostream& rOStream, std::string const& Perfix = std::string()) const override
865  {
866  rOStream << Perfix << "Bin[" << SearchUtils::PointerDistance(mitPointsBegin, mitPointsEnd) << "] : " << std::endl;
867  for(typename CellContainerType::const_iterator i_cell = mCells.begin() ; i_cell != mCells.end() ; i_cell++)
868  {
869  rOStream << Perfix << "[ " ;
870  for(typename LocalContainerType::const_iterator i_point = i_cell->begin() ; i_point != i_cell->end() ; i_point++)
871  rOStream << **i_point << " ";
872  rOStream << " ]" << std::endl;
873  }
874  rOStream << std::endl;
875  }
876 
878  void PrintSize( std::ostream& rout )
879  {
880  rout << " BinsSize: ";
881  for(SizeType i = 0 ; i < Dimension ; i++)
882  rout << "[" << mN[i] << "]";
883  rout << std::endl;
884  }
885 
887  void PrintBox( std::ostream& rout )
888  {
889  rout << " BinsBox: Min [";
890  GetMinPoint().Print(rout);
891  rout << "]; Max [";
892  GetMaxPoint().Print(rout);
893  rout << "]; Size [";
894  mCellSize.Print(rout);
895  rout << "]" << std::endl;
896  }
897 
900 
902  BinsDynamic(BinsDynamic const& rOther);
903 
904 private:
907 
908  IteratorType mitPointsBegin;
909  IteratorType mitPointsEnd;
910 
911  BoundingBoxType mBoundingBox;
912 
913  CoordinateArray mCellSize;
914 
915  CoordinateArray mInvCellSize;
916 
917  SizeArray mN;
918 
919  SizeType mNumCells;
920 
921  CellContainerType mCells;
922 
923  // Work Variables ( For non-copy of Search Variables )
924  //BinBox SearchBox;
925 
927 public:
928  static TreeNodeType* Construct(IteratorType PointsBegin, IteratorType PointsEnd, PointType MaxPoint, PointType MinPoint, SizeType BucketSize)
929  {
930  const SizeType number_of_points = SearchUtils::PointerDistance(PointsBegin,PointsEnd);
931  if (number_of_points == 0) {
932  return NULL;
933  } else {
934  return new BinsDynamic( PointsBegin, PointsEnd, MinPoint, MaxPoint, BucketSize );
935  }
936 
937  }
938 
939 };
940 
944 
948 
950 template<
951  std::size_t TDimension,
952  class TPointType,
953  class TContainerType,
954  class TPointerType,
955  class TIteratorType,
956  class TDistanceIteratorType,
957  class TDistanceFunction >
958 std::ostream & operator<<( std::ostream& rOStream,
960 {
961  rThis.PrintInfo(rOStream);
962  rOStream << std::endl;
963  rThis.PrintSize(rOStream);
964  rThis.PrintData(rOStream);
965  return rOStream;
966 }
968 
969 } // namespace Kratos.
A dynamic binning data structure template for organizing and querying points in multi-dimensional spa...
Definition: bins_dynamic.h:57
void SearchNearestPoint(PointType const &ThisPoint, PointerType &rResult, CoordinateType &rResultDistance) override
Definition: bins_dynamic.h:552
BinsDynamic(IteratorType const &PointBegin, IteratorType const &PointEnd, PointType const &MinPoint, PointType const &MaxPoint, SizeType BucketSize=1)
Constructor for BinsDynamic with iterators, min point, max point, and optional bucket size.
Definition: bins_dynamic.h:158
SizeType SearchInRadius(PointType const &ThisPoint, CoordinateType Radius, IteratorType Results, SizeType MaxNumberOfResults, SearchStructureType &Box)
Definition: bins_dynamic.h:700
SizeType SearchInRadius(PointType const &ThisPoint, CoordinateType const &Radius, IteratorType Results, DistanceIteratorType ResultsDistances, SizeType const &MaxNumberOfResults)
Definition: bins_dynamic.h:604
void SearchNearestPointLocal(PointType const &ThisPoint, PointerType &rResult, CoordinateType &rResultDistance, SearchStructureType &Box)
Definition: bins_dynamic.h:581
TDistanceFunction DistanceFunction
Definition: bins_dynamic.h:85
SizeArray & GetDivisions()
Get the Divisions object.
Definition: bins_dynamic.h:266
void SearchInBoxLocal(PointType const &SearchMinPoint, PointType const &SearchMaxPoint, IteratorType &ResultsPoint, SizeType &NumberOfResults, SizeType const &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 1 > &Box)
Definition: bins_dynamic.h:820
std::vector< CoordinateType > CoordinateVectorType
Definition: bins_dynamic.h:110
void SearchInRadiusLocal(PointType const &ThisPoint, CoordinateType const &Radius, CoordinateType const &Radius2, IteratorType &Results, SizeType &NumberOfResults, SizeType const &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 1 > &Box)
Definition: bins_dynamic.h:733
void PrintData(std::ostream &rOStream, std::string const &Perfix=std::string()) const override
Print object's data.
Definition: bins_dynamic.h:864
IndexType CalculateIndex(CellType const &ThisIndex)
Calculate the index of a cell within the cell container.
Definition: bins_dynamic.h:445
std::vector< LocalContainerType > CellContainerType
Definition: bins_dynamic.h:104
IndexType CalculatePosition(CoordinateType const &ThisCoord, SizeType ThisDimension)
Calculate the position of a coordinate in a specific dimension.
Definition: bins_dynamic.h:417
void SearchInBoxLocal(PointType const &SearchMinPoint, PointType const &SearchMaxPoint, IteratorType &ResultsPoint, SizeType &NumberOfResults, SizeType const &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 3 > &Box)
Definition: bins_dynamic.h:839
typename TreeNodeType::IndexType IndexType
Definition: bins_dynamic.h:91
Kratos::SearchUtils::SearchRadiusInRange< PointType, LocalIterator, DistanceIteratorType, DistanceFunction, SizeType, CoordinateType, IteratorType > SearchRadiusInRange
Definition: bins_dynamic.h:107
CellContainerType & GetCellContainer()
Get the Cell Container object.
Definition: bins_dynamic.h:257
PointType & GetMaxPoint()
Get a reference to the high point of the bounding box.
Definition: bins_dynamic.h:293
TIteratorType IteratorType
Definition: bins_dynamic.h:82
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: bins_dynamic.h:858
CoordinateArray & GetCellSize()
Get the Cell Size object.
Definition: bins_dynamic.h:275
SizeType SearchInBox(PointType const &SearchMinPoint, PointType const &SearchMaxPoint, IteratorType Results, SizeType MaxNumberOfResults)
Definition: bins_dynamic.h:798
PointerType SearchNearestPoint(PointType const &ThisPoint, CoordinateType &ResultDistance)
Definition: bins_dynamic.h:526
void SearchNearestInBox(PointType const &ThisPoint, PointerType &ResultPoint, CoordinateType &ResultDistance, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 1 > &Box, bool &Found)
Definition: bins_dynamic.h:766
void SearchInBoxLocal(PointType const &SearchMinPoint, PointType const &SearchMaxPoint, IteratorType &ResultsPoint, SizeType &NumberOfResults, SizeType const &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 2 > &Box)
Definition: bins_dynamic.h:829
void SearchNearestPoint(PointType *const &ThisPoints, SizeType const &NumberOfPoints, IteratorType &Results, std::vector< CoordinateType > ResultsDistances)
Definition: bins_dynamic.h:571
@ Dimension
Definition: bins_dynamic.h:76
BoundingBox< PointType > & GetBoundingBox()
Get the bounding box.
Definition: bins_dynamic.h:303
typename TreeNodeType::IteratorIteratorType IteratorIteratorType
Definition: bins_dynamic.h:97
std::vector< DistanceIteratorType > DistanceIteratorVectorType
Definition: bins_dynamic.h:112
void SearchInRadius(PointType const &ThisPoint, CoordinateType const &Radius, CoordinateType const &Radius2, IteratorType &Results, SizeType &NumberOfResults, SizeType const &MaxNumberOfResults, SearchStructureType &Box) override
Definition: bins_dynamic.h:721
KRATOS_DEPRECATED CoordinateType CellSize(SizeType const &iDim)
Get the size of a cell in a specific dimension.
Definition: bins_dynamic.h:237
void SearchInRadius(PointerType const &ThisPoints, SizeType const &NumberOfPoints, CoordinateVectorType const &Radius, IteratorVectorType Results, DistanceIteratorVectorType ResultsDistances, std::vector< SizeType > &NumberOfResults, SizeType const &MaxNumberOfResults)
Definition: bins_dynamic.h:646
KRATOS_CLASS_POINTER_DEFINITION(BinsDynamic)
Pointer definition of BinsDynamic.
void CalculateCellSize(const std::size_t ApproximatedSize)
Calculates the cell size of the bins.
Definition: bins_dynamic.h:341
SizeType SearchInRadius(PointType const &ThisPoint, CoordinateType Radius, IteratorType Results, SizeType MaxNumberOfResults)
Definition: bins_dynamic.h:689
static TreeNodeType * Construct(IteratorType PointsBegin, IteratorType PointsEnd, PointType MaxPoint, PointType MinPoint, SizeType BucketSize)
Bins Access Vector ( vector<Iterator> )
Definition: bins_dynamic.h:928
TreeNode< Dimension, TPointType, TPointerType, TIteratorType, TDistanceIteratorType > TreeNodeType
Definition: bins_dynamic.h:87
typename LocalContainerType::iterator LocalIterator
Definition: bins_dynamic.h:101
void SearchNearestPoint(PointType const &ThisPoint, PointerType &rResult, CoordinateType &rResultDistance, SearchStructureType &Box) override
Definition: bins_dynamic.h:561
void PrintBox(std::ostream &rout)
Print Limits Points of the Container.
Definition: bins_dynamic.h:887
PointerType ExistPoint(PointerType const &ThisPoint, CoordinateType const Tolerance=static_cast< CoordinateType >(10.0 *DBL_EPSILON))
Definition: bins_dynamic.h:498
void GenerateBins()
Generate bins by assigning points to cells.
Definition: bins_dynamic.h:405
void PrintSize(std::ostream &rout)
Print Size of Container.
Definition: bins_dynamic.h:878
void SearchInRadius(PointType const &ThisPoint, CoordinateType const &Radius, CoordinateType const &Radius2, IteratorType &Results, SizeType &NumberOfResults, SizeType const &MaxNumberOfResults) override
Definition: bins_dynamic.h:712
TDistanceIteratorType DistanceIteratorType
Definition: bins_dynamic.h:83
Kratos::SearchUtils::SearchNearestInRange< PointType, PointerType, LocalIterator, DistanceFunction, CoordinateType > SearchNearestInRange
Definition: bins_dynamic.h:106
PointType & GetMinPoint()
Get a reference to the low point of the bounding box.
Definition: bins_dynamic.h:284
void AllocateCellsContainer()
Allocate memory for the cell container.
Definition: bins_dynamic.h:392
void SearchInBox(PointType const &SearchMinPoint, PointType const &SearchMaxPoint, IteratorType &Results, SizeType &NumberOfResults, SizeType const &MaxNumberOfResults) override
Definition: bins_dynamic.h:809
SizeType SearchInRadius(PointType const &ThisPoint, CoordinateType const &Radius, IteratorType Results, DistanceIteratorType ResultsDistances, SizeType const &MaxNumberOfResults, SearchStructureType &Box)
Definition: bins_dynamic.h:616
void SearchInRadius(PointType const &ThisPoint, CoordinateType const &Radius, CoordinateType const &Radius2, IteratorType &Results, DistanceIteratorType &ResultsDistances, SizeType &NumberOfResults, SizeType const &MaxNumberOfResults) override
Definition: bins_dynamic.h:628
typename GetObjectType< PointType >::type ObjectType
Definition: bins_dynamic.h:80
BinsDynamic()
Default constructor for BinsDynamic.
Definition: bins_dynamic.h:128
void SearchInRadiusLocal(PointType const &ThisPoint, CoordinateType const &Radius, CoordinateType const &Radius2, IteratorType &Results, DistanceIteratorType &ResultsDistances, SizeType &NumberOfResults, SizeType const &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 3 > &Box)
Definition: bins_dynamic.h:677
LocalIterator PointIterator
Definition: bins_dynamic.h:116
void SearchInRadiusLocal(PointType const &ThisPoint, CoordinateType const &Radius, CoordinateType const &Radius2, IteratorType &Results, DistanceIteratorType &ResultsDistances, SizeType &NumberOfResults, SizeType const &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 2 > &Box)
Definition: bins_dynamic.h:667
IteratorType Begin()
Get an iterator pointing to the beginning of the point data.
Definition: bins_dynamic.h:217
BinsDynamic & operator=(BinsDynamic const &rOther)
Assignment operator.
BinsDynamic(PointType const &MinPoint, PointType const &MaxPoint, SizeType BucketSize)
Constructor for BinsDynamic with min point, max point, and optional bucket size.
Definition: bins_dynamic.h:176
TPointType PointType
Definition: bins_dynamic.h:78
void CalculateBoundingBox()
Calculate the bounding box of the tree node.
Definition: bins_dynamic.h:316
std::vector< IteratorType > IteratorVectorType
Definition: bins_dynamic.h:111
typename TreeNodeType::SizeType SizeType
Definition: bins_dynamic.h:90
PointerType SearchNearestPoint(PointType const &ThisPoint)
Definition: bins_dynamic.h:512
typename TreeNodeType::CoordinateType CoordinateType
Definition: bins_dynamic.h:89
typename TreeNodeType::SearchStructureType SearchStructureType
Definition: bins_dynamic.h:98
void AssignCellSize(CoordinateType BoxSize)
Assign a uniform cell size for all dimensions.
Definition: bins_dynamic.h:379
KRATOS_DEPRECATED SizeType NumCell(SizeType const &iDim)
Get the number of cells in a specific dimension.
Definition: bins_dynamic.h:248
void SearchNearestInBox(PointType const &ThisPoint, PointerType &ResultPoint, CoordinateType &ResultDistance, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 2 > &Box, bool &Found)
Definition: bins_dynamic.h:775
CellType CalculateCell(PointType const &ThisPoint, CoordinateType Radius)
Calculate the cell index of a point with an added radius.
Definition: bins_dynamic.h:477
void SearchInRadius(PointType const &ThisPoint, CoordinateType const &Radius, CoordinateType const &Radius2, IteratorType &Results, DistanceIteratorType &ResultsDistances, SizeType &NumberOfResults, SizeType const &MaxNumberOfResults, SearchStructureType &Box) override
Definition: bins_dynamic.h:637
PointerType SearchNearestPoint(PointType const &ThisPoint, CoordinateType &rResultDistance, SearchStructureType &Box)
Definition: bins_dynamic.h:541
BinsDynamic(IteratorType const &PointBegin, IteratorType const &PointEnd, CoordinateType BoxSize, SizeType BucketSize=1)
Constructor for BinsDynamic with iterators, box size, and optional bucket size.
Definition: bins_dynamic.h:190
void AddPoint(PointerType const &ThisPoint)
Add a point to the appropriate cell.
Definition: bins_dynamic.h:490
IteratorType End()
Get an iterator pointing to the end of the point data.
Definition: bins_dynamic.h:226
void SearchInRadiusLocal(PointType const &ThisPoint, CoordinateType const &Radius, CoordinateType const &Radius2, IteratorType &Results, SizeType &NumberOfResults, SizeType const &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 2 > &Box)
Definition: bins_dynamic.h:742
void SearchInRadiusLocal(PointType const &ThisPoint, CoordinateType const &Radius, CoordinateType const &Radius2, IteratorType &Results, SizeType &NumberOfResults, SizeType const &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 3 > &Box)
Definition: bins_dynamic.h:752
void SearchInRadiusLocal(PointType const &ThisPoint, CoordinateType const &Radius, CoordinateType const &Radius2, IteratorType &Results, DistanceIteratorType &ResultsDistances, SizeType &NumberOfResults, SizeType const &MaxNumberOfResults, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 1 > &Box)
Definition: bins_dynamic.h:658
virtual std::string Info() const
Turn back information as a string.
Definition: bins_dynamic.h:852
IndexType CalculateIndex(PointType const &ThisPoint)
Calculate the index of a point within the cell container.
Definition: bins_dynamic.h:429
Kratos::SearchUtils::SearchBoxInRange< PointType, LocalIterator, SizeType, Dimension, IteratorType > SearchBoxInRange
Definition: bins_dynamic.h:108
BinsDynamic(IteratorType const &PointBegin, IteratorType const &PointEnd, SizeType BucketSize=1)
Constructor for BinsDynamic with iterators and optional bucket size.
Definition: bins_dynamic.h:138
LocalContainerType PointVector
Definition: bins_dynamic.h:115
TContainerType ContainerType
Definition: bins_dynamic.h:81
TPointerType PointerType
Definition: bins_dynamic.h:84
std::vector< PointerType > LocalContainerType
Definition: bins_dynamic.h:100
~BinsDynamic() override
Definition: bins_dynamic.h:203
CellType CalculateCell(PointType const &ThisPoint)
Calculate the cell index of a point.
Definition: bins_dynamic.h:462
void SearchNearestInBox(PointType const &ThisPoint, PointerType &ResultPoint, CoordinateType &ResultDistance, SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, 3 > &Box, bool &Found)
Definition: bins_dynamic.h:785
BinsDynamic(BinsDynamic const &rOther)
Copy constructor.
TPointType & GetMinPoint()
Gets a reference to the minimum point.
Definition: bounding_box.h:179
TPointType & GetMaxPoint()
Gets a reference to the maximum point.
Definition: bounding_box.h:199
Definition: cell.h:49
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
SubBinAxis< IndexType, SizeType > Axis[3]
Definition: search_structure.h:326
Definition: search_structure.h:142
Definition: search_structure.h:160
Definition: search_structure.h:194
Definition: search_structure.h:109
Short class definition.
Definition: tree.h:61
SearchStructure< IndexType, SizeType, CoordinateType, TIteratorType, IteratorIteratorType, TDimension > SearchStructureType
Define SearchStructureType as a SearchStructure type with the given template arguments.
Definition: tree.h:97
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_DEPRECATED
Definition: define.h:738
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
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
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
def Index()
Definition: hdf5_io_tools.py:38
namespace
Definition: array_1d.h:793
integer i
Definition: TensorModule.f:17
#define DBL_MAX
Definition: search_structure.h:23
typename T::ObjectType type
Definition: bins_dynamic.h:70
Definition: bins_dynamic.h:64
void type
Definition: bins_dynamic.h:65