| 143 | == Creating a graphene block with several sheets == |
| 144 | |
| 145 | This part will assume that you already have a file graphene.xyz with a single graphene sheet, all atoms labeled as carbon (C). (You may produce this file by using the vmd molecular viewer extension "Nanotube builder") Furthermore we assume that you wish to create a five-layered graphene block. Each of the sheets will be made of carbon, but distinguished by an index (C1, C2, ...) In order to separate intra- and interlayer interactions. |
| 146 | |
| 147 | First convert the xyz file to a tremolo data file: |
| 148 | |
| 149 | ??? /opt/bin/molecuilder --parse-tremolo-potentials elec.potentials -i graphene_layer.data -o xyz |
| 150 | |
| 151 | |
| 152 | Then create 5 copies of the created data file: |
| 153 | for i in 1 2 3 4 5; do cp graphene.data graphene_C${i}.data; done |
| 154 | |
| 155 | |
| 156 | Within each file rename the carbon atoms to C1, C2, C3, ... |
| 157 | for i in 1 2 3 4 5; do sed -i -e "s#\(\tC\)\t#\1${i}\t#g" graphene_C${i}.data; done |
| 158 | |
| 159 | |
| 160 | Get the boundaries of the current sheet by using this script: |
| 161 | ~/local/bin/GetBoxBounds.pl --file graphene_C1.data --offset 3 |
| 162 | The offset is the index of the first column containing coordinate values. Remember that the script extracts the extreme positions of the particles, so it is a good idea to add some margin for bonds between the periodic images. |
| 163 | |
| 164 | |
| 165 | Finally combine all 5 files into the final data file. |
| 166 | for i in 1 2 3 4 5; do dist=`units "3.4 * $i" | awk -F": " {'print $2'}`; distx=`units "1.22 * $i" | awk -F": " {'print $2'}`;/opt/bin/molecuilder --parse-tremolo-potentials elec.potentials -i graphene_layer.data -o tremolo xyz -B "61.393,0,63.612,0,0,20" -l graphene_C${i}.data --select-molecule-by-order -1 --select-molecules-atoms --translate-atoms "$distx,0,$dist" --periodic 1; done |
| 167 | This little script performs two computations, a shift in x and in z direction, e.g. computing the variable dist: dist=`units "3.4 * $i" | awk -F": " {'print $2'}`, which later can be accessed by $dist. Furthermore, since C1, C2, etc are not known as elements, a tremolo.potentials file is needed to map those shorthands to elements for internal use in molecuilder. Outputs will be created in tremolo and xyz format (-o), periodic shifts (--periodic 1) are computed with correct boxsize (-B), data is read from input files (-i), and molecules from additional loaded files (-l), the last one is selected as one molecule (-select-molecule-by-order -1), all atoms in the molcule are selected --select-molecules-atoms, they are translated x,y,z and output into (-i). |
| 168 | |
| 169 | Now the file graphene_layere.data has been created and can be used in Tremolo-X Simulations. |
| 170 | |
| 171 | |