BioDynaMo
v1.05.125-2619fe54
|
#include <model_initializer.h>
Static Public Member Functions | |
template<typename Function > | |
static void | Grid3D (size_t agents_per_dim, real_t space, Function agent_builder) |
template<typename Function > | |
static void | Grid3D (const std::array< size_t, 3 > &agents_per_dim, real_t space, Function agent_builder) |
template<typename Function > | |
static void | CreateAgents (const std::vector< Real3 > &positions, Function agent_builder) |
template<typename Function > | |
static void | CreateAgentsRandom (real_t min, real_t max, uint64_t num_agents, Function agent_builder, DistributionRng< real_t > *rng=nullptr) |
template<typename Function > | |
static void | CreateAgentsOnSurface (real_t(*f)(const real_t *, const real_t *), const FixedSizeVector< real_t, 10 > &fn_params, real_t xmin, real_t xmax, real_t deltax, real_t ymin, real_t ymax, real_t deltay, Function agent_builder) |
template<typename Function > | |
static void | CreateAgentsOnSurfaceRndm (real_t(*f)(const real_t *, const real_t *), const FixedSizeVector< real_t, 10 > &fn_params, real_t xmin, real_t xmax, real_t ymin, real_t ymax, uint64_t num_agents, Function agent_builder) |
template<typename Function > | |
static void | CreateAgentsOnSphereRndm (const Real3 ¢er, real_t radius, uint64_t num_agents, Function agent_builder) |
template<typename Function > | |
static void | CreateAgentsInSphereRndm (const Real3 ¢er, real_t radius, uint64_t num_agents, Function agent_builder) |
static void | DefineSubstance (int substance_id, const std::string &substance_name, real_t diffusion_coeff, real_t decay_constant, int resolution=10, const std::vector< real_t > &binding_coefficients={}, const std::vector< int > &binding_substances={}) |
template<typename F > | |
static void | InitializeSubstance (int substance_id, F function) |
static void | AddBoundaryConditions (int substance_id, BoundaryConditionType bc_type, std::unique_ptr< BoundaryCondition > bc) |
Definition at line 35 of file model_initializer.h.
|
inlinestatic |
Sets the boundary condition for the specified substance. Transfers the ownership of the boundary condition to the diffusion grid.
[in] | substance_id | The substance identifier |
[in] | bc_type | The boundary condition type |
[in] | bc | The boundary condition |
Definition at line 411 of file model_initializer.h.
|
inlinestatic |
Creates agents on the given positions and adds them to the ExecutionContext.
positions | positions of the agents to be |
agent_builder | function containing the logic to instantiate a new agent. Takes const Real3& as input parameter |
Definition at line 122 of file model_initializer.h.
|
inlinestatic |
Creates agents with random positions in a sphere and adds them to the ExecutionContext. Agents are distributed uniformly inside the sphere. Agent creation is parallelized. Algorithm: Knop, 1970, 10.1145/362349.362377 (doi).
[in] | center | Center of the sphere |
[in] | radius | Radius of the sphere |
[in] | num_agents | The number of agents |
[in] | agent_builder | function containing the logic to instantiate a new agent. Takes const Real3& as input parameter |
Definition at line 335 of file model_initializer.h.
|
inlinestatic |
Creates agents with random positions on a sphere and adds them to the ExecutionContext. The agents' positions are uniformly distributed across the surface. Agent creation is parallelized. Algorithm: Knop, 1970, 10.1145/362349.362377 (doi).
[in] | center | Center of the sphere |
[in] | radius | Radius of the sphere |
[in] | num_agents | The number of agents |
[in] | agent_builder | function containing the logic to instantiate a new agent. Takes const Real3& as input parameter |
Definition at line 305 of file model_initializer.h.
|
inlinestatic |
Creates agents on surface and adds them to the ExecutionContext. The x and y positions are defined by xmin, xmax, deltax and ymin, ymax, deltay. The z position is calculated using f
. Agent creation is parallelized.
auto construct = [](const Real3& position) { Cell* cell = new Cell(position); cell->SetDiameter(10); return cell; }; auto f = [](const real_t* x, const real_t* params) { // 10 * sin(x/20) + 10 * sin(y/20) return 10 * std::sin(x[0] / 20.) + 10 * std::sin(x[1] / 20.0); }; ModelInitializer::CreateAgentsOnSurface(f, {}, -100, 100, 10, -100, 100, 10, construct);
[in] | f | function that defines the surface |
[in] | fn_params | Parameters that will be passed to f as second argument. |
[in] | xmin | Minimum x coordinate on which a agent will be created. |
[in] | xmax | Maximum x coordinate on which a agent will be created. |
[in] | deltax | Space between two agents on the x-axis. |
[in] | ymin | Minimum y coordinate on which a agent will be created. |
[in] | ymax | Maximum y coordinate on which a agent will be created. |
[in] | deltay | Space between two agents on the y-axis. |
[in] | agent_builder | function containing the logic to instantiate a new agent. Takes const Real3& as input parameter |
Definition at line 214 of file model_initializer.h.
|
inlinestatic |
Creates agents on surface and adds them to the ExecutionContext. The x and y positions are determined by a uniform distribution [xmin, xmax[ and [ymin, ymax[. The z position is calculated using f
. Agent creation is parallelized.
auto construct = [](const Real3& position) { Cell* cell = new Cell(position); cell->SetDiameter(10); return cell; }; auto f = [](const real_t* x, const real_t* params) { // 10 * sin(x/20) + 10 * sin(y/20) return 10 * std::sin(x[0] / 20.) + 10 * std::sin(x[1] / 20.0); }; ModelInitializer::CreateAgentsOnSurfaceRndm(f, {}, -100, 100, -100, 100, construct);
[in] | f | function that defines the surface |
[in] | fn_params | Parameters that will be passed to f as second argument. |
[in] | xmin | Minimum x coordinate on which a agent will be created. |
[in] | xmax | Maximum x coordinate on which a agent will be created. |
[in] | ymin | Minimum y coordinate on which a agent will be created. |
[in] | ymax | Maximum y coordinate on which a agent will be created. |
[in] | agent_builder | function containing the logic to instantiate a new agent. Takes const Real3& as input parameter |
Definition at line 274 of file model_initializer.h.
|
inlinestatic |
Creates agents with random positions and adds them to the ExecutionContext. Agent creation is parallelized.
[in] | min | The minimum position value |
[in] | max | The maximum position value |
[in] | num_agents | The number agents |
[in] | agent_builder | function containing the logic to instantiate a new agent. Takes const Real3& as input parameter |
[in] | rng | Uses the given DistributionRng. if rng is a nullptr, this function uses a uniform distribution between [min, max[ |
Definition at line 151 of file model_initializer.h.
|
static |
Allows agents to secrete the specified substance. Diffusion throughout the simulation space is automatically taken care of by the DiffusionGrid class
[in] | substance_id | The substance identifier |
[in] | substance_name | The substance name |
[in] | diffusion_coeff | The diffusion coefficient |
[in] | decay_constant | The decay constant |
[in] | resolution | The resolution of the diffusion grid |
[in] | binding_coefficients | The binding coefficients of the depleting substances |
[in] | binding_substances | The depleting substances |
Definition at line 23 of file model_initializer.cc.
|
inlinestatic |
Creates a 3D grid of agents and adds them to the ExecutionContext. Type of the agent is determined by the return type of parameter agent_builder.
ModelInitializer::Grid3D({8,6,4}, 10, [](const Real3& pos){ return Cell(pos); });
agents_per_dim | number of agents on each axis. Number of generated agents = agents_per_dim[0] * agents_per_dim[1] * agents_per_dim[2] |
space | space between the positions - e.g space = 10: positions = {(0, 0, 0), (0, 0, 10), (0, 0, 20), ... } |
agent_builder | function containing the logic to instantiate a new agent. Takes const Real3& as input parameter |
Definition at line 92 of file model_initializer.h.
|
inlinestatic |
Creates a 3D cubic grid of agents and adds them to the ExecutionContext. Type of the agent is determined by the return type of parameter agent_builder.
ModelInitializer::Grid3D(8, 10, [](const Real3& pos){ return Cell(pos); });
agents_per_dim | number of agents on each axis. Number of generated agents = agents_per_dim ^ 3 |
space | space between the positions - e.g space = 10: positions = {(0, 0, 0), (0, 0, 10), (0, 0, 20), ... } |
agent_builder | function containing the logic to instantiate a new agent. Takes const Real3& as input parameter |
Definition at line 53 of file model_initializer.h.
|
inlinestatic |
Definition at line 399 of file model_initializer.h.