get_maxwellian_velocity Subroutine

public subroutine get_maxwellian_velocity(v, velocity)

Arguments

Type IntentOptional Attributes Name
double precision, intent(out) :: v(3)
double precision, intent(in) :: velocity

Calls

proc~~get_maxwellian_velocity~~CallsGraph proc~get_maxwellian_velocity get_maxwellian_velocity proc~normal rng_t%normal proc~get_maxwellian_velocity->proc~normal proc~sphere rng_t%sphere proc~get_maxwellian_velocity->proc~sphere proc~two_normals rng_t%two_normals proc~normal->proc~two_normals proc~unif_01 rng_t%unif_01 proc~sphere->proc~unif_01 proc~two_normals->proc~unif_01 proc~next rng_t%next proc~unif_01->proc~next proc~rotl rotl proc~next->proc~rotl

Source Code

  subroutine get_maxwellian_velocity(v, velocity)
    double precision, intent(out) :: v(3)
    double precision, intent(in)  :: velocity
    double precision              :: vtmp(3), vnorm

    vtmp(1) = velocity * rng%normal()
    vtmp(2) = velocity * rng%normal()
    vtmp(3) = velocity * rng%normal()
    vnorm   = norm2(vtmp)
    v       = rng%sphere(vnorm)
  end subroutine get_maxwellian_velocity