How to use LATTICE cards or lattic.f for large number of geometry copies

Dear Fluka experts,

I have a similar goal with this post:

My goal is to model a metal anti-scatter grids for blocking scattered ray,like this:

Many sheets of lead are arranged in a row, each sheet may be only 0.05mm thick and oriented towards the focal point.The most important point is that there are a lot of them, which is also relevant to my question.
I have studied the manual and many posts,and I have learned a lot about the use of LATTICE from this two post:

But I still have two questions:
1、How do the LATTICE cards connect the basic unit to the lattice cells that needs to be replicated?I have read the inp file or flair file for these two posts, but it seems that the LATTICE card does not set the parameters for the basic unit.So how does the LATTICE card transfer material from the basic unit to the lattice cells?
2、For my model,If I need to simulate 1000 lead sheets,does it mean that 1000 body and region cards must also be added? Although rotations and offsets can be implemented by the lattic.f subroutine, this is still a complex job and would make flair files very verbose.

I hope you can correct me if I have misunderstood about lattice card.

Dear Chen,

Regarding your questions:

  1. The LATTICE card makes an identical replica of a model (prototype). Meaning that, by construction, all the regions and materials defined in the prototype are transferred to the replica via this card. In other words, with this card you make an exact copy of a piece of geometry.
    As written in the manual:
    Materials, thresholds, etc., must be assigned ONLY to the regions contained in the basic unit. Of course, this implies that all copies of a same basic unit share the same material, setting and biasing properties.

  2. You can either set in real geometry the body/region/material/transformation cards needed to build the 1000 lead sheets or you can include in the input file as many LATTICE and ROT-DEFI cards as replicas you want to place in the geometry.
    In your model, where the lead sheets are very simple (RPP), I would recommend you to define them individually not using the lattice feature. To do so you can write a script that prepares the body, region, material and rotation cards and then copy them into the input file. Even though the input file becomes very long, there is no way in FLAIR to define a do-loop to reduce the number of lines required in your model.

Hope this information helps you.


Dear @msabateg
Thank you for your reply, and thank you for your suggestion on my model.

It’s still about LATTICE

I did a test,I’ve defined a basic unit, “target”, and the corresponding region, “TARGET”.The code in the image should indicate that I successfully replicated the lattice cell target1 and the corresponding region TARG1.But my consideration is that these steps seem pretty much the same as defining these geometries individually(Red mark),i still need to define geometry bodies and regions for the replicated lattice cells.So what is the advantage of LATTICE?

On the other hand,I’ve disabled the code associated with the basic unit,In this way, the LATTICE replicating cells appear to fail.It is not known if this is caused by the mechanism of the LATTICE card

Dear Chen,

The advantage of LATTICE becomes clear when the basic unit geometry is complex. In such case the user avoid to define multiple times the same complex geometry with a large number of cards, still the container needs to be defined as well as the LATTICE and ROT-DEFI cards for each replica, but not the rest of the bodies, regions, etc. Example of complex geometry is the grid mentioned in one of the post you linked on your previous message or the model of a whole magnet.

You cannot see the advantage in your case because you want to replicate a very basic geometry, that can be simply defined with a single body (RPP or RCC), with an advance feature.

Regarding your second point, if you check the geometry tab in FLAIR you will see the effect of disabling the cards of the basic unit, there is no particular geometry definition in the center of your geometry, so the replica will contain a piece of vacuum which is moved to the container (TARGET1) region.

Once more I encourage you to use LATTICE feature in real case of need, which is not your case.

Kind regards,

1 Like