3 #if !defined(KRATOS_BINS_DYNAMIC_OBJECTS_CONTAINER_PERIODIC_H_INCLUDED)
4 #define KRATOS_BINS_DYNAMIC_OBJECTS_CONTAINER_PERIODIC_H_INCLUDED
48 template<
class TConfigure>
103 SetDomainLimits(domain_min, domain_max);
115 if (ThisCoord < this->mDomainMin[ThisDimension]){
116 CoordinateType domain_period = this->mDomainMax[ThisDimension] - this->mDomainMin[ThisDimension];
117 d_index += domain_period;
120 else if (ThisCoord > this->mDomainMax[ThisDimension]){
121 CoordinateType domain_period = this->mDomainMax[ThisDimension] - this->mDomainMin[ThisDimension];
122 d_index -= domain_period;
125 d_index -= this->
mMinPoint[ThisDimension];
133 const double& Radius,
135 const SizeType& MaxNumberOfResults)
override
141 TConfigure::CalculateBoundingBox(ThisObject, Low, High, Radius);
152 return NumberOfResults;
156 const double& Radius,
159 const SizeType& MaxNumberOfResults)
override
165 TConfigure::CalculateBoundingBox(ThisObject, Low, High, Radius);
177 return NumberOfResults;
189 TConfigure::CalculateBoundingBox(*i_object, Low, High);
211 IndexType I_begin = Box.
Axis[0].BeginIndex();
214 MinCell[2] = MinBox[2];
215 MaxCell[2] = MaxBox[2];
216 int III_size =
int(Box.
Axis[2].Size()) + 1;
218 for (
IndexType III = III_begin; III_size > 0; NextIndex(III, III_size, MinCell, MaxCell, Box.
Axis, 2)){
219 MinCell[1] = MinBox[1];
220 MaxCell[1] = MaxBox[1];
221 int II_size =
int(Box.
Axis[1].Size()) + 1;
223 for (
IndexType II = II_begin; II_size > 0; NextIndex(II, II_size, MinCell, MaxCell, Box.
Axis, 1)){
224 MinCell[0] = MinBox[0];
225 MaxCell[0] = MaxBox[0];
226 int I_size =
int(Box.
Axis[0].Size()) + 1;
228 for (
IndexType I = I_begin; I_size > 0; NextIndex(I, I_size, MinCell, MaxCell, Box.
Axis, 0)){
231 if (TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell, Radius)){
232 this->
mCells[GlobalIndex].SearchObjectsInRadiusExclusive(ThisObject,
259 IndexType I_begin = Box.
Axis[0].BeginIndex();
262 MinCell[2] = MinBox[2];
263 MaxCell[2] = MaxBox[2];
265 int III_size =
int(Box.
Axis[2].Size()) + 1;
267 for (
IndexType III = III_begin; III_size > 0; NextIndex(III, III_size, MinCell, MaxCell, Box.
Axis, 2)){
268 MinCell[1] = MinBox[1];
269 MaxCell[1] = MaxBox[1];
270 int II_size =
int(Box.
Axis[1].Size()) + 1;
272 for (
IndexType II = II_begin; II_size > 0; NextIndex(II, II_size, MinCell, MaxCell, Box.
Axis, 1)){
273 MinCell[0] = MinBox[0];
274 MaxCell[0] = MaxBox[0];
275 int I_size =
int(Box.
Axis[0].Size()) + 1;
277 for (
IndexType I = I_begin; I_size > 0; NextIndex(I, I_size, MinCell, MaxCell, Box.
Axis, 0)){
280 if (TConfigure::IntersectionBox(ThisObject, MinCell, MaxCell, Radius)){
281 this->
mCells[GlobalIndex].SearchObjectsInRadiusExclusive(ThisObject,
303 MinCell[2] = MinBox[2];
304 MaxCell[2] = MaxBox[2];
309 int III_size =
int(Box.
Axis[2].Size()) + 1;
311 for (
IndexType III = III_begin; III_size > 0; NextIndex(III, III_size, MinCell, MaxCell, Box.
Axis, 2)){
312 MinCell[1] = MinBox[1];
313 MaxCell[1] = MaxBox[1];
314 int II_size =
int(Box.
Axis[1].Size()) + 1;
316 for (
IndexType II = II_begin; II_size > 0; NextIndex(II, II_size, MinCell, MaxCell, Box.
Axis, 1)){
317 MinCell[0] = MinBox[0];
318 MaxCell[0] = MaxBox[0];
319 int I_size =
int(Box.
Axis[0].Size()) + 1;
321 for (
IndexType I = I_begin; I_size > 0; NextIndex(I, I_size, MinCell, MaxCell, Box.
Axis, 0)){
323 this->
mCells[GlobalIndex].Add(i_object);
340 mDomainMin[0] = domain_min[0];
341 mDomainMin[1] = domain_min[1];
342 mDomainMin[2] = domain_min[2];
343 mDomainMax[0] = domain_max[0];
344 mDomainMax[1] = domain_max[1];
345 mDomainMax[2] = domain_max[2];
411 this->
mN = rOther.
mN;
443 template<
class TConfigure>
451 template<
class TConfigure>
456 rOStream << std::endl;
Short class definition.
Definition: bins_dynamic_objects.h:57
TreeNodeType::CoordinateType CoordinateType
Definition: bins_dynamic_objects.h:75
CellContainerType mCells
Definition: bins_dynamic_objects.h:1721
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 mMinPoint
Definition: bins_dynamic_objects.h:1710
CoordinateArray mCellSize
Definition: bins_dynamic_objects.h:1717
virtual void PrintData(std::ostream &rOStream, std::string const &Perfix=std::string()) const
Definition: bins_dynamic_objects.h:707
virtual void PrintInfo(std::ostream &rOStream) const
Definition: bins_dynamic_objects.h:698
TConfigure::IteratorType IteratorType
Definition: bins_dynamic_objects.h:68
PointType mMaxPoint
Definition: bins_dynamic_objects.h:1711
void AllocateContainer()
Definition: bins_dynamic_objects.h:1662
TConfigure::ResultIteratorType ResultIteratorType
Definition: bins_dynamic_objects.h:70
TConfigure::DistanceIteratorType DistanceIteratorType
Definition: bins_dynamic_objects.h:71
TreeNodeType::IndexType IndexType
Definition: bins_dynamic_objects.h:77
IteratorType mObjectsBegin
Definition: bins_dynamic_objects.h:1714
void CalculateCellSize(std::size_t ApproximatedSize)
Calculates the cell size of the bins.
Definition: bins_dynamic_objects.h:826
SizeArray mN
Definition: bins_dynamic_objects.h:1719
SizeType mObjectsSize
Definition: bins_dynamic_objects.h:1713
CoordinateArray mInvCellSize
Definition: bins_dynamic_objects.h:1718
TreeNodeType::SizeType SizeType
Definition: bins_dynamic_objects.h:76
Short class definition.
Definition: bins_dynamic_objects_periodic.h:49
BinsObjectDynamic< TConfigure > BaseClassBins
Definition: bins_dynamic_objects_periodic.h:54
TConfigure::ResultContainerType ResultContainerType
Definition: bins_dynamic_objects_periodic.h:60
virtual ~BinsObjectDynamicPeriodic()
Destructor.
Definition: bins_dynamic_objects_periodic.h:110
Tvector< CoordinateType, Dimension > CoordinateArray
Definition: bins_dynamic_objects_periodic.h:76
Tvector< IndexType, Dimension > IndexArray
Definition: bins_dynamic_objects_periodic.h:74
TConfigure::DistanceIteratorType DistanceIteratorType
Definition: bins_dynamic_objects_periodic.h:62
void SearchInRadiusExclusivePeriodic(PointerType &ThisObject, CoordinateType const &Radius, ResultIteratorType &Result, DistanceIteratorType ResultDistances, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructureType &Box)
Definition: bins_dynamic_objects_periodic.h:243
TConfigure::IteratorType IteratorType
Definition: bins_dynamic_objects_periodic.h:59
TConfigure::ResultIteratorType ResultIteratorType
Definition: bins_dynamic_objects_periodic.h:61
std::vector< CellType > CellContainerType
Definition: bins_dynamic_objects_periodic.h:65
TreeNode< Dimension, PointType, PointerType, IteratorType, typename TConfigure::DistanceIteratorType > TreeNodeType
Definition: bins_dynamic_objects_periodic.h:68
TreeNodeType::IteratorIteratorType IteratorIteratorType
typedef TreeNodeType LeafType;
Definition: bins_dynamic_objects_periodic.h:79
TConfigure Configure
Definition: bins_dynamic_objects_periodic.h:55
TConfigure::PointType PointType
Definition: bins_dynamic_objects_periodic.h:56
void SearchInRadiusExclusivePeriodic(PointerType &ThisObject, CoordinateType const &Radius, ResultIteratorType &Result, SizeType &NumberOfResults, const SizeType &MaxNumberOfResults, SearchStructureType &Box)
Definition: bins_dynamic_objects_periodic.h:195
TConfigure::PointerType PointerType
Definition: bins_dynamic_objects_periodic.h:57
void FillObjectPeriodic(SearchStructureType &Box, const PointerType &i_object)
Definition: bins_dynamic_objects_periodic.h:293
TConfigure::ContainerType ContainerType
Definition: bins_dynamic_objects_periodic.h:58
SearchStructurePeriodic< IndexType, SizeType, CoordinateType, IteratorType, IteratorIteratorType, Dimension > SearchStructureType
Definition: bins_dynamic_objects_periodic.h:81
@ Dimension
Definition: bins_dynamic_objects_periodic.h:53
BinsObjectDynamicPeriodic< TConfigure > & operator=(const BinsObjectDynamicPeriodic< TConfigure > &rOther)
Assignment operator.
Definition: bins_dynamic_objects_periodic.h:402
SizeType SearchObjectsInRadiusExclusive(PointerType &ThisObject, const double &Radius, ResultIteratorType &Results, const SizeType &MaxNumberOfResults) override
Definition: bins_dynamic_objects_periodic.h:132
SizeType SearchObjectsInRadiusExclusive(PointerType &ThisObject, const double &Radius, ResultIteratorType &Results, DistanceIteratorType ResultDistances, const SizeType &MaxNumberOfResults) override
Definition: bins_dynamic_objects_periodic.h:155
BinsObjectDynamicPeriodic(IteratorType const &ObjectsBegin, IteratorType const &ObjectsEnd, const array_1d< double, 3 > domain_min, const array_1d< double, 3 > domain_max)
Constructor de bins a bounding box.
Definition: bins_dynamic_objects_periodic.h:95
BinsObjectDynamicPeriodic(const BinsObjectDynamicPeriodic< T > &rOther)
Copy constructor.
Definition: bins_dynamic_objects_periodic.h:424
TreeNodeType::SizeType SizeType
Definition: bins_dynamic_objects_periodic.h:70
TreeNodeType::CoordinateType CoordinateType
Definition: bins_dynamic_objects_periodic.h:69
Tvector< SizeType, Dimension > SizeArray
Definition: bins_dynamic_objects_periodic.h:75
CellContainerType::iterator CellContainerIterator
Definition: bins_dynamic_objects_periodic.h:66
BinsObjectDynamicPeriodic(const BinsObjectDynamicPeriodic &rOther)
Copy constructor.
Definition: bins_dynamic_objects_periodic.h:417
IndexType CalculatePosition(CoordinateType const &ThisCoord, const SizeType &ThisDimension) override
Definition: bins_dynamic_objects_periodic.h:112
TreeNodeType::IndexType IndexType
Definition: bins_dynamic_objects_periodic.h:71
void GenerateBins() override
Definition: bins_dynamic_objects_periodic.h:182
BinsObjectDynamicPeriodic()
Default constructor.
Definition: bins_dynamic_objects_periodic.h:92
Cell< Configure > CellType
Definition: bins_dynamic_objects_periodic.h:64
KRATOS_CLASS_POINTER_DEFINITION(BinsObjectDynamicPeriodic)
Pointer definition of BinsObjectDynamicPeriodic.
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
Definition: search_structure_periodic.h:119
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
Short class definition.
Definition: search_structure.h:53
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::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
REACTION_CHECK_STIFFNESS_FACTOR int
Definition: contact_structural_mechanics_application_variables.h:75
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123
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