|Message: Re: Cylinder volume filled with small spheres||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
On Thu, 08 Mar 2018 09:35:24 GMT, Cristian Bungau wrote:
> I have a tube of certain minimum and maximum radii, and I have to fill > it with tiny spheres placed closed together right next to each other. I > know one can use a for loop to place each volume with the calculated > coordinates as a new placement copy of the same logical volume. But the > memory consumption is huge and causes the code to crash because of this. > > If anyone can think of a better way using either replica or parametrised > volumes, I would be very grateful if you could please let me know.
This is exactly what a parametrized volume is for. You'll need to make your physical tube a separate volume from the packed spheres. For example, create a "solid" cylindrical envelope volume (G4_Galactic material) matching your tube's OD. Place your tube as a daughter of that envelope.
Then make another "solid" cylinder (G4_Air material or whatever) matching your tube's ID. This will be the mother volume for a G4PVParameterised, containing all your little spheres. If you've already got a mapping from index to position, that will make writing your G4VPVParameterisation subclass much simpler. I had a case where the positions were taken from a CAD drawing (a lithography mask), so I put them into a text file and had my G4VPVParametrisation read it into a std::vector<G4ThreeVector>.
The spheres can't overlap, of course, but the also don't have to be touching. You will need to know in advance how many spheres there are in the tube (it's an argument to G4PVParameterised).
-- Michael Kelsey
|Inline Depth:||Outline Depth:||Add message:|