Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
optional_sections [2020/07/16 11:29]
127.0.0.1 external edit
optional_sections [2021/07/28 09:02] (current)
johnsoevans
Line 1: Line 1:
-====== #define and #prm (hash prm or hash parameter======+====== #define and #prm (hash prm or hash parameter)======
  
 It's often useful to have optional sections in an INP file to test different models. ​ You can do this by commenting in/out sections of the INP file using ' or /*...*/. It's often useful to have optional sections in an INP file to test different models. ​ You can do this by commenting in/out sections of the INP file using ' or /*...*/.
Line 43: Line 43:
 #endif #endif
 </​code>​ </​code>​
 +
 +With variable temperature or pressure refinements you often want to include different phases for different data sets.  Some of the tricks are in Section 12.2 of the Topas text book.  The snippets below are from an INP file which uses the #list language and includes different phases for different datasets. ​ You can do similar things with e.g. temperature.
 +
 +<code topas>
 +/*series of refinments for mono to ortho with mixed phase region between*/
 +num_runs 54 
 +#list Filename Temperature Time Range_Num ​ {  ​
 + filename.raw 103.66 ​ 1380      1 
 + filename.raw 111.33 ​ 2760      2 
 + filename.raw 119     ​4140 ​     3 
 + ...etc
 + }
 +#prm tempcon = Temperature(Run_Number); ​ /*this lets you do different things for different temperatures*/​
 +#prm range = Range_Num(Run_Number);​ /*this lets you do different things for different ranges*/
 +
 +#if (range <= 33)
 + #prm mono  = 1;
 + #prm orth = 0;
 +#elseif ( And(range >= 34, range <= 41) )
 + #prm mono  = 1;
 + #prm orth = 1;
 +#else
 + #prm mono  = 0;
 + #prm orth = 1;
 +#endif
 +
 +xdd Filename(Run_Number)
 + range Range_Num(Run_Number)  ​
 + #if (mono)
 + (str info for mono)
 + #else
 + (alternative instructions)
 + #endif
 + #if (ortho)
 + (str info for ortho)
 + #else
 + (alternative instructions)
 + #endif
 +</​code>​
 +
 +The forum has a thread on removing phases when their phase fraction falls to low values, including tricks to e.g. set the scale factor to zero if peaks become too broad. ​ See [[http://​topas.dur.ac.uk/​unb/​forum.php?​req=thread&​id=656|forum]].

Personal Tools