Macro run_simulation
run_simulation!() { /* proc-macro */ }
Expand description
Performs a complete numerical simulation.
ⓘ
run_simulation!(
// Arguments
domain: $domain:ident,
agents: $agents:ident,
settings: $settings:ident,
aspects: [$($asp:ident),*],
// Optional Arguments
$(core_path: $path:path,)?
$(parallelizer: $parallelizer:ident,)?
$(determinism: $determinism:bool,)?
$(aux_storage_name: $aux_storage_name:ident,)?
$(zero_force_default: $zero_force_default:closure,)?
$(zero_force_reactions_default: $zero_force_reactions_default:closure,)?
$(communicator_name: $communicator_name:ident,)?
$(mechanics_solver_order: $mechanics_solver_order:NonZeroUsize,)?
$(reactions_intra_solver_order: $reactions_intra_solver_order:NonZeroUsize,)?
$(reactions_contact_solver_order: $reactions_contact_solver_order:NonZeroUsize,)?
) -> Result<StorageAccess<_, _>, SimulationError>;
§Arguments
Keyword | Description | Default |
---|---|---|
domain | An object implementing the Domain trait. | - |
agents | Iterable of cell-agents | - |
settings | See Settings | - |
aspects | List of simulation aspects such as [Mechanics, Interaction, ...] See below. | - |
core_path | Path that points to the core module of cellular_raza | cellular_raza::core |
parallelizer | Method to parallelize the simulation. Choose between OsThreads and Rayon . | OsThreads |
determinism | Enforces sorting of values received from step 2 | false |
aux_storage_name | Name of helper struct to store cellular information. | _CrAuxStorage |
zero_force_default | A closure returning the zero value of the force. | |c| {num::Zero::zero()} |
zero_force_reactions_default | A closure returning the zero value of the reactions type. | |c| {num::Zero::zero()} |
communicator_name | Name of the struct responsible for communication between threads. | _CrCommunicator |
mechanics_solver_order | Order of the mechanics solver from 0 to 2 | 2 |
reactions_intra_solver_order | Order of the intracellular reactions solver from 1 to 4 | 4 |
reactions_contact_solver_order | Order of the contact reactions solver from 0 to 2 | 2 |
The domain
,agents
and settings
arguments allow for
shorthand notation.
§Simulation Aspects
Aspect | Trait(s) |
---|---|
Mechanics | Mechanics,SubDomainMechanics |
Interaction | Interaction |
Cycle | Cycle |
Reactions | Reactions |
ReactionsExtra | ReactionsExtra, SubDomainReactions |
ReactionsContact | ReactionsContact |
DomainForce | SubDomainForce, SubDomainMechanics |
§Returns
Returns a StorageAccess to interoperate with calculted results.
§Comparison of Macro Keywords
This list shows which keyword can be provided in which macro.
Keyword | run_simulation | run_main | test_compatibility | prepare_types | build_aux_storage | build_communicator |
---|---|---|---|---|---|---|
domain | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
agents | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
settings | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
aspects | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
core_path | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
parallelizer | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
determinism | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
aux_storage_name | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ |
zero_force_default | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ |
zero_force_reactions_default | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ |
communicator_name | ✅ | ✅ | ❌ | ✅ | ❌ | ✅ |
mechanics_solver_order | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
reactions_intra_solver_order | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
reactions_contact_solver_order | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |