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

Add egs++ volume calculation #184

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft

Add egs++ volume calculation #184

wants to merge 3 commits into from

Conversation

rtownson
Copy link
Collaborator

Add a Monte Carlo volume calculation to egs++, originally designed by @ftessier. It can be turned on using :start volume calculation: in any input file. The recursive algorithm builds an octree with higher resolution in geometries with more regions. A user specified box is used as the boundary for sampling.

For example:

:start volume calculation:
    passes = the number of recursion passes to create the octree
    samples = the number samples to perform per node per pass
    box min = minX minY minZ
    box max = maxX maxY maxZ
    labels = labels you have added to your geometry using `set label`
:stop volume calculation:

For the volume calculation, the sampling box is divided into progressively smaller voxels as the geometry is analyzed on each pass. The algorithm follows the creation of an octree. Areas with a greater density of geometry regions end up with a higher density of voxels and thus are sampled more often in the volume calculation.

As the volume calculation progresses, the number of samplings in each octree node is also adjusted. On each pass, regions with a higher uncertainty on the volume are sampled more often, while regions with lower uncertainty are sampled less often.

I'm open to suggestions on this implementation! Is is bad practice to add the Volume_Node and Volume_Info classes to egs_base_geometry.h? Maybe these should go in a separate file. Is there additional or alternative functionality we would like?

@rtownson
Copy link
Collaborator Author

rtownson commented Jan 17, 2017

@ftessier has an update and bug fix pending for this PR.

@ftessier
Copy link
Member

Indeed, we need to clean this up further in terms of memory management and uncertainty tracking. I will merge this into develop after the release, to be merged in master in 2018.

@ftessier ftessier added this to the Release 2018 milestone Jan 17, 2017
@ftessier ftessier self-assigned this Jan 17, 2017
@ftessier ftessier modified the milestones: Release 2018, Release 2019 Mar 1, 2018
@ftessier ftessier modified the milestones: Release 2019, Release 2020 Jan 29, 2019
@rtownson
Copy link
Collaborator Author

rtownson commented Feb 11, 2019

Redesign suggestion:

The volume calculation should be restructured as a class and should contain methods for applications to query the geometry volumes, instead of just printing to the screen.

The inputs should not be available to any application, rather the application should parse and handle the volume inputs. We should include an egs_volume application for this. This is to avoid the user submitting an egs_chamber run to a cluster with the volume calculation accidentally turned on.

Parallel run capability should then be added to the egs_volume application.

@ftessier ftessier modified the milestones: Release 2020, Release 2021 Jan 13, 2020
@mainegra
Copy link
Contributor

@ftessier and @rtownson , are we still deciding what the best course of action is? Could we not merge egs_volume as it is and then continue its improvement?
As it currently stands users would benefit tremendously from having such a "little" app at their disposal for geometries whith very complex regions.

@ftessier ftessier modified the milestones: Release 2021, Release 2022 Mar 25, 2021
@ftessier
Copy link
Member

I propose to include this via a standalone application, and not via the egs++ geometry. Usage is then clear for the user, and development is freed of the concerns of integration in the geometry library (it could be integrated back as a geometry method later on). I will convert this PR back to a standalone egs_volume application, and merge it into develop just after the Release 2021. The idea is that any egs++ geometry input file with a volume calculation input block.could be run with egs_volume to calculate the region volumes.

@ftessier ftessier force-pushed the feature-egs-volume branch from 153787b to 8235028 Compare April 12, 2021 21:25
@rtownson rtownson requested a review from a team as a code owner April 12, 2021 21:25
@ftessier ftessier marked this pull request as draft April 12, 2021 22:37
@ftessier ftessier force-pushed the feature-egs-volume branch 2 times, most recently from aac8f51 to b07dc5d Compare April 17, 2021 20:21
@ftessier ftessier modified the milestones: Release 2022, Release 2023 Jun 27, 2022
@ftessier ftessier added the work in progress Work in progress, don't merge yet label Oct 18, 2022
Add a Monte Carlo volume calculation to egs++.
It can be turned on using :start volume calculation: in
any input file. The recursive algorithm builds an octree
with higher resolution in geometries with more regions.
A user specified box is used as the boundary for sampling.
Split printVolumes() into two functions so that
apps can use results of the volume calculation
instead of just printing the output. Also just
tidy the code a bit.
@ftessier ftessier force-pushed the feature-egs-volume branch from b07dc5d to 729728f Compare August 3, 2023 13:01
@rtownson rtownson removed this from the Release 2024 milestone Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement work in progress Work in progress, don't merge yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants