Correct way to appy Uniform Electric Field(s)

Dear experts,

I have another question, this time about local and global uniform electric fields. As a new geant4 user, I’m curious how to correctly apply global/local (and combinations of both…) uniform electric fields.
For this purpose, I built a very simple geometry: 2 Stainless steel plates, 300cm x 20cm x 5cm.
The distance between them is set by me, (manually) to be 5cm or 50cm.(see the reason below)

I apply a local uniform electric field on each slice, with different direction, just to test if I can correctly apply it. To check this, I use the UI command /vis/scene/add/electricField.

And now on to the problem. When the distance of the slices is 50cm, the UI commands works perfectly, but when the distance between them is 5cm, I get the message “No Electric field in this extent”.(See screenshots below):

  1. Slices 50cm apart

  1. Slices 5cm apart

Is it just a visualization problem, or something else?
Why I get the “No Electric field in this extent” on the second case?

Any help is greatly appreciated!

I have also uploaded the DetectorCostruction.hh/cc If someone wants to check the code(sorry for the messy code! I’m still learning!) (8.4 KB)
DetectorConstruction.hh (1.8 KB)

PS: In the code you will see that I also declare a uniform global electric field, but it is currently set to zero.


Bunch the arrows closer. They are probably just missing your volume. Type help /vis/scene/add/electricField to see guidance.

Or better, focus on your particular volume, use /vis/set/volumeForField.

Use ls or help or the Qt help tag to see available commands and guidance.


@allison Thank you very much for the reply and the help!
I used the UI commands:

/vis/scene/add/electricField 50 lightArrow

and the arrows of the local electric fields are now displayed correctly.

The commands

/vis/scene/add/electricField 50 lightArrow

also work.Again, thank you very much for the help!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.