Re: converting a region name into a region number

From: Alberto Fasso' <fasso@SLAC.Stanford.EDU>
Date: Tue May 20 2008 - 20:04:14 CEST

Dear Sharmalee,

the routine you are looking for is indeed GEOR2N. To use it is simpler than
you think. I will give you an example below.
Its arguments are NREG, REGNAM, IERR, i.e. respectively the region number,
the region name and an error flag (equal to 0 if the conversion succeeded,
1 otherwise).

Here is my example, writing to a collision file the x and y coordinates,
the energy and the weight of photons crossing the boundary between region
VpNEHaVa and region DummyC4d.

       ENTRY BXDRAW ( ICODE, MREG, NEWREG, XSCO, YSCO, ZSCO )
       IF ( .NOT. LFCOPE ) THEN
          LFCOPE = .TRUE.
          OPEN ( UNIT = 88, FILE = "collfile", STATUS = 'unknown')
       END IF
       CALL GEOR2N ( MREG, MRGNAM, IERR1 )
       CALL GEOR2N ( NEWREG, NRGNAM, IERR2 )
       IF(IERR1 .NE. 0 .OR. IERR2 .NE. 0) STOP "Error in name conversion"
       IF(MRGNAM .EQ. "VpNEHaVa" .AND. NRGNAM .EQ. "DummyC4d") THEN
          IF(JTRACK .EQ. 7) WRITE(88,'(1P,4G25.15)')
      & XSCO, YSCO, ETRACK, WTRACK
       END IF
       RETURN

Alberto

On Sat, 10 May 2008, Sharmalee Randeniya wrote:

>
>
> Dear FLUKA experts,
>
> I am trying to use BXDRAW in mgdraw.f to write a boundary crossing particle dump
> for a proton therapy simulation. My FLUKA input file is written using region
> names instead of region numbers to describe the geometry.
>
> Is there a routine to convert region names into region numbers?
>
> I read the description on GEOR2N routine in chapter 13 in the manual. If I am
> correct it converts a region number into a name and region number (MREG/NEWREG)
> is the input variable and the region name is the returned variable. So if I
> were to used this, I first have to search for the required region names in a
> loop. Am I right or wrong?
>
> Any help is deeply appreciated !!!
>
> Thank you
>
> Sharmalee
>
>

-- 
Alberto Fasso`
SLAC-RP, MS 48, 2575 Sand Hill Road, Menlo Park CA 94025
Phone: (1 650) 926 4762   Fax: (1 650) 926 3569
fasso@slac.stanford.edu
Received on Tue May 20 22:38:46 2008

This archive was generated by hypermail 2.1.8 : Tue May 20 2008 - 22:38:47 CEST