EGSnrc
EGSnrc copied to clipboard
Infinite loop using prism at origin
An infinite loop occurs when using a closed prism with a surface on the origin. In the case below, the issue only happens when the prism is surrounded by vacuum. The infinite loop may be due to a floating point issue on the surface of the prism at the origin point (the material may be unrelated, just help this singularity be reached). The issue occurs on both linux and windows. Thanks to /u/matheusrebello for reporting the issue. Here is the offending input file:
:start run control:
ncase = 1000
:stop run control:
#----------------------------------------------------------------------
# Geometry
#----------------------------------------------------------------------
:start geometry definition:
#Box of vacuum
:start geometry:
name =caixa_ar
library = egs_box
box size = 30 30 60
:start media input:
media = vacuum
:stop media input:
:stop geometry:
#anode with focal spot in r=(0,0,0)
:start geometry:
name = anodo
library = egs_prism
type = EGS_PrismY
points = -0.545955 -1.5 2.454045 -1.5 2.454045 1.5 0.545955 1.5
closed = -1 1
:start media input:
media = tungstenio
:stop media input:
:stop geometry:
#Who is inside who?
:start geometry:
name = tubo
library = egs_genvelope
base geometry = caixa_ar
inscribed geometries = anodo
:stop geometry:
simulation geometry = tubo
:stop geometry definition:
#----------------------------------------------------------------------
# Media
#----------------------------------------------------------------------
:start media definition:
#definindo energias de corte das particulas
ae = 0.521 # em MeV lowest energy for electrons (kinetic+0.511). Escolhi como 500 eV
ap = 0.001 # lowest energy for photons (kinetic)
ue = 50.511 # maximum energy for electrons (kinetic+0.511)
up = 50 # maximum energy for photons (kinetic).
#tungstenio
:start tungstenio:
density correction file = tungsten
:stop tungstenio:
:start air:
density correction file = air_dry_nearsealevel
:stop air:
:stop media definition:
:start source definition:
:start source:
library = egs_parallel_beam
name = feixe
direction = 1 0 0
charge = -1
:start shape:
type = box
box size = 0.001 0.3 0.001
:start transformation:
translation = -1.0005 0 0
:stop transformation:
:stop shape:
:start spectrum:
type = monoenergetic
energy = 0.160 #em MeV
:stop spectrum:
:stop source:
:stop source definition:
:start ausgab object definition:
:start ausgab object:
library = egs_track_scoring
score photons = yes
score electrons = yes
score positrons = yes
:stop ausgab object:
:stop ausgab object definition: