I want to force my simulation to stop generating (or showing) lots of warning messages. I have tried the following to set the verbosity to 0, but it did not work:
How can I set all verbosity to zero so that I can speed up my simulation a little bit? In my case, the warning messages I am getting are just warning, and it is safe to ignore them. See below for the type of warning that I want to suppress:
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomNav1002
issued by : G4Navigator::ComputeStep()
Stuck Track: potential geometry or navigation problem.
Track stuck, not moving for 10 steps.
Current phys volume: âworld_physâ
at position : (-232.1458026419418,257.3936389169146,2.313385798282503)
in direction: (0.4717506325580638,-0.8364464362708558,0.2789421085652931)
(local position: (-232.1458026419418,257.3936389169146,2.313385798282503))
(local direction: (0.4717506325580638,-0.8364464362708558,0.2789421085652931)).
Previous phys volume: âbody_physâ
Likely geometry overlap - else navigation problem !
*** Trying to get unstuck using a push - expanding step to 1e-07 (mm) ⌠Potential overlap in geometry !
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomNav1002
issued by : G4Navigator::ComputeStep()
Stuck Track: potential geometry or navigation problem.
Track stuck, not moving for 10 steps.
Current phys volume: âbody_physâ
at position : (-218.4109607217677,305.7984695081289,-54.07777062925668)
in direction: (0.8654973824996588,0.1218692841277543,-0.4858622834429813)
(local position: (-218.4109607217677,54.0777706292567,305.7984695081289))
(local direction: (0.8654973824996588,0.4858622834429813,0.1218692841277543)).
Previous phys volume: âbone_physâ
Likely geometry overlap - else navigation problem !
*** Trying to get unstuck using a push - expanding step to 1e-07 (mm) ⌠Potential overlap in geometry !
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
Best way to supress these warnings is to fix the cause.
Seems like there is something wrong with the geometry. How are âworld_physâ and âbody_physâ connected to each other? Is âworld_physâ a mother volume of âbody_physâ?
Yes, the body is the daughter of the mother volume âworldâ. I have checked with visualization that they are not overlapped with each other, although the body daughter volume has some defects as it is imported from the CAD program. I think it is safe to ignore this warning in my simulations, and if I manage to suppress these warnings, this will speed up my simulations by some factor as printing these warning messages takes some time. So, I am looking for a command to suppress these sorts of warning messages.
That warning can be suppressed by compiling Geant4 itself with the CMake option GEANT4_BUILD_VERBOSE_CODE set to OFF. That will however suppress not just that specific warning, but many others as well.
Iâve moved this to geometry as I think the better solution is to address why tracks are getting stuck in this geometry and fix that, and the experts here can help with this.
If these warnings slow down your simulation notably, I would fear that already a not insignificant portion of the events is indeed affected by the defective geometry.
have you tried if /geometry/test/run gives you a meaningful error message?
otherwise, I would open the CAD-export in a suitable program and check for common errors (degenerate or inside-out faces, holes, self-intersections, duplicate vertices, non-triangles/quadsâŚ).
I did try that command to check my geometry. No overlap was detected. I managed to speed up my simulations by a factor of ~1.5 times by reducing the poly mesh in my CAD/STL geometry (ReduceMesh by 50%), but still, the Geant4 is writing warning messages. If I able to suppress those warnings, as I mentioned before, I could get more gain. And I donât want to be aggressive in reducing my mesh triangles as it may backfire!