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:
parent
6389c8ba2d
commit
5386114d15
2 changed files with 24 additions and 17 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue