BioDynaMo  v1.05.119-a4ff3934
Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
bdm::OctreeEnvironment Class Reference

#include <octree_environment.h>

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

Classes

struct  UnibnImpl
 

Public Member Functions

 OctreeEnvironment ()
 
 ~OctreeEnvironment () 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< UnibnImplimpl_
 
AgentContainercontainer_ = nullptr
 
std::array< int32_t, 6 > grid_dimensions_
 
std::array< int32_t, 2 > threshold_dimensions_
 

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 43 of file octree_environment.h.

Constructor & Destructor Documentation

◆ OctreeEnvironment()

bdm::OctreeEnvironment::OctreeEnvironment ( )

Definition at line 27 of file octree_environment.cc.

◆ ~OctreeEnvironment()

bdm::OctreeEnvironment::~OctreeEnvironment ( )
override

Definition at line 34 of file octree_environment.cc.

Member Function Documentation

◆ CheckGridGrowth()

void bdm::OctreeEnvironment::CheckGridGrowth ( )
private

Definition at line 160 of file octree_environment.cc.

◆ Clear()

void bdm::OctreeEnvironment::Clear ( )
overridevirtual

Implements bdm::Environment.

Definition at line 144 of file octree_environment.cc.

◆ ForEachNeighbor() [1/3]

void bdm::OctreeEnvironment::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 117 of file octree_environment.cc.

◆ ForEachNeighbor() [2/3]

void bdm::OctreeEnvironment::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 88 of file octree_environment.cc.

◆ ForEachNeighbor() [3/3]

void bdm::OctreeEnvironment::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 94 of file octree_environment.cc.

◆ GetDimensions()

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

Implements bdm::Environment.

Definition at line 124 of file octree_environment.cc.

◆ GetDimensionThresholds()

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

Implements bdm::Environment.

Definition at line 128 of file octree_environment.cc.

◆ GetLoadBalanceInfo()

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

Implements bdm::Environment.

Definition at line 132 of file octree_environment.cc.

◆ GetNeighborMutexBuilder()

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

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

Implements bdm::Environment.

Definition at line 140 of file octree_environment.cc.

◆ RoundOffGridDimensions()

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

Definition at line 150 of file octree_environment.cc.

◆ UpdateImplementation()

void bdm::OctreeEnvironment::UpdateImplementation ( )
overrideprotectedvirtual

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

Implements bdm::Environment.

Definition at line 39 of file octree_environment.cc.

Member Data Documentation

◆ container_

AgentContainer* bdm::OctreeEnvironment::container_ = nullptr
private

Definition at line 77 of file octree_environment.h.

◆ grid_dimensions_

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

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

Definition at line 80 of file octree_environment.h.

◆ impl_

std::unique_ptr<UnibnImpl> bdm::OctreeEnvironment::impl_
private

Definition at line 76 of file octree_environment.h.

◆ threshold_dimensions_

std::array<int32_t, 2> bdm::OctreeEnvironment::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 83 of file octree_environment.h.


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