-
Notifications
You must be signed in to change notification settings - Fork 21
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
MG majorant precalculation for DT #8
MG majorant precalculation for DT #8
Conversation
Updating with main repository
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good to me. I'm trying (and struggling) to think if there's really any circumstance that we wouldn't want this as you could in principle make it optional - probably not worth the extra code. Now we just need to do the same for CE (which I'm sure may be a bit more painful...).
xs = ZERO | ||
do i = 1,nMat | ||
xs = max(xs, self % mats(i) % data(TOTAL_XS, g)) | ||
end do | ||
self % majorant(g) = xs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xs = ZERO | |
do i = 1,nMat | |
xs = max(xs, self % mats(i) % data(TOTAL_XS, g)) | |
end do | |
self % majorant(g) = xs | |
self % majorant(g) = maxval(self % mats(:) % data(TOTAL_XS, g) |
But please check that it really does work. My Fortran is a bit rusty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True Fortran magic
xs = ZERO | ||
do i=1,size(self % activeMats) | ||
idx = self % activeMats(i) | ||
xs = max(xs, self % getTotalMatXS(p, idx)) | ||
end do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it may be a considerable problem that in the initialisation active materials are not considered.
Unless I am missing something (quite possible -> Friday evening ;-) ) the pre-calculated majorant is based on all defined materials, not only the materials which are actually included in the geometry.
I would suggest moving the majorant calculation to the activate
subroutine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good point. I will do that!
Thanks for the development! It is really nice optimisation! I absolutely love the documentation and corrections to the typos 🦭 |
Done! |
Precalculating the majorant is extremely simple for MG and it buys a nice 7-8% acceleration in, for example, a 2D C5G7 problem.
The majorant here is calculated in init and saved in mgBaseNeutronDatabase, instead of adding xss at every collision.