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

Feature/110 fix the bug in EllipsoidTissueRegion #111

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/Vts/MonteCarlo/Tissues/EllipsoidTissueRegion.cs
Copy link
Member

Choose a reason for hiding this comment

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

Change "visually" looks good and all unit tests pass. I started up a simulation with infile_ellip_FluenceOfRhoAndZ.txt and 100,000 photons to stress test code and make sure somehow flow doesn't flow out bottom of case.

Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public bool RayIntersectBoundary(Photon photon, out double distanceToBoundary)
double zto;
switch (numberOfIntersections)
{
case 0: /* roots real but no intersection */
default: /* roots real but no intersection */
return false;
case 1:
if (!oneIn && Math.Abs(root) < 1e-7) return false;
Expand Down Expand Up @@ -236,11 +236,7 @@ public bool RayIntersectBoundary(Photon photon, out double distanceToBoundary)
return true;

} /* end switch */

/* bb-4ac>0 */
/* roots imaginary -> no intersection */
return false;
}

}
}
Loading