Flair fails to expand and optimize regions

Dear community

My name is David and I’m trying to optimize an input script with a complex mass model by using the expand and optimize functions in FLAIR (Geomtry section). The idea is to simplify the regions, which I defined with some nested parenthesis to avoid online parenthesis evaluation and consequently increase the speed of my simulations.

Flair failed to expand and optimize some regions.

Problem solving so far
To facilitate the discussion, I’ve copied one of the problematic regions to the standard fluka input file, which is also attached to this post.


  1. Do you have also problems to expand (and optimize) the TARGET and VOID region in the attached input file using the functions in FLAIR?
  2. If yes, do you have a work-around for this issue?

test_expand_and_optimize.flair (5.9 KB)
test_expand_and_optimize.inp (6.4 KB)

Additional Notes
I’m using FLUKA 4-2.2 and FLAIR 3.1-15.1.

Thank you very much for your support
Kind regards,

Dear David,
Yes, I have the same problem in expanding the TARGET and VOID regions. I ascribe this to the large use of parenthesis. As a workaround, I can only suggest you to re-define both regions using the geometry editor, graphically selecting all the zones that make up those two regions.

Thanks for your reply. I really appreciate your help.

Based on your input, I’ve tried to expand and optimize the individual parts of the TARGET region separately. This worked quite well. However, for one of the parts (commented TEST region) which contains only 1 parenthesis, expand and optimize didn’t work either. Please have a look at the following input scripts:

test_expand_and_optimize_v3.flair (6.6 KB)
test_expand_and_optimize_v3.inp (7.4 KB)

From my understanding, FLAIR should be able to expand 1 single layer of parenthesis, shouldn’t it?


Please have a look also at these input files:

test_expand_and_optimize_v4.flair (22.6 KB)
test_expand_and_optimize_v4.inp (26.8 KB)

I’ve managed to expand and optimize the TARGET region successfully. As you can see, the TARGET region definition without parenthesis is quite large. If I want to expand now the VOID region with only 1 parenthesis level, FLAIR is not able to do it…

It is true that the VOID regions has only one single parenthesis, but it contains quite a large number of “ORs” of different zone. I fear that you’ll have to do with VOID the same thing you did with TARGET.

I see. As you can imagine, this is a very intensive manual work. I have to subtract more or less each zone individually. Considering, that this toy problem is only a very small part of my much more complex geometry, I fear that this solution is not practical (>100h work). In theory, it should be possible to program the expansion and optimization iteratively in FLAIR, shouldn’t it? This is maybe something for a future release…

I can suggest you to build the object you have to subtract within a bounding box (e.g. RPP or RCC) so that subtracting them would be easier, as this was suggested here.
Alternatively, you can try what was suggested here by @vasilis.

Yes, I’m aware of these tricks. In fact, I’m running my simulations at the moment using online parenthesis evaluation. In addition, I have used bounding boxes as often as possible. The original goal behind the expansion of my regions is not only to increase the speed of my simulations but also to check, if nested parenthesis could cause precision errors as reported in this post Unexpected GEOFAR tracking errors. From your experience, could nested parenthesis together with online parenthesis evaluation cause numerical precision errors?

Unfortunately, I cannot tell you, as I never use parenthesis.

I see. Nevertheless, thank you very much for your support. I really appreciate your support. I will keep investigating the numerical question in the other post mentioned above.


Unfortunately in this case the extensive use of QUA makes the expansion algorithm to fail.