23 #define DBL_MAX (1.0/DBL_EPSILON)
51 template<
class T, std::
size_t TDimension >
59 for(std::size_t
i = 0;
i < TDimension;
i++)
64 for(std::size_t
i = 0;
i < TDimension;
i++)
69 for(std::size_t
i = 0;
i < TDimension;
i++)
90 template<
class TPo
interType >
91 std::size_t
PointerDistance( TPointerType
const& PointerBegin, TPointerType
const& PointerEnd )
94 return ( PointerEnd - PointerBegin );
98 template< std::
size_t TDimension,
class TPo
intType >
99 bool PointInBox( TPointType
const& BoxMinPoint, TPointType
const& BoxMaxPoint, TPointType
const& ThisPoint )
101 for(std::size_t
i = 0 ;
i < TDimension ;
i++)
102 if( ThisPoint[
i] < BoxMinPoint[
i] || ThisPoint[
i] > BoxMaxPoint[
i] )
107 template< std::
size_t TDimension,
class TPo
intType >
111 double operator()( TPointType
const& p1, TPointType
const& p2 )
113 double tmp = p1[0] - p2[0];
115 for( std::size_t
i = 1 ;
i < TDimension ;
i++)
124 template<
class TIteratorType,
class TSizeType,
class TResultIteratorType = TIteratorType >
128 void operator()( TIteratorType
const& RangeBegin, TIteratorType
const& RangeEnd, TResultIteratorType& Results,
129 TSizeType& NumberOfResults, TSizeType
const& MaxNumberOfResults )
131 for( TIteratorType
Point = RangeBegin; (
Point != RangeEnd)&&(NumberOfResults < MaxNumberOfResults);
Point++)
140 template<
class TPo
intType,
class TIteratorType,
class TSizeType, std::
size_t TDimension,
class TResultIteratorType = TIteratorType >
144 void operator()( TPointType
const& MinBoxPoint, TPointType
const& MaxBoxPoint, TIteratorType
const& RangeBegin, TIteratorType
const& RangeEnd,
145 TResultIteratorType& Results, TSizeType& NumberOfResults, TSizeType
const& MaxNumberOfResults )
147 for( TIteratorType
Point = RangeBegin; (
Point != RangeEnd)&&(NumberOfResults < MaxNumberOfResults);
Point++)
148 if ( PointInBox<TDimension,TPointType>(MinBoxPoint,MaxBoxPoint,**
Point) )
158 template<
class TPo
intType,
class TPo
interType,
class TIteratorType,
class TDistanceFunction,
class TCoordinateType >
162 void operator()(
const TIteratorType& RangeBegin,
const TIteratorType& RangeEnd,
const TPointType& ThisPoint, TPointerType& Result, TCoordinateType& Distance )
164 TCoordinateType NewDistance;
167 NewDistance = TDistanceFunction()(**
Point,ThisPoint);
168 if( NewDistance < Distance )
171 Distance = NewDistance;
175 void operator()(
const TIteratorType& RangeBegin,
const TIteratorType& RangeEnd,
const TPointType& ThisPoint, TPointerType& Result, TCoordinateType& Distance,
bool& Found )
177 TCoordinateType NewDistance;
180 NewDistance = TDistanceFunction()(**
Point,ThisPoint);
181 if( NewDistance < Distance )
184 Distance = NewDistance;
192 template<
class TPo
intType,
class TIteratorType,
class TDistanceIteratorType,
class TDistanceFunction,
class TSizeType,
class TCoordinateType,
class TResultIteratorType = TIteratorType >
197 void operator()( TIteratorType
const& RangeBegin, TIteratorType
const& RangeEnd, TPointType
const& ThisPoint, TCoordinateType
const& Radius,
198 TResultIteratorType& Results, TSizeType& NumberOfResults, TSizeType
const& MaxNumberOfResults )
200 TCoordinateType distance;
201 for(TIteratorType
Point = RangeBegin ; (
Point != RangeEnd) && (NumberOfResults < MaxNumberOfResults) ;
Point++)
203 distance = TDistanceFunction()(**
Point,ThisPoint);
204 if( distance < Radius )
213 void operator()( TIteratorType
const& RangeBegin, TIteratorType
const& RangeEnd, TPointType
const& ThisPoint, TCoordinateType
const& Radius,
214 TResultIteratorType& Results, TDistanceIteratorType& Distances, TSizeType& NumberOfResults, TSizeType
const& MaxNumberOfResults )
216 TCoordinateType distance;
217 for(TIteratorType
Point = RangeBegin ; (
Point != RangeEnd) && (NumberOfResults < MaxNumberOfResults) ;
Point++)
219 distance = TDistanceFunction()(**
Point,ThisPoint);
220 if( distance < Radius )
224 *Distances = distance;
239 template<
class IndexType,
class SizeType>
252 Set(Min_,Max_,MaxSize_,Block_);
257 Set(iCell,iCell,MaxSize_,Block_);
304 class CoordinateType,
306 class IteratorIteratorType,
307 std::size_t Dimension >
343 Set(Min_,Max_,MaxSize_,IteratorBegin);
348 Set(IndexCell,IndexCell,MaxSize_,IteratorBegin);
353 Set(Min_,Max_,MaxSize_);
358 Set(IndexCell,IndexCell,MaxSize_);
365 Set( IndexCell, IndexCell, _MaxSize, IteratorBegin );
371 Axis[0].Set(Min_[0],Max_[0],MaxSize_[0],Block);
374 Block *= MaxSize_[
i-1];
375 Axis[
i].Set(Min_[
i],Max_[
i],MaxSize_[
i],Block);
388 Set(IndexCell,IndexCell,MaxSize_);
394 Axis[0].Set(Min_[0],Max_[0],MaxSize_[0],Block);
397 Block *= MaxSize_[
i-1];
398 Axis[
i].Set(Min_[
i],Max_[
i],MaxSize_[
i],Block);
406 return Idx +
Axis[0].Min;
411 return Idx +
Axis[0].Max+1;
Point class.
Definition: point.h:59
Definition: search_structure.h:309
void Set(IndexVector const &Min_, IndexVector const &Max_, SizeVector const &MaxSize_, IteratorIteratorType const &IteratorBegin)
Definition: search_structure.h:368
SearchStructure(IndexVector const &Min_, IndexVector const &Max_, SizeVector const &MaxSize_)
Definition: search_structure.h:351
void Set(IndexVector const &IndexCell, SizeVector const &_MaxSize, IteratorIteratorType const &IteratorBegin)
Definition: search_structure.h:363
IndexType EndRow(IndexType const &Idx)
Definition: search_structure.h:409
SearchStructure const & operator++()
Definition: search_structure.h:414
CoordinateType distance_to_partition
Definition: search_structure.h:332
Tvector< IndexType, Dimension > IndexVector
Definition: search_structure.h:317
KRATOS_CLASS_POINTER_DEFINITION(SearchStructure)
Pointer definition of SearchStructure.
~SearchStructure()
Definition: search_structure.h:361
SizeType BucketCounter
Definition: search_structure.h:335
SearchStructure(IndexVector const &IndexCell, SizeVector const &MaxSize_, IteratorIteratorType const &IteratorBegin)
Definition: search_structure.h:346
SearchStructure const & operator--()
Definition: search_structure.h:428
CoordinateType residual_distance[Dimension]
Definition: search_structure.h:334
void Set(IndexVector const &Min_, IndexVector const &Max_, SizeVector const &MaxSize_)
Definition: search_structure.h:391
IteratorIteratorType DataBegin
Definition: search_structure.h:329
bool hasIterators
Definition: search_structure.h:325
void Set(IndexVector const &IndexCell, SizeVector const &MaxSize_)
Definition: search_structure.h:386
SearchStructure(IndexVector const &Min_, IndexVector const &Max_, SizeVector const &MaxSize_, IteratorIteratorType const &IteratorBegin)
Definition: search_structure.h:341
SearchStructure()
Definition: search_structure.h:339
SearchStructure(IndexVector const &IndexCell, SizeVector const &MaxSize_)
Definition: search_structure.h:356
IndexType BeginRow(IndexType const &Idx)
Definition: search_structure.h:404
IteratorIteratorType RowBegin
Definition: search_structure.h:327
SubBinAxis< IndexType, SizeType > Axis[3]
Definition: search_structure.h:326
IteratorIteratorType RowEnd
Definition: search_structure.h:328
Tvector< SizeType, Dimension > SizeVector
Definition: search_structure.h:318
SearchStructure< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, Dimension > ThisType
Definition: search_structure.h:320
CoordinateType distance_to_partition2
Definition: search_structure.h:333
Definition: search_structure.h:126
void operator()(TIteratorType const &RangeBegin, TIteratorType const &RangeEnd, TResultIteratorType &Results, TSizeType &NumberOfResults, TSizeType const &MaxNumberOfResults)
Definition: search_structure.h:128
Definition: search_structure.h:142
void operator()(TPointType const &MinBoxPoint, TPointType const &MaxBoxPoint, TIteratorType const &RangeBegin, TIteratorType const &RangeEnd, TResultIteratorType &Results, TSizeType &NumberOfResults, TSizeType const &MaxNumberOfResults)
Definition: search_structure.h:144
Definition: search_structure.h:160
void operator()(const TIteratorType &RangeBegin, const TIteratorType &RangeEnd, const TPointType &ThisPoint, TPointerType &Result, TCoordinateType &Distance)
Definition: search_structure.h:162
void operator()(const TIteratorType &RangeBegin, const TIteratorType &RangeEnd, const TPointType &ThisPoint, TPointerType &Result, TCoordinateType &Distance, bool &Found)
Definition: search_structure.h:175
Definition: search_structure.h:194
void operator()(TIteratorType const &RangeBegin, TIteratorType const &RangeEnd, TPointType const &ThisPoint, TCoordinateType const &Radius, TResultIteratorType &Results, TSizeType &NumberOfResults, TSizeType const &MaxNumberOfResults)
Definition: search_structure.h:197
void operator()(TIteratorType const &RangeBegin, TIteratorType const &RangeEnd, TPointType const &ThisPoint, TCoordinateType const &Radius, TResultIteratorType &Results, TDistanceIteratorType &Distances, TSizeType &NumberOfResults, TSizeType const &MaxNumberOfResults)
Definition: search_structure.h:213
Definition: search_structure.h:109
double operator()(TPointType const &p1, TPointType const &p2)
Definition: search_structure.h:111
TOOLS UTILS ///.
Definition: search_structure.h:241
SubBinAxis(IndexType const &Min_, IndexType const &Max_, IndexType const &MaxSize_, IndexType const &Block_)
Definition: search_structure.h:250
SubBinAxis const & operator++()
Definition: search_structure.h:286
IndexType Max
Definition: search_structure.h:244
IndexType Min
Definition: search_structure.h:243
IndexType EndIndex()
Definition: search_structure.h:278
void Set(IndexType const &Min_, IndexType const &Max_, IndexType const &MaxSize_, IndexType const &Block_)
Definition: search_structure.h:259
SubBinAxis()
Definition: search_structure.h:248
IndexType MaxSize
Definition: search_structure.h:245
SizeType Size()
Definition: search_structure.h:282
void Set(IndexType const &iCell, IndexType const &MaxSize_, IndexType const &Block_)
Definition: search_structure.h:255
~SubBinAxis()
Definition: search_structure.h:254
IndexType BeginIndex()
Definition: search_structure.h:274
IndexType Block
Definition: search_structure.h:246
IndexType Begin()
Definition: search_structure.h:266
IndexType End()
Definition: search_structure.h:270
SubBinAxis const & operator--()
Definition: search_structure.h:292
Short class definition.
Definition: search_structure.h:53
~Tvector()
Definition: search_structure.h:72
Tvector()
Definition: search_structure.h:57
Tvector(T const &value)
Definition: search_structure.h:62
Tvector(Tvector< T, TDimension > const &Other)
Definition: search_structure.h:67
T const & operator[](std::size_t index) const
Definition: search_structure.h:77
T & operator[](std::size_t index)
Definition: search_structure.h:73
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
static double max(double a, double b)
Definition: GeometryFunctions.h:79
static double min(double a, double b)
Definition: GeometryFunctions.h:71
std::size_t PointerDistance(TPointerType const &PointerBegin, TPointerType const &PointerEnd)
Definition: search_structure.h:91
bool PointInBox(TPointType const &BoxMinPoint, TPointType const &BoxMaxPoint, TPointType const &ThisPoint)
Definition: search_structure.h:99
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
float dist
Definition: edgebased_PureConvection.py:89
tuple tmp
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:98
integer i
Definition: TensorModule.f:17
Configure::IteratorType IteratorType
Definition: transfer_utility.h:249