Dear Nicholas,
probably there is is some more elegant solution, but a simple one could
be:
1) define a parallelepiped with sides parallel to the axes that circumscribes
the region of interest as close as possible, identified by its x, y and z
limits: X1, X2, Y1, Y2, Z1, Z2
2) write a source routine in which the starting position is sampled
randomly inside that parallelepiped:
XXX = X1 + FLRNDM(XYZ)*(X2 - X1)
YYY = Y1 + FLRNDM(XYZ)*(Y2 - Y1)
ZZZ = Z1 + FLRNDM(XYZ)*(Z2 - Z1)
Call the routine GEOREG to find in which region is point XXX, YYY, ZZZ:
CALL GEOREG(XXX, YYY, ZZZZ, NREG, IDISC )
If NREG is not the number of the region of interest, re-sample.
If it is inside, put the point coordinates on stack:
XFLK (NPFLKA) = XXX
YFLK (NPFLKA) = YYY
ZFLK (NPFLKA) = ZZZ
This method will be the more efficient, the closer the parallelepiped
is to the region.
Alberto
On Fri, 20 Jan 2012, Nicholas Bolibruch wrote:
> Dear Fluka experts,
>
> I am interested in generating primary particles
from a specific region
> already defined in the .inp file. As of now I just define coordinates
> and directional cosines using a function in source.f. However, I wish
> to increase the complexity of the geometry, and would like to use this
> routine on demand for any future models.
>
> An example would be to make a complex geometry radiate gammas
> isotropically, where primaries may start at any depth within the region.
>
> All I need is a starting point to do this.
>
> Thank you,
>
> Nicholas Bolibruch
> Canadian Light Source Inc.
Received on Sun Jan 22 2012 - 12:41:18 CET
This archive was generated by hypermail 2.2.0 : Sun Jan 22 2012 - 12:41:30 CET