Wierd Geometry error

Hello,

I am getting a weird error. While checking the overlaps everything looks okay(picture attached). And DAWN file is attached. However, while running the particles (neutrons), I am getting errors as shown in the picture. I am confused on why this is happening?

Any help is hugely appreciated?

PS: I am using a CAD file import along with normal c++ code.

Hello Sanchit,

The warning indicates that the Navigator has got stuck at the location indicated. It may be because there is an overlap between two volumes, or less frequently because there is a bug in the implementation of a solid (or the navigator).

I see that you have already enabled overlap checking when you create the geometry. As this uses random sample points from the surface of a volume, I suggest to increase the number of sampled points - it may reveal overlaps that are not apparent in smaller samples.

Currently the way to change the number of points used in overlap checking is rather crude: You will need to change the first value in the following line in the G4PVPlacement.hh file:

G4bool CheckOverlaps(G4int res=1000, G4double tol=0.,
G4bool verbose=true, G4int maxErr=1);

If there are many volume involved it can take quite some time to complete; but the larger the number of sample points, the stronger the indication that the geometry model does not have overlaps.

It is faster to make an initial overlap test for the volume(s) involved in the track that gets stuck. Its name is indicated above, so I would try this first.

How frequently does the warning occur ? Can you pinpoint a small region of your setup where it occurs the most ?

One thing: this is only a warning. The Navigator will attempt corrective action, by ‘pushing’ the particle forward in its direction of motion by steps of 1.0e-7 mm (for a ‘standard’ size setup - it scales with the ‘tolerance’ distance. )

If you see only warnings of this type, then the Navigator has successfully figured out where the particle should go. Basically it has recovered each time - so it is not a serious error.

There can also be a real failure (FatalError) if the Navigator fails to recover from this anomaly - after a total of 25 ‘zero’ steps by default (i.e. after 15 trial push steps) it will give up. Look for those Exceptions with the text ‘EEEE’, to see if you get those - they are serious and they mean that both that track and that event will be aborted.

Can you please clarify what version of Geant4 you are using? It is beneficial to use the most recent version, as it contains many useful fixes and improvements.

Also, are you using the default G4Solids or have you configured your installation to use the VecGeom package?

1 Like

Respected Dr. Apostolakis,

I am providing the answers to your query:

Thanks very much for your response. As per your suggestions I increased my sample points from 1000 to 100,000. Still there are no overlaps detected (Pic attached).

_

  • How frequently does the warning occur ? Can you pinpoint a small region of your setup where it occurs the most ?

_
The warning occurs very frequently as the source is very near to the geometry that causes error (CAD model). Yes I have found the geometry that gives this warning. I have made a C++ based hard-coded model and along with that I have placed a gdml model in that geometry. Whenever a track crosses the cad gdml geometry. this error arises. As I am trying to benchmark the CAD model It is important for me to correct this error. I will email you my source code so that you can take a look.

I mostly see warnings, I am yet to encounter any fatal errors yet.

  • ** Can you please clarify what version of Geant4 you are using? It is beneficial to use the most recent version, as it contains many useful fixes and improvements.**

I am using the latest version of Geant4 i.e. 10.5.0 patch 1.

  • * Also, are you using the default G4Solids or have you configured your installation to use the VecGeom package?

I am using default G4Solids package.

I am emailing you my source code.

Thanks very much!

.

Dear Sanchit,

Thanks for your clear response. With 100,000 sample points, it is starting to seem as though there may not be overlaps in the geometry. If it is not too hard to try 1,000,000 points please give that a go.

I will share with you a revised version of G4Navigator to further investigate the problem - in particular to call the overlap checker for the volume(s) at which the problem occurs.

Beyond this, if the frequency with which the problem occurs is small enough ( e.g. less than 1 in 100,000 steps or less) then it should have little effect in your benchmarking. You could just comment out that Exception (or have it print something out only in 1 in 100 or 1 in 10,000 times it hits it,) and benchmark your simulation.

Only if the ‘FatalException’ is called is there a serious problem - the warning is there to let you know that the Navigator is confused and is doing something to recover from a problem situation.

I received your message with the revised output and source code. I suggest to post the relevant parts of the revised output here - after the initialisation of your code.

Best regards,
John

I forgot to suggest that you trigger ‘CheckMode’ for the navigator. You can find how in the Users Guide for Application Developers.

It can find some problems which are not otherwise easy to spot.

Since I did not find it quickly in the guide, here’s the user command:

/geometry/navigator/check_mode 1

Respected Dr. Apostolakis

I am attaching the results when sample is 1 million and it still shows no error. It took really long time to finish running.

I am working on the other suggestions and will update you asap.

Thanks!

Hello Dr. Apostolakis,

Greetings! I have successfully resolved the geometry issue. The issue was in solidworks, if I use “mate” for two different solids in solidworks, then geant4 shows an overlap in the order of a few femtometres, it might be due to floating point too, I am not too sure. This issue was resolved by importing each single part of the CAD model separtely and then doing “check overlaps” and correcting overlaps manually by separating it by a few microns.

Many thanks for your inputs regarding this.

Sincere regards,
Sanchit Sharma

Hello Sanchit,

Glad to hear that you have resolved your problem. Indeed it seems most likely that you find a solution in your CAD description, as there were multiple issues with that one critical and very complex volume - not just in one location but in multiple regions of the solid.

Thanks for letting us know that you have resolved the problem, and good wishes for your continued use of Geant4.

John

1 Like