Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #388, #383: concave CD, XYZ inside CD, conestack, and box geometry errors #462

Merged
merged 4 commits into from
Mar 7, 2019

Conversation

rtownson
Copy link
Collaborator

@rtownson rtownson commented Jul 12, 2018

  1. Fix a special case of geometry error where geometries that are convex individually result in a concave cd geometries when combined (issue CD geometry does not properly account for compound concave geometries #388). These geometry errors could be created using a radius-mismatched cylinder and sphere in a cd geometry. Also fix where a small step is taken in cylinder or sphere howfar routines to step by boundaryTolerance/2 instead of boundaryTolerance. This resulted in checks against the boundaryTolerance to fail in the cd geometry.

  2. Fix a geometry error where particles could get stuck on an edge of an XYZ geometry used as the base geometry for a CD inscribed in an envelope (issue Trapped particles in xyz geometry used as cd base, inside an envelope #383).

  3. Fix an infinite loop that could occur in long simulations with a conestack with more than one layer. Previously, particles could get stuck on the surface between layers of the conestack. Example that would crash when simulating 1e7 particles:

:start geometry definition:
    :start geometry:
        library = egs_cones
        type = EGS_ConeStack
        name = inner
        axis = 0 0 -2.5545 0 0 1
        :start layer:
            thickness = .321
            top radii = 1.9
            bottom radii = 1.9
            media = air
        :stop layer:
        :start layer:
            thickness = 2.0585
            top radii = 1.9
            bottom radii = 1.9
            media = air
        :stop layer:
    :stop geometry:
    simulation geometry = inner
:stop geometry definition:
:start source definition:
    :start source:
        name    = isotropic_point_source
        library = egs_isotropic_source
        charge  = -1
        :start shape:
           type = sphere
            midpoint = 0 0 -2.5
            radius = 0.01
       :stop shape:
        :start spectrum:
           type = monoenergetic
           energy = 1.1
       :stop spectrum:
    :stop source:
    simulation source = isotropic_point_source
:stop source definition:
  1. Fix a geometry error where a particle could get stuck in the corner of an egs_box. The error could be produced using:
:start geometry definition: 
     :start geometry: 
         library = egs_box 
         name    = the_world 
         box size = 50 50 50
         :start media input: 
             media = air 
         :stop media input: 
     :stop geometry: 
     :start geometry: 
      library = egs_box 
       box size =   2.8 2.8 2.8
          :start transformation:
            translation =    0, 9, 9
          :stop transformation: 
          name = my_box 
          :start media input: 
              media = water 
          :stop media input: 
      :stop geometry: 
      :start geometry: 
         library = egs_genvelope 
         name = the_scenario 
         base geometry = the_world 
         inscribed geometries =  my_box
      :stop geometry: 
simulation geometry =  the_scenario 
:stop geometry definition:

@rtownson rtownson added the bug label Jul 12, 2018
@rtownson rtownson self-assigned this Jul 12, 2018
// (g[ibase] && g[ibase]->isConvex()))) {
// // (a) is true
// return ixnew;
// }
Copy link
Contributor

@mchamberland mchamberland Jul 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is the right solution? Something strange goes on in egs_view with this:

this does not look good

This is a simple conestack with mismatched radius. The larger one is completely missed when particles leave the smaller cylinder towards the larger one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the geometry shown in the screenshot:

:start geometry definition:
:start geometry:
name = conestack
library = egs_cones
type = EGS_ConeStack
axis = 0 0 0 0 0 1

    :start layer:
        thickness = 1
        top radii = 1
        bottom radii = 1
        media = water
    :stop layer:
    
    :start layer:
        thickness = 1
        top radii = 2
        bottom radii = 2
        media = lead
    :stop layer:
:stop geometry:

simulation geometry = conestack

:stop geometry definition:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I think I goofed! My conestack was the only geometry in the simulation, so when a particle exits the smaller cylinder, it leaves the geometry, which is why egs_view can't see anything behind it, I think. If you inscribe the conestack in a box, then it looks fine. My bad!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, that's normal behaviour. Thanks for testing!

@rtownson rtownson changed the title Fix #388: concave cd geometry errors Fix #388, #383: concave CD, and XYZ inside CD geometry errors Jul 17, 2018
@rtownson rtownson changed the title Fix #388, #383: concave CD, and XYZ inside CD geometry errors Fix #388, #383: concave CD, XYZ inside CD, and conestack bugs Jul 30, 2018
@ftessier ftessier force-pushed the fix-concave-geometry-errors branch 2 times, most recently from f45ff00 to 100fadb Compare September 20, 2018 21:58
@ftessier
Copy link
Member

ftessier commented Oct 4, 2018

Rebased on develop, no conflict.

@rtownson rtownson changed the title Fix #388, #383: concave CD, XYZ inside CD, and conestack bugs Fix #388, #383: concave CD, XYZ inside CD, conestack, and box geometry errors Jan 21, 2019
@rtownson rtownson mentioned this pull request Jan 22, 2019
@ftessier ftessier added this to the Release 2019 milestone Jan 29, 2019
Address a special case where convex geometries result in a concave cd
geometry when combined. This showed up as geometry errors and could be
created using a radius-mismatched cylinder and sphere in a cd geometry.
Also fix a bug where a small step is taken in the cylinder or sphere
howfar() routine by boundaryTolerance/2 instead of boundaryTolerance,
causing checks against the boundaryTolerance to fail in the cd geometry.
Resort to the boundaryTolerance parameter to avoid particles getting
stuck at edges when an xyz geometry serves as a cd base geometry, which
is subsequently inscribed in an envelope.
Resort to the boundaryTolerance parameter to avoid a rare but possible
infinite loop trap in simulations with a conestack geometry comprising
more than one layer, causing particles to get stuck on the surface
between layers in the conestack.
Change comparison operators from inequalities to strict inequalities, in
order to avoid particles getting stuck at corners in an egs_box
geometry.
@ftessier ftessier force-pushed the fix-concave-geometry-errors branch from 92516c3 to 116dfd3 Compare March 5, 2019 18:43
Copy link
Member

@ftessier ftessier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusted commit titles and messages, rebased on develop.

@ftessier ftessier merged commit 6f90abd into develop Mar 7, 2019
@ftessier ftessier deleted the fix-concave-geometry-errors branch March 7, 2019 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants