BioDynaMo  v1.05.120-25dc9790
Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
bdm::KDTreeEnvironment Class Reference

#include <kd_tree_environment.h>

Inheritance diagram for bdm::KDTreeEnvironment:
[legend]
Collaboration diagram for bdm::KDTreeEnvironment:
[legend]

Classes

struct  NanoflannImpl
 

Public Member Functions

 KDTreeEnvironment ()
 
 ~KDTreeEnvironment () override
 
std::array< int32_t, 6 > GetDimensions () const override
 
std::array< int32_t, 2 > GetDimensionThresholds () const override
 
LoadBalanceInfoGetLoadBalanceInfo () override
 
NeighborMutexBuilderGetNeighborMutexBuilder () override
 
void Clear () override
 
void ForEachNeighbor (Functor< void, Agent *, real_t > &lambda, const Agent &query, real_t squared_radius) override
 
void ForEachNeighbor (Functor< void, Agent * > &lambda, const Agent &query, void *criteria) override
 
void ForEachNeighbor (Functor< void, Agent *, real_t > &lambda, const Real3 &query_position, real_t squared_radius, const Agent *query_agent=nullptr) override
 
- Public Member Functions inherited from bdm::Environment
virtual ~Environment ()=default
 
void MarkAsOutOfSync ()
 
void Update ()
 
void ForcedUpdate ()
 Updates the environment. Prefer Update() for implementations. More...
 
real_t GetLargestAgentSize () const
 Return the size of the largest agent. More...
 
real_t GetLargestAgentSizeSquared () const
 
bool HasGrown () const
 

Protected Member Functions

void UpdateImplementation () override
 
- Protected Member Functions inherited from bdm::Environment
void CalcSimDimensionsAndLargestAgent (std::array< real_t, 6 > *ret_grid_dimensions)
 

Private Member Functions

void RoundOffGridDimensions (const std::array< real_t, 6 > &grid_dimensions)
 
void CheckGridGrowth ()
 

Private Attributes

std::unique_ptr< NanoflannImplimpl_
 
std::array< int32_t, 6 > grid_dimensions_
 
std::array< int32_t, 2 > threshold_dimensions_
 
NanoFlannAdapternf_adapter_ = nullptr
 

Additional Inherited Members

- Protected Attributes inherited from bdm::Environment
bool has_grown_ = false
 
real_t largest_object_size_ = 0.0
 The size of the largest object in the simulation. More...
 
real_t largest_object_size_squared_ = 0.0
 

Detailed Description

Definition at line 70 of file kd_tree_environment.h.

Constructor & Destructor Documentation

◆ KDTreeEnvironment()

bdm::KDTreeEnvironment::KDTreeEnvironment ( )

Definition at line 35 of file kd_tree_environment.cc.

◆ ~KDTreeEnvironment()

bdm::KDTreeEnvironment::~KDTreeEnvironment ( )
override

Definition at line 44 of file kd_tree_environment.cc.

Member Function Documentation

◆ CheckGridGrowth()

void bdm::KDTreeEnvironment::CheckGridGrowth ( )
private

Definition at line 165 of file kd_tree_environment.cc.

◆ Clear()

void bdm::KDTreeEnvironment::Clear ( )
overridevirtual

Implements bdm::Environment.

Definition at line 149 of file kd_tree_environment.cc.

◆ ForEachNeighbor() [1/3]

void bdm::KDTreeEnvironment::ForEachNeighbor ( Functor< void, Agent * > &  lambda,
const Agent query,
void *  criteria 
)
overridevirtual

Iterates over all neighbors in an environment that suffices the given criteria. The criteria is type-erased to facilitate for different criteria for different environments. Check the documentation of an environment to know the criteria data type

Implements bdm::Environment.

Definition at line 122 of file kd_tree_environment.cc.

◆ ForEachNeighbor() [2/3]

void bdm::KDTreeEnvironment::ForEachNeighbor ( Functor< void, Agent *, real_t > &  lambda,
const Agent query,
real_t  squared_radius 
)
overridevirtual

Iterates over all neighbors of a query agent that appear in a distance of less than sqrt(squared_radius). Typically, the distance is computed as the Euclidean distance in 3D environments.

Implements bdm::Environment.

Definition at line 93 of file kd_tree_environment.cc.

◆ ForEachNeighbor() [3/3]

void bdm::KDTreeEnvironment::ForEachNeighbor ( Functor< void, Agent *, real_t > &  lambda,
const Real3 query_position,
real_t  squared_radius,
const Agent query_agent = nullptr 
)
overridevirtual

Iterates over all neighbors of a query position that appear in a distance of less than sqrt(squared_radius). Typically, the distance is computed as the Euclidean distance in 3D environments. Typically iterating over the neighbors of a certain agent or a certain position are fairly similar tasks. If you implement an environment, the optional argument agent_query can be used to to treat both cases in the same function, keep the implementation lean, and avoid redundant code.

Implements bdm::Environment.

Definition at line 99 of file kd_tree_environment.cc.

◆ GetDimensions()

std::array< int32_t, 6 > bdm::KDTreeEnvironment::GetDimensions ( ) const
overridevirtual

Implements bdm::Environment.

Definition at line 129 of file kd_tree_environment.cc.

◆ GetDimensionThresholds()

std::array< int32_t, 2 > bdm::KDTreeEnvironment::GetDimensionThresholds ( ) const
overridevirtual

Implements bdm::Environment.

Definition at line 133 of file kd_tree_environment.cc.

◆ GetLoadBalanceInfo()

LoadBalanceInfo * bdm::KDTreeEnvironment::GetLoadBalanceInfo ( )
overridevirtual

Implements bdm::Environment.

Definition at line 137 of file kd_tree_environment.cc.

◆ GetNeighborMutexBuilder()

Environment::NeighborMutexBuilder * bdm::KDTreeEnvironment::GetNeighborMutexBuilder ( )
overridevirtual

Returns the NeighborMutexBuilder. The client uses it to create a NeighborMutex.

Implements bdm::Environment.

Definition at line 145 of file kd_tree_environment.cc.

◆ RoundOffGridDimensions()

void bdm::KDTreeEnvironment::RoundOffGridDimensions ( const std::array< real_t, 6 > &  grid_dimensions)
private

Definition at line 155 of file kd_tree_environment.cc.

◆ UpdateImplementation()

void bdm::KDTreeEnvironment::UpdateImplementation ( )
overrideprotectedvirtual

Member function that is called by Update() and ForcedUpdate(). Pure virtual.

Implements bdm::Environment.

Definition at line 49 of file kd_tree_environment.cc.

Member Data Documentation

◆ grid_dimensions_

std::array<int32_t, 6> bdm::KDTreeEnvironment::grid_dimensions_
private

Cube which contains all simulation objects {x_min, x_max, y_min, y_max, z_min, z_max}

Definition at line 106 of file kd_tree_environment.h.

◆ impl_

std::unique_ptr<NanoflannImpl> bdm::KDTreeEnvironment::impl_
private

Definition at line 103 of file kd_tree_environment.h.

◆ nf_adapter_

NanoFlannAdapter* bdm::KDTreeEnvironment::nf_adapter_ = nullptr
private

Definition at line 110 of file kd_tree_environment.h.

◆ threshold_dimensions_

std::array<int32_t, 2> bdm::KDTreeEnvironment::threshold_dimensions_
private

Stores the min / max dimension value that need to be surpassed in order to trigger a diffusion grid change

Definition at line 109 of file kd_tree_environment.h.


The documentation for this class was generated from the following files: