|
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.
template<typename Function >
static void bdm::ModelInitializer::CreateAgentsOnSurface |
( |
real_t(*)(const real_t *, const real_t *) |
f, |
|
|
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 |
|
) |
| |
|
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);
- Parameters
-
[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.
template<typename Function >
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);
- Parameters
-
[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.
template<typename Function >
static void bdm::ModelInitializer::Grid3D |
( |
const std::array< size_t, 3 > & |
agents_per_dim, |
|
|
real_t |
space, |
|
|
Function |
agent_builder |
|
) |
| |
|
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); });
- Parameters
-
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.
template<typename Function >
static void bdm::ModelInitializer::Grid3D |
( |
size_t |
agents_per_dim, |
|
|
real_t |
space, |
|
|
Function |
agent_builder |
|
) |
| |
|
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); });
- Parameters
-
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.