[fluka-discuss]: Re: From flair to bash script: definition of constants (#define)

From: Ferreira De Almeida Lourenco, Ana <am.lourenco_at_ucl.ac.uk>
Date: Wed, 18 Mar 2015 11:46:33 +0000

Dear Lefteris and Thiago,


Many many thanks for this. Your tips are great, I ran a quick test and it worked!


Best wishes,

Ana

________________________________
De: Eleftherios Skordis <eleftherios.skordis_at_cern.ch>
Enviado: 18 de março de 2015 11:30
Para: Ferreira De Almeida Lourenco, Ana; fluka-discuss_at_fluka.org
Assunto: RE: From flair to bash script: definition of constants (#define)

Greetings Ana,

FLUKA only understands the values that are written in the actual FLUKA cards.
Flair uses its own quasi-cards starting with "!_at_" and the "what" of the card that is suppose to calculate.
When you change a variables value with your script you are just changing the text inside the input file and nothing else.
Unless you open flair and actually make a quasi-change and re-save the input file nothing will be changed.

However there is a way to update them through a bash script.

If you type flair -h you will find a list of very useful options for flair.
One of them is the "update | -u " which when combined with an input file it will "Recalculate and save input file variables".

e.g. flair -u test.inp

You can use that in your bash script after you have changed the value of the variable.

Kind regards

Lefteris



-----------------------

Eleftherios Skordis
Dep. EN/STI, CERN
CH-1211 GENEVA 23
SWITZERLAND

OFFICE: +41-22-7679541<tel:%2B41-22-7675461>
________________________________
From: owner-fluka-discuss_at_mi.infn.it [owner-fluka-discuss_at_mi.infn.it] on behalf of Ferreira De Almeida Lourenco, Ana [am.lourenco_at_ucl.ac.uk]
Sent: 18 March 2015 11:55
To: fluka-discuss_at_fluka.org
Subject: [fluka-discuss]: From flair to bash script: definition of constants (#define)


Dear all,


I have been using flair to run my simulations and now I'm running them through a bash script.


In my simulations I define a cylindrical phantom divided in many slabs. The thickness of the slabs is variable and I defined a variable cpl (#define cpl) to vary the thickness of the slabs. An example of my input from flair:

---------------------------------------------------------------------------------------------------------------------

 !_at_what.1=1.0
#define cpl 1


XYP PL1 0.0
!_at_what.1=0.001*cpl
XYP PL2 0.001
!_at_what.1=0.4*cpl
XYP PL3 0.4
!_at_what.1=0.401*cpl
XYP PL4 0.401
!_at_what.1=0.8*cpl

---------------------------------------------------------------------------------------------------------------------


In flair when I change the value of cpl (#define cpl), it automatically changes the thickness of the slabs but when I change it through my bash script (#define cpl), it doesn't. I also tried to change my input to the following example but it does not run:

---------------------------------------------------------------------------------------------------------------------

XYP PL1 0.0
!_at_what.1=0.001*cpl
XYP PL2 0.001*cpl
!_at_what.1=0.4*cpl
XYP PL3 0.4*cpl
!_at_what.1=0.401*cpl
XYP PL4 0.401*cpl
!_at_what.1=0.8*cpl

---------------------------------------------------------------------------------------------------------------------


The error may be in the syntax that I'm using. I checked some fortran tutorials but I am not used to this language and it is not straightforward for me.


Any ideas/thoughts?


Many thanks,

Ana




__________________________________________________________________________
You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info
Received on Wed Mar 18 2015 - 13:55:54 CET

This archive was generated by hypermail 2.3.0 : Wed Mar 18 2015 - 13:55:55 CET