BioDynaMo  v1.05.120-25dc9790
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
bdm Namespace Reference

Namespaces

 detail
 
 experimental
 
 in_place_exec_ctxt_detail
 
 memory_manager_detail
 
 neuroscience
 

Classes

class  Agent
 Contains code required by all agents. More...
 
class  AgentContainer
 
class  AgentFlatIdxMap
 
class  AgentHandle
 
struct  AgentHandleIterator
 
struct  AgentOperationImpl
 Interface for implementing an operation. More...
 
class  AgentPointer
 
class  AgentUid
 
class  AgentUidGenerator
 This class generates unique ids for agents. More...
 
class  AgentUidMap
 
class  AgentVector
 
struct  Aux
 
class  BasicExporter
 
class  Behavior
 
struct  BehaviorOp
 
class  BinomialRng
 
class  BoundaryCondition
 This class implements the boundary conditions. It is integrated into the diffusion grid as a smart pointer. The diffusion grid will call the Evaluate() method of the boundary condition object for Neumann and Dirichlet boundary conditions. More...
 
struct  BoundSpace
 
class  BreitWignerRng
 
class  Cell
 
struct  CellDivisionEvent
 Contains the parameters to perform a cell division. More...
 
class  Chemotaxis
 Move cells along the diffusion gradient (from low concentration to high) More...
 
class  CommandLineOptions
 Class to contain and parse command line options. More...
 
class  ConstantBoundaryCondition
 This class implements constant boundary conditions (Dirichlet and Neumann). The value of the boundary condition is constant and independent of the position and time, i.e. u = const or du/dn = const on the boundary. More...
 
class  Continuum
 Continuum class to interface with BioDynaMo for hybrid simulations. More...
 
class  ContinuumOp
 A class that sets up diffusion grids of the substances in this simulation. More...
 
struct  CreateVtkDataArray
 
class  CSVReader
 Reads in a CSV file using rapidcsv. More...
 
class  DiffusionGrid
 
struct  DiscretizationOp
 
class  DistributionRng
 Random number generator that generates samples from a distribution. More...
 
struct  DividingCellOp
 
class  Environment
 
class  EulerDepletionGrid
 Continuum model for the 3D diffusion equation with exponential decay and substance depletion $ \partial_t u = \nabla D \nabla u - \mu u - \mu' v u $. More...
 
class  EulerGrid
 Continuum model for the 3D heat equation with exponential decay $ \partial_t u = \nabla D \nabla u - \mu u $. More...
 
class  ExecutionContext
 
class  Exporter
 
class  ExporterFactory
 
class  ExpRng
 
struct  Fea
 
struct  Fen
 
class  FixedSizeVector
 
struct  ForEachAgentParallelFunctor
 
class  Functor
 
class  GausRng
 
class  GaussianBand
 
class  GeneRegulation
 
struct  GetDataMemberForVis
 
struct  GetNumberOfComponents
 
struct  GetNumberOfComponents< MathArray< T, N > >
 
struct  GetNumberOfComponents< std::array< T, N > >
 
struct  GetVtkValueType
 
struct  GetVtkValueType< AgentPointer< T > >
 
struct  GetVtkValueType< AgentUid >
 
struct  GetVtkValueType< int >
 
struct  GetVtkValueType< MathArray< T, N > >
 
struct  GetVtkValueType< real_t >
 
struct  GetVtkValueType< uint64_t >
 
class  GpuHelper
 
class  GrowthDivision
 
class  InlineVector
 
class  InPlaceExecutionContext
 
class  IntegralTypeWrapper
 
class  InteractionForce
 
struct  is_agent_ptr
 
struct  is_agent_ptr< AgentPointer< T > >
 
struct  IsArray
 Checks whether T is std::array or bdm::MathArray. More...
 
struct  IsArray< MathArray< T, N > >
 
struct  IsArray< std::array< T, N > >
 
class  Iterator
 
class  JitForEachDataMemberFunctor
 
class  JitHeaders
 
class  KDTreeEnvironment
 
struct  LambdaFunctor
 
struct  LambdaFunctor< TReturn(TLambda::*)(TArgs...) const >
 
struct  LambdaFunctor< TReturn(TLambda::*)(TArgs...)>
 
class  LandauRng
 
struct  LoadBalanceFunctor
 
class  LoadBalanceInfo
 
struct  LoadBalancingOp
 
class  Log
 Wrapper class over ROOT logging module. More...
 
struct  LogRangeParam
 A uniform range of logarithmically scaled values (e.g. 1, 10, 100, 1000) More...
 
class  MappedDataArray
 
struct  MappedDataArrayInterface
 
struct  Math
 
class  MathArray
 
class  MatlabExporter
 
class  MechanicalForcesOp
 Defines the 3D physical interactions between physical objects. More...
 
struct  MechanicalForcesOpCuda
 Defines the 3D physical interactions between physical objects. More...
 
class  MechanicalForcesOpCudaKernel
 
struct  MechanicalForcesOpOpenCL
 Defines the 3D physical interactions between physical objects. More...
 
class  MemoryManager
 
struct  ModelInitializer
 
class  MortonIterator
 
class  MortonOrder
 
struct  NanoFlannAdapter
 
class  NeuroMLExporter
 
struct  NewAgentEvent
 
class  NewAgentEventUidGenerator
 
class  OctreeEnvironment
 
class  OpenCLState
 
struct  Operation
 
struct  OperationImpl
 
class  OperationRegistry
 
class  OpTimer
 Decorator for Operations to measure runtime. More...
 
struct  OptimizationParam
 
struct  OptimizationParamType
 An interface for creating different types of optimization parameters. More...
 
class  ParallelResizeVector
 std::vector with parallel resize More...
 
struct  ParallelVtiWriter
 
struct  ParallelVtuWriter
 
struct  Param
 
struct  ParamGroup
 Interface for parameter groups. More...
 
class  ParamGroupUidGenerator
 This class generates unique ids for parameter groups. Thread safe. More...
 
class  ParaviewAdaptor
 The class that bridges the simulation code with ParaView. More...
 
class  ParaviewExporter
 
struct  ParticleSwarmParam
 
class  PoissonBand
 
class  PoissonDRng
 
class  PoissonRng
 
class  ProgressBar
 This class implements a progress bar that can be used to track the progress of a simulation. More...
 
struct  PropagateStaticnessAgentOp
 
struct  PropagateStaticnessOp
 
class  PvtiWriter
 
class  Random
 
class  RandomizedRm
 
struct  RangeParam
 
class  ReductionOp
 
class  ResourceManager
 
class  RootAdaptor
 The class that bridges the simulation code with ROOT Visualization. More...
 
struct  RunAllScheduledOps
 
class  RuntimeVariables
 
class  ScalarField
 Interface for scalar fields. See Continuum for more information. More...
 
class  Scheduler
 
class  Secretion
 Secrete substance at Agent position. More...
 
struct  SetParam
 
struct  SetUpIterationOp
 
class  SharedData
 The SharedData class avoids false sharing between threads. More...
 
class  Simulation
 
class  SimulationBackup
 
class  SphericalAgent
 
class  Spinlock
 
class  Stack
 
struct  StandaloneOperationImpl
 Interface for implementing an operation that should run on a GPU. More...
 
class  StatelessBehavior
 Simplifies the creation of behaviors without attributes. Let's assume that we want to create a behavior that divides a cell agent in each iteration. The following code example uses the StatelessBehavior: More...
 
struct  SumReduction
 
struct  TearDownIterationOp
 
class  TFileRaii
 Automatically close a TFile object using RAII pattern. More...
 
class  ThreadInfo
 This class stores information about each thread. (e.g. to which NUMA node it belongs to.) NB: Threads must be bound to CPUs using OMP_PROC_BIND=true. More...
 
class  Timing
 
class  TimingAggregator
 
struct  type_ternary_operator
 
struct  type_ternary_operator< false, T, U >
 
struct  type_ternary_operator< true, T, U >
 
class  TypeIndex
 
struct  Ubrng
 
class  Uniform
 
class  UniformGridEnvironment
 A class that represents Cartesian 3D grid. More...
 
class  UniformRng
 
class  UnorderedFlatmap
 
struct  UpdateCPUResults
 
struct  UpdateEnvironmentOp
 
struct  UpdateStaticnessOp
 
struct  UpdateTimeSeriesOp
 
struct  UserDefinedDist
 
class  UserDefinedDistRng1D
 
class  UserDefinedDistRng2D
 
class  UserDefinedDistRng3D
 
class  VectorField
 Interface for vector fields. See Continuum for more information. More...
 
class  VectorTypeWrapper
 
class  VisualizationAdaptor
 
class  VisualizationOp
 
class  VtiWriter
 
class  VtkAgents
 
class  VtkDiffusionGrid
 
class  VTuneOpWrapper
 
class  VTuneTask
 

Typedefs

using NewAgentEventUid = uint64_t
 
using Real3 = MathArray< real_t, 3 >
 Aliases for a size 3 MathArray. More...
 
using Float3 = MathArray< float, 3 >
 
using Double3 = MathArray< double, 3 >
 
using Real4 = MathArray< real_t, 4 >
 Aliases for a size 4 MathArray. More...
 
using Float4 = MathArray< float, 4 >
 
using Double4 = MathArray< double, 4 >
 
typedef KDTreeSingleIndexAdaptor< L2_Simple_Adaptor< real_t, NanoFlannAdapter >, NanoFlannAdapter, 3, uint64_t > bdm_kd_tree_t
 
using NeighborMutex = Environment::NeighborMutexBuilder::NeighborMutex
 
using GridNeighborMutexBuilder = UniformGridEnvironment::GridNeighborMutexBuilder
 
using ParamGroupUid = uint64_t
 
using real_t = double
 
template<typename T >
using raw_type = std::remove_pointer_t< std::decay_t< T > >
 Type trait that converts T*, T&, T&&, T*& to T More...
 
using vtkRealArray = typename type_ternary_operator< std::is_same< real_t, double >::value, vtkDoubleArray, vtkFloatArray >::type
 

Enumerations

enum  AgentPointerMode { kIndirect, kDirect }
 
enum  BoundaryConditionType {
  BoundaryConditionType::kDirichlet, BoundaryConditionType::kNeumann, BoundaryConditionType::kOpenBoundaries, BoundaryConditionType::kClosedBoundaries,
  BoundaryConditionType::kPeriodic
}
 Available boundary conditions. More...
 
enum  InteractionMode { InteractionMode::kAdditive = 0, InteractionMode::kExponential = 1, InteractionMode::kLogistic = 2 }
 
enum  ExporterType { kBasic, kMatlab, kNeuroML, kParaview }
 
enum  OpComputeTarget { kCpu, kCuda, kOpenCl }
 
enum  OpType { kSchedule, kPreSchedule, kPostSchedule }
 
enum  Shape { kSphere, kCylinder }
 
enum  Axis { kXAxis, kYAxis, kZAxis }
 

Functions

template<typename T >
void InPlaceParallelPrefixSum (T &v, uint64_t n)
 
template<typename T >
void ExclusivePrefixSum (T *v, uint64_t n)
 
template<typename TSearch , typename TContainer >
uint64_t BinarySearch (const TSearch &search_val, const TContainer &container, uint64_t from, uint64_t to)
 
template<class T , std::size_t N>
std::ostream & operator<< (std::ostream &o, const MathArray< T, N > &arr)
 
template<class T , std::size_t N>
MathArray< T, N > operator* (T const &scalar, MathArray< T, N > array)
 Template function to multiply array with scalar from the left. More...
 
std::string BoundaryTypeToString (const BoundaryConditionType &type)
 Transforms a BoundaryConditionType to the corresponding string. More...
 
BoundaryConditionType StringToBoundaryType (const std::string &type)
 Transforms a string to the corresponding BoundaryConditionType. More...
 
template<typename T >
std::pair< uint64_t, uint64_t > BinarySearch (uint64_t search_val, const T &container, uint64_t from, uint64_t to)
 
template<typename TLambda >
LambdaFunctor< decltype(&TLambda::operator())> L2F (const TLambda &l)
 
template<typename T >
void CudaAllocPinned (T **d, uint64_t elements)
 
void CudaFreePinned (void *p)
 
void ApplyBoundingBox (Agent *agent, Param::BoundSpaceMode mode, real_t lb, real_t rb)
 
 BDM_REGISTER_OP (BoundSpace, "bound space", kCpu)
 
 BDM_REGISTER_OP (ContinuumOp, "continuum", kCpu)
 
 BDM_REGISTER_OP_WITH_FREQ (LoadBalancingOp, "load balancing", kCpu, std::numeric_limits< uint32_t >::max())
 
 BDM_REGISTER_OP (MechanicalForcesOp, "mechanical forces", kCpu)
 
 BDM_REGISTER_OP (DividingCellOp, "DividingCellOp", kCpu)
 
 BDM_REGISTER_OP (UpdateStaticnessOp, "update staticness", kCpu)
 
 BDM_REGISTER_OP (PropagateStaticnessAgentOp, "propagate staticness agentop", kCpu)
 
 BDM_REGISTER_OP (BehaviorOp, "behavior", kCpu)
 
 BDM_REGISTER_OP (DiscretizationOp, "discretization", kCpu)
 
 BDM_REGISTER_OP (SetUpIterationOp, "set up iteration", kCpu)
 
 BDM_REGISTER_OP (TearDownIterationOp, "tear down iteration", kCpu)
 
 BDM_REGISTER_OP (UpdateTimeSeriesOp, "update time series", kCpu)
 
 BDM_REGISTER_OP (UpdateEnvironmentOp, "update environment", kCpu)
 
 BDM_REGISTER_OP (VisualizationOp, "visualize", kCpu)
 
 BDM_REGISTER_OP (PropagateStaticnessOp, "propagate staticness", kCpu)
 
void IsNonSphericalObjectPresent (const Agent *agent, bool *answer)
 
std::string OpComputeTargetString (OpComputeTarget t)
 
OperationNewOperation (const std::string &name)
 A convenient function to get a new operation from the registry by its name. More...
 
 BDM_REGISTER_TEMPLATE_OP (ReductionOp, int, "ReductionOpInt", kCpu)
 
 BDM_REGISTER_TEMPLATE_OP (ReductionOp, real_t, "ReductionOpDouble", kCpu)
 
 BDM_REGISTER_TEMPLATE_OP (ReductionOp, Real3, "ReductionOpReal3", kCpu)
 
 BDM_REGISTER_TEMPLATE_OP (ReductionOp, Real4, "ReductionOpReal4", kCpu)
 
std::ostream & operator<< (std::ostream &os, const CommandLineOptions &clo)
 
json FlattenGroups (const json &j_document)
 
json UnflattenGroups (const json &j_flattened, const json &j_original)
 
void AssignThreadSafetyMechanism (const std::shared_ptr< cpptoml::table > &config, Param *param)
 
void AssignMappedDataArrayMode (const std::shared_ptr< cpptoml::table > &config, Param *param)
 
void AssignBoundSpaceMode (const std::shared_ptr< cpptoml::table > &config, Param *param)
 
std::ostream & operator<< (std::ostream &os, const ResourceManager &rm)
 
std::ostream & operator<< (std::ostream &os, Simulation &sim)
 
uint64_t RemoveDirectoryContents (const std::string &directory)
 
bool FileExists (const std::string &file_name)
 
void WriteToFile (const std::string &filename, const std::string &content)
 
template<typename T >
bool GetPersistentObject (const char *root_file, const char *obj_name, T *&empty_obj)
 Gets the persistent object from the specified ROOT file. More...
 
template<typename T >
void WritePersistentObject (const char *root_file, const char *obj_name, const T &pst_object, const char *mode="new")
 Writes a persistent object to the specified ROOT file. More...
 
std::vector< TClass * > FindClassSlow (const std::string &class_name)
 
std::vector< TDataMember * > FindDataMemberSlow (TClass *tclass, const std::string &data_member)
 
void Partition (uint64_t elements, uint64_t batches, uint64_t batch_num, uint64_t *start, uint64_t *end)
 
void PlotMemoryLayout (const std::vector< Agent * > &agents, int numa_node)
 
void PlotMemoryHistogram (const std::vector< Agent * > &agents, int numa_node)
 
void PlotNeighborMemoryHistogram (bool before)
 
std::string GetExecutablePath ()
 This function returns the path of the currently running executable. More...
 
std::string GetExecutableDirectory ()
 
std::string GetExecutableName ()
 
real_t TimeConversionFactor (const std::string &unit)
 
void PrintDataMemberInfo (const std::string &class_name)
 Writes information of each data member of a class to cout. More...
 
std::vector< std::string > Split (const std::string &s, const std::string &delimiter)
 
bool EndsWith (const std::string &str, const std::string &suffix)
 
bool StartsWith (const std::string &str, const std::string &prefix)
 
template<typename... Args>
std::string Concat (const Args &... parts)
 Concatenates all arguments into a string. Equivalent to streaming all arguments into a stringstream and calling stream.str() More...
 
std::ostream & operator<< (std::ostream &os, const TimingAggregator &ta)
 
template<typename TTuple , typename TFunction >
void Apply (TTuple *t, size_t index, TFunction &&f)
 
template<typename T , typename... Types>
constexpr int GetIndex ()
 
template<typename TTo , typename TFrom >
TTo bdm_static_cast (TFrom from)
 
std::string GenerateSimulationInfoJson (const std::unordered_map< std::string, VtkAgents * > &vtk_agents, const std::unordered_map< std::string, VtkDiffusionGrid * > &vtk_dgrids)
 
 vtkStandardNewMacro (VtiWriter)
 
void FixPvtu (const std::string &filename, const std::string &file_prefix, uint64_t pieces)
 
void VisualizeInNotebook (size_t w=300, size_t h=300, std::string opt="")
 Visualize the agents in ROOT notebooks. More...
 

Variables

AgentPointerMode gAgentPointerMode = AgentPointerMode::kIndirect
 
constexpr const char * kRealtName = "double"
 

Typedef Documentation

◆ bdm_kd_tree_t

typedef KDTreeSingleIndexAdaptor<L2_Simple_Adaptor<real_t, NanoFlannAdapter>, NanoFlannAdapter, 3, uint64_t> bdm::bdm_kd_tree_t

Definition at line 29 of file kd_tree_environment.cc.

◆ Double3

using bdm::Double3 = typedef MathArray<double, 3>

Definition at line 436 of file math_array.h.

◆ Double4

using bdm::Double4 = typedef MathArray<double, 4>

Definition at line 441 of file math_array.h.

◆ Float3

using bdm::Float3 = typedef MathArray<float, 3>

Definition at line 435 of file math_array.h.

◆ Float4

using bdm::Float4 = typedef MathArray<float, 4>

Definition at line 440 of file math_array.h.

◆ GridNeighborMutexBuilder

Definition at line 293 of file uniform_grid_environment.cc.

◆ NeighborMutex

Definition at line 291 of file uniform_grid_environment.cc.

◆ NewAgentEventUid

using bdm::NewAgentEventUid = typedef uint64_t

NewAgentEventUid is used inside behaviors to determine if a behavior should be copied if a new agent is created. Possible events are cell division, neurite branching, ...
NewAgentEventUid invariant: the number of bits set to 1 must be 1.

Definition at line 29 of file new_agent_event.h.

◆ ParamGroupUid

using bdm::ParamGroupUid = typedef uint64_t

Definition at line 26 of file param_group.h.

◆ raw_type

template<typename T >
using bdm::raw_type = typedef std::remove_pointer_t<std::decay_t<T> >

Type trait that converts T*, T&, T&&, T*& to T

Definition at line 44 of file type.h.

◆ Real3

using bdm::Real3 = typedef MathArray<real_t, 3>

Aliases for a size 3 MathArray.

Definition at line 434 of file math_array.h.

◆ Real4

using bdm::Real4 = typedef MathArray<real_t, 4>

Aliases for a size 4 MathArray.

Definition at line 439 of file math_array.h.

◆ real_t

using bdm::real_t = typedef double

Definition at line 21 of file real_t.h.

◆ vtkRealArray

using bdm::vtkRealArray = typedef typename type_ternary_operator<std::is_same<real_t, double>::value, vtkDoubleArray, vtkFloatArray>::type

Definition at line 36 of file vtk_diffusion_grid.cc.

Enumeration Type Documentation

◆ AgentPointerMode

Class AgentPointer supports two different modes: First, an indirect mode in which the AgentUid is used to determine an agent.
Second, a direct mode in which the raw Agent* is used. The indirect mode is necessary if the Agent* changes during the simulation. This can happen due to sorting and balancing operation to improve the memory layout, or in a distributed runtime, where an agent might reside in a different address space. If the Agent* of an agent does not change during a simulation, the direct mode can be used to achieve better performance.

Enumerator
kIndirect 
kDirect 

Definition at line 42 of file agent_pointer.h.

◆ Axis

enum bdm::Axis
Enumerator
kXAxis 
kYAxis 
kZAxis 

Definition at line 33 of file substance_initializers.h.

◆ BoundaryConditionType

Available boundary conditions.

Enumerator
kDirichlet 
kNeumann 
kOpenBoundaries 
kClosedBoundaries 
kPeriodic 

Definition at line 35 of file diffusion_grid.h.

◆ ExporterType

Enumerator
kBasic 
kMatlab 
kNeuroML 
kParaview 

Definition at line 69 of file exporter.h.

◆ InteractionMode

enum bdm::InteractionMode
strong
Enumerator
kAdditive 
kExponential 
kLogistic 

Definition at line 43 of file diffusion_grid.h.

◆ OpComputeTarget

Enumerator
kCpu 
kCuda 
kOpenCl 

Definition at line 31 of file operation.h.

◆ OpType

Enumerator
kSchedule 
kPreSchedule 
kPostSchedule 

Definition at line 43 of file scheduler.h.

◆ Shape

enum bdm::Shape
Enumerator
kSphere 
kCylinder 

Definition at line 20 of file shape.h.

Function Documentation

◆ Apply()

template<typename TTuple , typename TFunction >
void bdm::Apply ( TTuple *  t,
size_t  index,
TFunction &&  f 
)

This function applies the given function on tuple element index. The peculiarity is that index is a runtime parameter. std::get<N>(tuple) however, requires a compile time constant. Therefore, Apply performs the translation to a compile time index.

Parameters
tstd::tuple or similar type that supports std::get<N>
indexruntime index specifying the type within t
ffunction that should be executed on the type

Definition at line 88 of file tuple.h.

◆ ApplyBoundingBox()

void bdm::ApplyBoundingBox ( Agent agent,
Param::BoundSpaceMode  mode,
real_t  lb,
real_t  rb 
)
inline

Definition at line 26 of file bound_space_op.h.

◆ AssignBoundSpaceMode()

void bdm::AssignBoundSpaceMode ( const std::shared_ptr< cpptoml::table > &  config,
Param param 
)

Definition at line 196 of file param.cc.

◆ AssignMappedDataArrayMode()

void bdm::AssignMappedDataArrayMode ( const std::shared_ptr< cpptoml::table > &  config,
Param param 
)

Definition at line 170 of file param.cc.

◆ AssignThreadSafetyMechanism()

void bdm::AssignThreadSafetyMechanism ( const std::shared_ptr< cpptoml::table > &  config,
Param param 
)

Definition at line 149 of file param.cc.

◆ BDM_REGISTER_OP() [1/14]

bdm::BDM_REGISTER_OP ( BehaviorOp  ,
"behavior"  ,
kCpu   
)

◆ BDM_REGISTER_OP() [2/14]

bdm::BDM_REGISTER_OP ( BoundSpace  ,
"bound space"  ,
kCpu   
)

◆ BDM_REGISTER_OP() [3/14]

bdm::BDM_REGISTER_OP ( ContinuumOp  ,
"continuum"  ,
kCpu   
)

◆ BDM_REGISTER_OP() [4/14]

bdm::BDM_REGISTER_OP ( DiscretizationOp  ,
"discretization"  ,
kCpu   
)

◆ BDM_REGISTER_OP() [5/14]

bdm::BDM_REGISTER_OP ( DividingCellOp  ,
"DividingCellOp"  ,
kCpu   
)

◆ BDM_REGISTER_OP() [6/14]

bdm::BDM_REGISTER_OP ( MechanicalForcesOp  ,
"mechanical forces"  ,
kCpu   
)

◆ BDM_REGISTER_OP() [7/14]

bdm::BDM_REGISTER_OP ( PropagateStaticnessAgentOp  ,
"propagate staticness agentop"  ,
kCpu   
)

◆ BDM_REGISTER_OP() [8/14]

bdm::BDM_REGISTER_OP ( PropagateStaticnessOp  ,
"propagate staticness"  ,
kCpu   
)

◆ BDM_REGISTER_OP() [9/14]

bdm::BDM_REGISTER_OP ( SetUpIterationOp  ,
"set up iteration"  ,
kCpu   
)

◆ BDM_REGISTER_OP() [10/14]

bdm::BDM_REGISTER_OP ( TearDownIterationOp  ,
"tear down iteration"  ,
kCpu   
)

◆ BDM_REGISTER_OP() [11/14]

bdm::BDM_REGISTER_OP ( UpdateEnvironmentOp  ,
"update environment"  ,
kCpu   
)

◆ BDM_REGISTER_OP() [12/14]

bdm::BDM_REGISTER_OP ( UpdateStaticnessOp  ,
"update staticness"  ,
kCpu   
)

◆ BDM_REGISTER_OP() [13/14]

bdm::BDM_REGISTER_OP ( UpdateTimeSeriesOp  ,
"update time series"  ,
kCpu   
)

◆ BDM_REGISTER_OP() [14/14]

bdm::BDM_REGISTER_OP ( VisualizationOp  ,
"visualize"  ,
kCpu   
)

◆ BDM_REGISTER_OP_WITH_FREQ()

bdm::BDM_REGISTER_OP_WITH_FREQ ( LoadBalancingOp  ,
"load balancing"  ,
kCpu  ,
std::numeric_limits< uint32_t >  ::max() 
)

◆ BDM_REGISTER_TEMPLATE_OP() [1/4]

bdm::BDM_REGISTER_TEMPLATE_OP ( ReductionOp  ,
int  ,
"ReductionOpInt"  ,
kCpu   
)

◆ BDM_REGISTER_TEMPLATE_OP() [2/4]

bdm::BDM_REGISTER_TEMPLATE_OP ( ReductionOp  ,
Real3  ,
"ReductionOpReal3"  ,
kCpu   
)

◆ BDM_REGISTER_TEMPLATE_OP() [3/4]

bdm::BDM_REGISTER_TEMPLATE_OP ( ReductionOp  ,
Real4  ,
"ReductionOpReal4"  ,
kCpu   
)

◆ BDM_REGISTER_TEMPLATE_OP() [4/4]

bdm::BDM_REGISTER_TEMPLATE_OP ( ReductionOp  ,
real_t  ,
"ReductionOpDouble"  ,
kCpu   
)

◆ bdm_static_cast()

template<typename TTo , typename TFrom >
TTo bdm::bdm_static_cast ( TFrom  from)

Use this cast if you want to downcast an object to a known type with extra safety. The extra safety check will only be performed in Debug mode.

Definition at line 60 of file type.h.

◆ BinarySearch() [1/2]

template<typename TSearch , typename TContainer >
uint64_t bdm::BinarySearch ( const TSearch &  search_val,
const TContainer &  container,
uint64_t  from,
uint64_t  to 
)

Definition at line 76 of file algorithm.h.

◆ BinarySearch() [2/2]

template<typename T >
std::pair<uint64_t, uint64_t> bdm::BinarySearch ( uint64_t  search_val,
const T &  container,
uint64_t  from,
uint64_t  to 
)

Definition at line 130 of file morton_order.cc.

◆ BoundaryTypeToString()

std::string bdm::BoundaryTypeToString ( const BoundaryConditionType type)

Transforms a BoundaryConditionType to the corresponding string.

Definition at line 26 of file diffusion_grid.cc.

◆ Concat()

template<typename... Args>
std::string bdm::Concat ( const Args &...  parts)
inline

Concatenates all arguments into a string. Equivalent to streaming all arguments into a stringstream and calling stream.str()

Parameters
[in]partsobjects that compose the entire message
Returns
A unique string pointer to the message

Definition at line 70 of file string.h.

◆ CudaAllocPinned()

template<typename T >
void bdm::CudaAllocPinned ( T **  d,
uint64_t  elements 
)
inline

Definition at line 33 of file cuda_pinned_memory.h.

◆ CudaFreePinned()

void bdm::CudaFreePinned ( void *  p)
inline

Definition at line 35 of file cuda_pinned_memory.h.

◆ EndsWith()

bool bdm::EndsWith ( const std::string &  str,
const std::string &  suffix 
)
inline

Definition at line 25 of file string.h.

◆ ExclusivePrefixSum()

template<typename T >
void bdm::ExclusivePrefixSum ( T *  v,
uint64_t  n 
)

Calculate exclusive prefix sum in-place. n must be <= t->size() - 1 This means that there must be an additional element in the vector at v[n+1]

Definition at line 61 of file algorithm.h.

◆ FileExists()

bool bdm::FileExists ( const std::string &  file_name)

Definition at line 78 of file io.cc.

◆ FindClassSlow()

std::vector< TClass * > bdm::FindClassSlow ( const std::string &  class_name)

Iterates over all entries in TClassTable and returns a vector of candidate TClass* that match the given class name.

Parameters
class_namedoes not have to be fully qualified (e.g. Cell instead of bdm::Cell).
However, Cell will also match e.g "bdm::foo::Cell"
Returns
multiple values if class_name is ambiguous and multiple classes were found in different namespaces

Definition at line 31 of file jit.cc.

◆ FindDataMemberSlow()

std::vector< TDataMember * > bdm::FindDataMemberSlow ( TClass *  tclass,
const std::string &  data_member 
)

Iterates over all data members of tclass and its base classes and returns TClass* that match the given class name.

Parameters
tclassTClass for which the data members should be determined
data_membername of the data_member (e.g. position_ or bdm::Cell::position_).
Returns
multiple values if data_member name is ambiguous and multiple instances were found in tclass and its base classes

Definition at line 60 of file jit.cc.

◆ FixPvtu()

void bdm::FixPvtu ( const std::string &  filename,
const std::string &  file_prefix,
uint64_t  pieces 
)

Definition at line 31 of file parallel_vtu_writer.cc.

◆ FlattenGroups()

json bdm::FlattenGroups ( const json &  j_document)

Definition at line 73 of file param.cc.

◆ GenerateSimulationInfoJson()

std::string bdm::GenerateSimulationInfoJson ( const std::unordered_map< std::string, VtkAgents * > &  vtk_agents,
const std::unordered_map< std::string, VtkDiffusionGrid * > &  vtk_dgrids 
)

If the user selects the visualiation option export, we need to pass the information on the C++ side to a python script which generates the ParaView state file. The Json file is generated inside this function

See also
GenerateParaviewState

Definition at line 24 of file helper.cc.

◆ GetExecutableDirectory()

std::string bdm::GetExecutableDirectory ( )

Definition at line 62 of file proc.cc.

◆ GetExecutableName()

std::string bdm::GetExecutableName ( )

Definition at line 67 of file proc.cc.

◆ GetExecutablePath()

std::string bdm::GetExecutablePath ( )

This function returns the path of the currently running executable.

Definition at line 45 of file proc.cc.

◆ GetIndex()

template<typename T , typename... Types>
constexpr int bdm::GetIndex ( )
inlineconstexpr

Return the index of the first occurrence of type T within the variadic template parameter Types.

Definition at line 96 of file tuple.h.

◆ GetPersistentObject()

template<typename T >
bool bdm::GetPersistentObject ( const char *  root_file,
const char *  obj_name,
T *&  empty_obj 
)

Gets the persistent object from the specified ROOT file.

Parameters
[in]root_fileThe root file
[in]obj_nameThe object name
empty_objThe empty object
Template Parameters
T{ The object class type }
Returns
The persistent object.

Definition at line 101 of file io.h.

◆ InPlaceParallelPrefixSum()

template<typename T >
void bdm::InPlaceParallelPrefixSum ( T &  v,
uint64_t  n 
)

Calculate work-efficient inclusive prefix sum. Calculation is parallel and in-place.

Definition at line 27 of file algorithm.h.

◆ IsNonSphericalObjectPresent()

void bdm::IsNonSphericalObjectPresent ( const Agent agent,
bool *  answer 
)

Definition at line 36 of file mechanical_forces_op_cuda.cc.

◆ L2F()

template<typename TLambda >
LambdaFunctor<decltype(&TLambda::operator())> bdm::L2F ( const TLambda &  l)

Wraps a lambda inside a LambdaFunctor with the same signature as the lambda. Assume the following example using L2F

void PrintSmallNeighbors(Agent* agent, real_t threshold) {
  auto functor = L2F([&](Agent* neighbor, real_t squared_distance)) {
     if (neighbor->GetDiameter() < threshold) {
       std::cout << neighbor->GetUid() << std::endl;
     }
  });
  auto* ctxt = Simulation::GetActive()->GetExecutionContext();
  ctxt->ForEachNeighbor(functor, *agent);
}

The base class of functor in the example above is Functor<void, Agent*, real_t>
The wrapped lambda is allowed to capture variables.
Without bdm::LambdaFunctor and bdm::L2F the following code is needed to achieve the same result as above. Notice the extra class MyFunctor that has to be defined outside PrintSmallNeighbors.

class MyFunctor : public Functor<void, Agent*, real_t> {
 public:
  MyFunctor(real_t threshold) : threshold_(threshold) {}
  virtual ~MyFunctor() = default;
  void operator()(Agent* neighbor, real_t squared_distance) override {
    if (neighbor->GetDiameter() < threshold_) {
      std::cout << agent->GetUid() << std::endl;
    }
  }
 private:
  real_t threshold_;
};

void PrintSmallNeighbors(Agent* agent, real_t threshold) {
  MyFunctor functor(threshold);
  auto* ctxt = Simulation::GetActive()->GetExecutionContext();
  ctxt->ForEachNeighbor(functor, *agent);
}

Definition at line 110 of file functor.h.

◆ NewOperation()

Operation* bdm::NewOperation ( const std::string &  name)
inline

A convenient function to get a new operation from the registry by its name.

Definition at line 85 of file operation_registry.h.

◆ OpComputeTargetString()

std::string bdm::OpComputeTargetString ( OpComputeTarget  t)
inline

Definition at line 33 of file operation.h.

◆ operator*()

template<class T , std::size_t N>
MathArray<T, N> bdm::operator* ( T const &  scalar,
MathArray< T, N >  array 
)

Template function to multiply array with scalar from the left.

Definition at line 429 of file math_array.h.

◆ operator<<() [1/5]

template<class T , std::size_t N>
std::ostream& bdm::operator<< ( std::ostream &  o,
const MathArray< T, N > &  arr 
)

Definition at line 412 of file math_array.h.

◆ operator<<() [2/5]

std::ostream& bdm::operator<< ( std::ostream &  os,
const CommandLineOptions clo 
)

Definition at line 212 of file command_line_options.cc.

◆ operator<<() [3/5]

std::ostream& bdm::operator<< ( std::ostream &  os,
const ResourceManager rm 
)
inline

Definition at line 529 of file resource_manager.h.

◆ operator<<() [4/5]

std::ostream& bdm::operator<< ( std::ostream &  os,
const TimingAggregator ta 
)
inline

Definition at line 62 of file timing_aggregator.h.

◆ operator<<() [5/5]

std::ostream& bdm::operator<< ( std::ostream &  os,
Simulation sim 
)

Definition at line 138 of file simulation.cc.

◆ Partition()

void bdm::Partition ( uint64_t  elements,
uint64_t  batches,
uint64_t  batch_num,
uint64_t *  start,
uint64_t *  end 
)
inline

Definition at line 22 of file partition.h.

◆ PlotMemoryHistogram()

void bdm::PlotMemoryHistogram ( const std::vector< Agent * > &  agents,
int  numa_node 
)

Definition at line 74 of file plot_memory_layout.cc.

◆ PlotMemoryLayout()

void bdm::PlotMemoryLayout ( const std::vector< Agent * > &  agents,
int  numa_node 
)

Definition at line 42 of file plot_memory_layout.cc.

◆ PlotNeighborMemoryHistogram()

void bdm::PlotNeighborMemoryHistogram ( bool  before)

Definition at line 137 of file plot_memory_layout.cc.

◆ PrintDataMemberInfo()

void bdm::PrintDataMemberInfo ( const std::string &  class_name)

Writes information of each data member of a class to cout.

Definition at line 25 of file root.cc.

◆ RemoveDirectoryContents()

uint64_t bdm::RemoveDirectoryContents ( const std::string &  directory)

Removes all contents inside the directory and returns the number of deleted files and directories that were deleted.

Definition at line 21 of file filesystem.cc.

◆ Split()

std::vector< std::string > bdm::Split ( const std::string &  s,
const std::string &  delimiter 
)

Definition at line 21 of file string.cc.

◆ StartsWith()

bool bdm::StartsWith ( const std::string &  str,
const std::string &  prefix 
)
inline

Definition at line 30 of file string.h.

◆ StringToBoundaryType()

BoundaryConditionType bdm::StringToBoundaryType ( const std::string &  type)

Transforms a string to the corresponding BoundaryConditionType.

Definition at line 44 of file diffusion_grid.cc.

◆ TimeConversionFactor()

real_t bdm::TimeConversionFactor ( const std::string &  unit)
inline

Definition at line 24 of file progress_bar.cc.

◆ UnflattenGroups()

json bdm::UnflattenGroups ( const json &  j_flattened,
const json &  j_original 
)

Definition at line 89 of file param.cc.

◆ VisualizeInNotebook()

void bdm::VisualizeInNotebook ( size_t  w = 300,
size_t  h = 300,
std::string  opt = "" 
)
inline

Visualize the agents in ROOT notebooks.

Definition at line 26 of file notebook_util.h.

◆ vtkStandardNewMacro()

bdm::vtkStandardNewMacro ( VtiWriter  )

◆ WritePersistentObject()

template<typename T >
void bdm::WritePersistentObject ( const char *  root_file,
const char *  obj_name,
const T &  pst_object,
const char *  mode = "new" 
)

Writes a persistent object to the specified ROOT file.

Parameters
[in]root_fileThe root file
[in]obj_nameThe object name
pst_objectThe persistent object
[in]modeThe mode
Template Parameters
T{ The object class type }
Option Details
new (default) A new root file root_file is created. If file already exists, an error message is printed and the function returns.
recreate If file does not exist, it is created (like in "new"). If file already exist, the existing file is deleted before creating the new file.
update New classes are added to the existing directory. Existing classes with the same name are replaced by the new definition. If the directory dirname doest not exist, same effect as "new".

Definition at line 130 of file io.h.

◆ WriteToFile()

void bdm::WriteToFile ( const std::string &  filename,
const std::string &  content 
)

Definition at line 83 of file io.cc.

Variable Documentation

◆ gAgentPointerMode

AgentPointerMode bdm::gAgentPointerMode = AgentPointerMode::kIndirect

Global variable to select the agent pointer mode.
Replacing the global variable with an attribute in Param is too costly in terms of performance.

See also
AgentPointerMode

Definition at line 19 of file agent_pointer.cc.

◆ kRealtName

constexpr const char* bdm::kRealtName = "double"
constexpr

Definition at line 22 of file real_t.h.