How to suppress all warning messages in Geant4?

Dear all,

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:

/control/verbose 0
/run/verbose 0
/event/verbose 0
/tracking/verbose 0
/hits/verbose 0
/run/particle/verbose 0
/geometry/navigator/verbose 0

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 -------

I appreciate your help in advance.

Regards,
Ashok

Hello,

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’?

Regards
Max

1 Like

Hi Max,

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.

1 Like

absolutely not true :slight_smile:

Hi weller,

I did not mean all the CAD imported geometries or volumes have defects, that’s not true, but my simulation geometry has.

yeah, I just wanted to tease a little…

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!

the problem is probably not the number of facets, it is defects. particles do not get trapped in a valid geometry.

what benefit do you get from speed-up, if you cannot trust the results?

I’ve just realised that these overlaps might significantly alter the stepping of the particles. E.g. they might “miss” some volumes. So it should be taken seriously, and in every case check weather it causes problems.

Probably the geantinos are the most sensitive for these kind of errors. So a check might be to count the number of geantinos (and/or e.g. muons) hitting some volumes with full geometry and with reduced geometry without overlaps (containing only the volumes for which you collect the hit numbers).