Code Structure

Code Structure

Structure

cellular_raza consists of multiple crates working in tandem. It was designed to have clear separations between conceptual choices and implementation details. This approach allows us to have a greater amount of modularity and flexibility than regular simulation tools.

graph BT
    examples -.-> concepts
    examples --> core
    examples --> building_blocks
    benchmarks --> core
    benchmarks --> building_blocks
    benchmarks -.-> concepts
    core --> concepts
    building_blocks --> concepts

These crates act on varying levels of abstraction to yield a fully working numerical simulation. Since cellular_raza functions on different levels of abstraction, we try to indicate this in the table below.

crate Abstraction Level Purpose
cellular_raza - Bundle together functionality of all other crates.
concepts High Collection of (mainly) traits which need to be implemented to yield a full simulation.
core Intermediate-High Contains numerical solvers, storage handlers and more to actually solve a given system.
building_blocks Intermediate Predefined components of cell-agents and domains which can be put together to obtain a full simulation.
examples Application Showcases and introductions to different simulation approaches.
benchmarks Application Performance testing of various configurations.
flowchart LR
    High --> Intermediate --> Application

Offspring Crates & Other Contributions

During the development of cellular_raza multiple subfunctionalities which were only developed for internal use have been refactored and published as individually standing crates.

Crate Description Usage
approx-derive Derive macros for AbsDiffEq and RelativeEq of the approx crate. Testing
circ_buffer A no_std statically allocated ring-buffer with optional serde support. Save increments for a multistep solver.
crate2bib Convert crates to bibligraphy entries. Writing texts/publishing in general.
short_default Use shorthand notation for creating structs with default values. See cr_bayesian_optim
spatial-decomposition Split apart 2D simulation domains such that they can be processed in parallel. Experimental usage in CartesianCuboid2D
uniquevec A Vec-like datastructure which only contains unique entries. It is no_std and makes no use of unsafe code. Specify multiple StorageOption in correct priority without duplicates.

Furthermore, contributions to the following projects have been made: pyo3 rust-numpy plotters servo typst

Development

Language Files Lines Blank Comment Code Complexity Bytes Uloc
Rust 113 33418 2872 5350 25196 1297 1161637 0
Python 14 2125 272 83 1770 181 67148 0
TOML 31 650 70 12 568 0 18069 0
Markdown 20 434 97 0 337 0 16893 0
License 1 339 58 0 281 0 18092 0
SVG 3 334 0 0 334 0 28964 0
YAML 18 227 40 7 180 0 4856 0
Cuda 2 186 34 26 126 11 5381 0
HTML 3 84 0 3 81 0 4866 0
Shell 5 63 13 3 47 4 1341 0
WebGPU Shading Language 1 39 3 8 28 5 1140 0
Plain Text 6 20 0 0 20 0 304 0
Total 217 37919 3459 5492 28968 1498 1328691 0
Estimated Cost to Develop (organic) $925,997
Estimated Schedule Effort (organic) 13.36 months
Estimated People Required (organic) 6.16