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.
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 116 34877 3020 5373 26484 1333 1213624 0
Python 17 2624 393 131 2100 222 86609 0
TOML 33 654 74 13 567 0 18213 0
Jupyter 2 544 0 0 544 0 50002 0
Markdown 22 445 99 0 346 0 19016 0
License 1 339 58 0 281 0 18092 0
SVG 3 334 0 0 334 0 28964 0
HTML 5 243 0 5 238 0 8939 0
YAML 12 167 28 7 132 0 3725 0
Cuda 2 157 30 23 104 10 4416 0
Plain Text 7 68 0 0 68 0 1104 0
Typst 1 67 9 0 58 0 1596 0
Shell 5 63 13 3 47 4 1337 0
WebGPU Shading Language 1 39 3 8 28 5 1140 0
Autoconf 1 2 0 0 2 0 58 0
Total 228 40623 3727 5563 31333 1574 1456835 0
Estimated Cost to Develop (organic) $1,005,535
Estimated Schedule Effort (organic) 13.78 months
Estimated People Required (organic) 6.48