MCNPX running scripts

1. Common pitfalls

2. A one-line command...

The function below works for any MCNP file having 0 or 1 mesh tally. If you have more, change it accordingly (see the comment inside the function).
The mesh tally output is an ASCII file à  la Tecplot (x y z tally dtally). See here to plot it in a voxelized way in Root.
The extension of your MCNP file has to be .mcn (Moritz convention).
Copy this function in your ~/.bashrc and source it (source ~/.bashrc).
To execute it (from anywhere), just type: mcnprun myMCNPfile.mcn

----------------------------------------------------------------------------
function mcnprun() { #rm -f *.{out,run,tra,mdata,dat} mcnpx i=$1 o=${1/.mcn/.out} r=${1/.mcn/.run} mdata=${1/.mcn/.mdata} && [ -f ptrac ] && mv ptrac ${1/.mcn/.tra} grep -q "^\ *tmesh" $1 && echo -e "mdata\n${1/.mcn/.mdata}\ny\nn\n1\ntecplot\n${1/.mcn/.dat}\nn\n$1\n3\nn\nn" | gridconv 1>/dev/null # ... \n1\ntecplot ... where 1 refers to the data set number. It just depends on the order of appearance of the mesh, no matter it is a [rcs]mesh for flux or data scoring. chmod a-x * && chmod a+rw * } ----------------------------------------------------------------------------

3. Batch processing

Please see my talk (and feel free to have a look here).

4. Multiprocessing mode

Please see here.


Back to Table of Contents
Copyright: Mathieu Trocmé, Mon 28 Dec 2009 (14:13:46)