Skip to content

Commit 7637f18

Browse files
committed
Docs
1 parent e26ceda commit 7637f18

4 files changed

Lines changed: 35 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# bhut
22

33
<div align="center">
4-
<img src="docs/assets/logo-256.png" alt="bhut logo" width="200"/>
4+
<img src="docs/assets/logo-256.svg" alt="bhut logo" width="200"/>
55
</div>
66

77
A high-performance Barnes-Hut N-body accelerator that is array-agnostic, supporting both NumPy and Dask arrays for distributed computation.

docs/dev/contributing.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@ mypy bhut/
8383
mypy --strict bhut/
8484
```
8585

86+
## Documentation Preview
87+
88+
To preview the documentation locally:
89+
90+
```bash
91+
./scripts/preview_docs.sh
92+
```
93+
94+
This script installs the required dependencies and starts a local server at http://localhost:8000. It is executable by default.
95+
8696
## Pull Request Guidelines
8797

8898
### Before Submitting

docs/theory/barnes-hut.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,26 @@ To avoid singularities at small distances, a softening parameter $\epsilon$ is o
5757

5858
$$\vec{F}_{ij} = -G \frac{m_i m_j}{(|\vec{r}_{ij}|^2 + \epsilon^2)^{3/2}} \vec{r}_{ij}$$
5959

60+
## Plummer Softening
61+
62+
We use Plummer softening:
63+
\[
64+
\Phi_i = -G \sum_{j \ne i} \frac{m_j}{\sqrt{\|\mathbf{r}_i-\mathbf{r}_j\|^2 + \varepsilon^2}},
65+
\qquad
66+
\mathbf{a}_i = -\nabla \Phi_i
67+
\]
68+
69+
## Quadtree/Octree Split (Mermaid)
70+
71+
```mermaid
72+
graph TD
73+
R[Root Cell]
74+
R --> C1[Child 1]
75+
R --> C2[Child 2]
76+
R --> C3[Child 3]
77+
R --> C4[Child 4]
78+
```
79+
6080
## Center of Mass Calculation
6181

6282
For each tree node, the center of mass and total mass are computed:

scripts/preview_docs.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
pip install mkdocs-material mkdocstrings[python] mkdocs-jupyter
4+
mkdocs serve -a 0.0.0.0:8000

0 commit comments

Comments
 (0)