Volumetric source of complex geometry

Hi Alexy,

it is possible to use the

CALL GEOREG ( X, Y, Z, NREG, IDISC )

subroutine for this purpose. It will return the number of the region (NREG) which the point with the coordiantes X, Y, Z belongs to. (Note: There are some ambiguities if the point is on a border between regions. IDISC variable indicates if the point is outside the geometry.)

I prepared a quick proof of concept source routine and flair project: source.f (9.8 KB) region_source.flair (2.3 KB)

The source routine uses a recursive subroutine, which first uniformly samples in a box around the volume, then check the region number and finally rejects / accepts the location.
The boundaries of the box and region number of the desired volume is provided at the initial call.

Cheers,
David

3 Likes