Forum: Forums topas RSS
The "local" keyword in .INP files
AmundMR #1
Member since Jul 2020 · 2 posts · Location: Norway
Group memberships: Members
Show profile · Link to this post
Subject: The "local" keyword in .INP files
Dear all.

I've recently familiarized myself with various aspects of the input file of topas, which works wonders. However, I am wondering about the 'local' keyword.

I can tell on the wiki that the following use works (And I've tested it):
xdd..
    str...
          local prm_Silver_beq 0
          site Ag1 num_posns 4 x  0 y  0 z  0 occ Ag  1 beq =prm_Silver_beq;

However, I do not understand what exactly the number on the end of line 3 means.

I have a procedure, where I initialize one of several hundred datafiles in the GUI, and then I copypaste the contents of the INP file to include all my datafiles like the following in order to do a surface refinement:
xdd datafile1
    str..
        local prm_Silver_beq 0
        site Ag1 num_posns 4 x  0 y  0 z  0 occ Ag  1 beq =prm_Silver_beq;
out ... append
    Out(prm_Silver_beq, " %11.5f \n")

xdd datafile2
    str..
        local prm_Silver_beq 0
        site Ag1 num_posns 4 x  0 y  0 z  0 occ Ag  1 beq =prm_Silver_beq;
out ... append
    Out(prm_Silver_beq, " %11.5f \n")

xdd datafile3
    str..
        local prm_Silver_beq 0
        site Ag1 num_posns 4 x  0 y  0 z  0 occ Ag  1 beq =prm_Silver_beq;
out ... append
    Out(prm_Silver_beq, " %11.5f \n")

My concern is that when I exchange the following original INP line
        site Ag1 num_posns 4 x  0 y  0 z  0 occ Ag  1 beq @ -0.02126058884
With the one where I placed the local parameter, the initial number gets lost, and I am afraid that the further refinements might not be as good as the one which would be based off of this number already on the line.

Thus my questions becomes:
1. Is it possible to define a local parameter by replacing the @ with a special combination of keywords? This way I only have to change one line, and hopefully the number can remain as an initial value.
2. If I have to define the local parameter on a separate line, like in the examples above, can I replace the 0 with the number behind the original "beq @" and have the refinement start with that initial value?

Sorry for the long post. I hope I was able to present my problem in a proper manner.
Best regards,
Amund Midtgard Raniseth
NAFUMA, Department of Chemistry, University of Oslo, Norway.
rowlesmr #2
Member since Oct 2011 · 245 posts
Group memberships: Members
Show profile · Link to this post
Hi Amund

The number at the end of line 3 is the initial value of the local parameter named "prm_Silver_beq".

1: I don't think so.
2: Yes, but. If you've got a negative value there, then that is physically impossible, and you need to think if the data can support the refinement of the thermal parameter, or if you have some other error in your model.

Is the reason you're making a local prm so that you can output the value to file?

Matthew
--
Matthew
AmundMR #3
Member since Jul 2020 · 2 posts · Location: Norway
Group memberships: Members
Show profile · Link to this post
Thank you, Matthew.

The reason I am defining the local prm is in order to output it, yes.

Good point about the negative beq value, but right now I am more concerned about getting my procedure working. I am creating a software for mass-refining big sets of data using TOPAS surface refinement, and I need the structure parameter to be local so it is updated for each xdd (or datafile) and output to a file.

Automating the task of finding the @ and replacing with a suitable keyword is a bit tricky, since the different variables has different line formatting. Maybe there is a command for outputting all refined parametres? However, then I guess it will be hard for topas to automatically assign good names for all these refined variables.

As of right now my software can do sequential refinement pretty flawlessly, outputting all refined parameters with relevant nametags in one file, and all diffraction pattern refinements to a separate folder.

Thanks again.
Best regards,
Amund Midtgard Raniseth
NAFUMA, Department of Chemistry, University of Oslo, Norway.
rowlesmr #4
Member since Oct 2011 · 245 posts
Group memberships: Members
Show profile · Link to this post
Depending on your Topas version, the keyword "out_prm_vals_on_convergence" might exist.

That will output all prm values upon convergence of the refinement.
--
Matthew
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Not logged in. · Lost password · Register
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-11-29, 13:50:58 (UTC +00:00)