Repository navigation
Sweeping OPs for inclusion #39
Replies: 9 comments 4 replies
|
Hi Nick, Nice to hear from you and thank you for your question! I have looked at your infile and a couple of things catch my eye:
Do you want a CappedCylinder that resides entirely inside one layer? If so, I can describe how to define that. Or if you have something else in mind, please describe or attach a figure. Best, Carole |
|
Hi Nick, Thank you for the schematic, it helps a lot. After looking at the code for a CylinderTissueRegion one method has yet to be coded, SurfaceNormal. I can create an issue and code this up for you. I will update you in a few days. Best, Carole |
|
Hi Nick, In your infile you specify that the cylinder has center at X=30.0mm. Is this correct? Is it off-axis? If so, then we can't specify a cylindrical coordinate detector like R(rho,Omega) we have to specify R(x,y). Let me know and I can edit your infile. |
|
Hi Carole,
The cylinder can be moved on-axis if needed. The idea is to have
the inclusion positioned in the middle between the source and the final
detector location (similar to shown in the attached crude image). Do we
still need to specify R(x,y) or could we use R(rho, omega)?
[image: image.png]
Best,
Nick
…On Wed, Nov 4, 2026 at 8:44 PM Carole Hayakawa ***@***.***> wrote:
Hi Nick,
In your infile you specify that the cylinder has center at X=30.0mm. Is
this correct? Is it off-axis? If so, then we can't specify a cylindrical
coordinate detector like R(rho,Omega) we have to specify R(x,y).
Let me know and I can edit your infile.
Best, Carole
—
Reply to this email directly, view it on GitHub
<#39?email_source=notifications&email_token=AV27RGJYCG4EOD2S6QRYLVL5XPLO5A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOJUGA4TOMJQUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVRTG633UMVZF6Y3MNFRWW#discussioncomment-19409710>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AV27RGO7KWHSPUOJYGPPYBT5XPLO5AVCNFSNUABIKJSXA33TNF2G64TZHMZDONRUHEZDSMZYHNCGS43DOVZXG2LPNY5TCMJSGE4TKOJTUF3AE>
.
You are receiving this because you authored the thread.Message ID:
<VirtualPhotonics/Vts.MonteCarlo/repo-discussions/39/comments/19409710@
github.com>
|
|
Just noting that details of the code modifications to this can be found here: |
|
Hi Nick, I have an infile and code on a branch that runs and provides seemingly reasonable results. To get back to your original question. To run a sweep of OPs, you would use the tissue index of the cylinder inclusion. In your geometry, tissue index = 1 (air above), 2 (top layer), 3 (bottom layer), 4 (air below), 5 (cylinder). I will give you a link to my google drive where I will put a .zip file with the code modifications on this new branch. Do you prefer Linux, Windows, and/or Mac as your platform? This was a needed update to the code so thank you for your post! |
|
Hi Carole,
Thank you for doing this and for the additional information on how to run
the parameter sweep. Regarding OS, I'm running Windows.
Best,
Nick
…On Thu, Nov 5, 2026 at 4:49 PM Carole Hayakawa ***@***.***> wrote:
Hi Nick,
I have an infile and code on a branch that runs and provides seemingly
reasonable results.
infile_two_layer_ROfRhoandOmega_cylinderInc_ckh.txt
<https://github.com/user-attachments/files/34449527/infile_two_layer_ROfRhoandOmega_cylinderInc_ckh.txt>
Note that I added AOfRhoAndZ (absorbed energy in cylindrical coordinates)
to help visualize if the results look plausible. You can optionally remove.
I have written validation and unit tests, however I depend on you to let me
know if this appears to be working for you or not. Until then I will keep
the code on a branch.
To get back to your original question. To run a sweep of OPs, you would
use the tissue index of the cylinder inclusion. In your geometry, tissue
index = 1 (air above), 2 (top layer), 3 (bottom layer), 4 (air below), 5
(cylinder).
For example: paramsweepdelta=mua5,0.01,0.5,25 I would run just a small
number of photons and make sure that the generated infile, found in the
output folder with same name as the infile minus the prepended "infile_"
and a .txt extension shows the correct OPs for the sweep specification. Let
me know if this seems to be working too.
I will give you a link to my google drive where I will put a .zip file
with the code modifications on this new branch. Do you prefer Linux,
Windows, and/or Mac as your platform?
This was a needed update to the code so thank you for your post!
Best, Carole
—
Reply to this email directly, view it on GitHub
<#39?email_source=notifications&email_token=AV27RGJMLRVHBSP4KLC66J35XTYVPA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOJUGI3TKNBWUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVRTG633UMVZF6Y3MNFRWW#discussioncomment-19427546>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AV27RGMSQ6HCCE2CZZALFI35XTYVPAVCNFSNUABIKJSXA33TNF2G64TZHMZDONRUHEZDSMZYHNCGS43DOVZXG2LPNY5TCMJSGE4TKOJTUF3AE>
.
You are receiving this because you authored the thread.Message ID:
<VirtualPhotonics/Vts.MonteCarlo/repo-discussions/39/comments/19427546@
github.com>
|
|
Hi Carole, I was doing some exploration with my Claude agent when running simulations with MCCL. In attempting to use multiple cores (8) to run the simulation, I noticed that performance didn't change much. Upon further investigation, Claude noticed that there were only ~2 cores actually working at a time, which was due to how .NET garbage collection was being done. Changing how garbage collection is performed by adding the following lines of code prior to running a simulation, I was able to reduce a 10 million photon 4 hr simulation to about ~ 26 minutes. I compared the amplitude and phase results and they differed by a maximum of 9% (avg 1.5%) and 1.6% (avg 0.83%), respectively. Both maximums were at the largest SDS (48mm). I wanted to pass this along in the event that it could be useful for you and your team. I've also included an explanation that my agent came up with to help me better understand how collection is being performed. Happy to discuss if you'd like. Command prior to running mc.exe: Explanation Background: garbage collection (GC) As mc.exe tracks a photon, it keeps creating small objects (one per scattering event, for example) and discards them once the photon is finished. .NET doesn't free memory immediately. Instead it periodically runs a garbage collector, which finds objects that are still in use and reclaims the rest. During most collections, all simulation threads are paused. New objects go into an area called generation 0 (gen0). When gen0 fills up, a collection runs. Objects that survive a collection get promoted to gen1 and then gen2, which are collected less often. Line 1: set DOTNET_gcServer='1' This switches from the default workstation GC to server GC.
Line 2: set DOTNET_GCgen0size='0x10000000' This sets how much gen0 can hold before a collection is triggered. 0x10000000 is hexadecimal for 268,435,456 bytes, which is 256 MB.
|

Uh oh!
There was an error while loading. Please reload this page.
I'm attempting to run MCCL simulations for a 2 layer model with a cylinder inclusion. I want to sweep the mua for the cylinder inclusion but am unsure on how to write that using command prompt. For example, sweeping the 2nd layer mua would be paramsweepdelta=mua2,0.01,0.5,25 but what would be inserted instead of "mua2" for this instance? I've attached my infile for convenience
infile_two_layer_ROfRhoandOmega_cylinderInc.txt
All reactions