Angular distribution with source_newgen.f

Dear @giorgia.fossati,

  1. To sample isotropically, you could:
    a) sample from a uniform/constant file,
    b) or you could use the available:
    call sample_isotropic_direction( direction_cosx, direction_cosy, direction_cosz )
    followed by your
    direction_cosx = sample_discrete_file("AngleX.txt") to superseed the previous assignment of direction_cosx.

  2. To have a finite cylinder, you can follow the logic of the same post you mention, namely:
    call sample_annular_distribution( 49.2633D0, 50.0D0, coordinate_x, coordinate_y )
    then sampling uniformly along the z direction:
    coordinate_z = sample_flat_distribution([min], [max])

Do let me know if you need further assistances.

Best,
Daniel

1 Like