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 --> conceptsThese 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 --> ApplicationOffspring 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 | 115 | 33936 | 2931 | 5263 | 25742 | 1318 | 1178463 | 0 |
| Python | 17 | 2707 | 403 | 132 | 2172 | 222 | 87815 | 0 |
| TOML | 32 | 669 | 75 | 12 | 582 | 0 | 18548 | 0 |
| Jupyter | 2 | 544 | 0 | 0 | 544 | 0 | 50002 | 0 |
| Markdown | 22 | 453 | 101 | 0 | 352 | 0 | 21250 | 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 | 4833 | 0 |
| Cuda | 2 | 186 | 34 | 26 | 126 | 11 | 5381 | 0 |
| HTML | 3 | 84 | 0 | 3 | 81 | 0 | 4866 | 0 |
| Plain Text | 7 | 68 | 0 | 0 | 68 | 0 | 1104 | 0 |
| Typst | 1 | 67 | 9 | 0 | 58 | 0 | 1599 | 0 |
| Shell | 5 | 63 | 13 | 3 | 47 | 4 | 1345 | 0 |
| WebGPU Shading Language | 1 | 39 | 3 | 8 | 28 | 5 | 1140 | 0 |
| Autoconf | 1 | 2 | 0 | 0 | 2 | 0 | 58 | 0 |
| Total | 230 | 39718 | 3667 | 5454 | 30597 | 1560 | 1423460 | 0 |
| Estimated Cost to Develop (organic) $980,749 Estimated Schedule Effort (organic) 13.65 months Estimated People Required (organic) 6.38 |
||||||||