-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparticle.ml
More file actions
33 lines (32 loc) · 810 Bytes
/
particle.ml
File metadata and controls
33 lines (32 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
open Vectorop;;
(* module Particle = struct *)
type properties = {
(* physical properties *)
r: Vectorop.space;
v: Vectorop.space;
b: Vectorop.space;
uth: float;
e: float;
rho: float;
p: float;
cs: float;
m: float;
h: float;
alpha: float;
(* rates of change *)
f: Vectorop.space;
dbdt: Vectorop.space;
sij: Vectorop.tensor;
drhodt: float;
dudt: float;
dedt: float;
dalphadt: float;
}
(* checks if 2 particles are neighbours, returns particle in a one element list if neighbour *)
let check_neighbour part1 part2 =
let dist = Vectorop.norm (Vectorop.diff part1.r part2.r) in
if ((dist < part1.h) && (dist == 0.)) then
part2 :: []
else
[]
(* end *)