Cylindrical injection working better

Seems things are a bit better. Still, more cases are needed and still
not perfectly uniform...
This commit is contained in:
Jorge Gonzalez 2024-06-29 14:58:48 +02:00
commit 5386114d15
2 changed files with 24 additions and 17 deletions

View file

@ -75,10 +75,10 @@ MODULE moduleRandom
REAL(8):: rnd0b
INTEGER:: rnd, i
rnd0b = random(0.D0, sumWeight)
rnd0b = random()
i = 1
DO
IF (rnd0b <= cumWeight(i)) THEN
IF (rnd0b <= cumWeight(i)/sumWeight) THEN
rnd = i
EXIT