# Fortran, C/C++ codes, Mathematica notebooks, Web resources, LaTeX etc.

## Fortran

**EDGECOUNT: A tool for characterizing graphene edge**This is a software tool for determining the type of edge atoms in a honeycomb lattice. The algorithm is based on nearest neighbor counting. For details, please refer to the Comput. Phys. Comm. article. Ranked

**#8**in the*SciVerse ScienceDirect*'s**Top 25 Hottest Articles**in Chemistry for January-March 2011.*Examples*:- Getting the id's of all open-edge atoms of a (8,3) carbon nanotube (tube.xyz), the other edge being H-terminated
`edgecount tube.xyz; awk '/^AC|^ZZ/ {print $5}' edge.xyz | xargs`

- Filter out "dangling" atoms (H's in this case)

`edgecount tube.xyz; awk 'NR>2 && $5>1 {print}' output.xyz`

- Getting the id's of all open-edge atoms of a (8,3) carbon nanotube (tube.xyz), the other edge being H-terminated
**TiReX: Replica exchange molecular dynamics with Tinker**This is a parallel implementation (MPI) of the replica-exchange molecular dynamics algorithm using Tinker 4.2 or 5.0. Ranked

**#14**in the*SciVerse ScienceDirect*'s**Top 25 Hottest Articles**in Chemistry for July-September 2009. Here's a quick patch to (hopefully) make TiReX work with Tinker 6.2. Put the patch file where the tirex.f90 source file is and apply it:`patch -b < tirex.patch`

.**Formation energies of intrinsic point defects in Si**: sipdef.zipSmall project in Fortran90 illustrating simple implementation of the steepest descent algorithm, numerical Hessian calculation, symmetric matrix diagonalization using LAPACK

`dsyev()`

driver routine, etc. You need to download the optimized EDIP Si force field. Geometries can be visualized with V_Sim.**MURFIT: command-line tool for fitting to the Murnaghan's equation of state**: murn.tarThis is a simple Bourne-shell script which allows you to create consistent input and run the MURN program. It is documented in Chapter 1 of The FHIMD Toolkit. User's Manual

**The Epsilon algorithm**: epsilon.f90This is the Fortran90 source code of Appendix A of our article T. Mishonov and E. Penev, Int. J. Mod. Phys. B

**14**, 3831 (2000). It demonstrates the operation of the epsilon algorithm (see also Wynn's Epsilon Method on*mathworld*) for finding the limit of infinite series in case where only limited number of terms are known. Ports available: C++ (S. Klenov), BASIC (R. Weaver).

*Mathematica*

**Graphene flakes**: hexagon.nb (hexagonal flake); rndflake.nb (random flake)The two

*Mathematica*notebooks, part of the EDGECOUNT distribution: the former was used to construct all geometries of hexagonal flakes used in the examples; the latter can be used to cut out a flake with "random"-shaped edge.**LCAO band structure with Mathematica**: bands.nbThis is a

*Mathematica*notebook illustrating some aspects of band structure calculations on the example of a hypothetical two-dimensional metal oxide lattice**Calculation of elastic moduli**: appendix.nbThis is Appendix C of my thesis. The notebook calculates the

*c*_{11}bulk elastic modulus of GaAs; it can be easily customized to calculate any of the elastic moduli and to evaluate corrections according to the scaling hypothesis .

## LAMMPS

**Quick minimizer**: in.qminThis script can take input geometry in XYZ or PDB, etc. formats and do quick minimization using either AIREBO or ReaxFF. Intended for Carbon systems. VMD (w/ TopoTools) is required. The scripts parses itself to extract an embedded VMD script, runs VMD to generate LAMMPS data file through TopoTools functionalities:

`lammps -v p <a|r> -v f <file> < in.qmin`

## Miscellaneous

- Many ways to create...
*graphene* - LAMMPS : in.graphene.lmp This script creates n x m graphene patch (graphene.xyz):

`lammps -v n <integer> -v m <integer> < in.graphene.lmp`

and similar for graphite (AB stacking): in.graphite.lmp - BALSAC : graphene.lat This batch file creates nearly square graphene patch of 200 atoms (graphene.xyz):
- Mathematica : graphene.m (comming soon)

`math < graphene.m`

- VMD : a lazy way..., single cmdline. This should create a 1x1 nm
^{2}graphene patch (graphene.xyz):

`tmp=$(mktemp); echo "package req nanotube; graphene -lx 1 -ly 1 -type zigzag -nlayers 1; [atomselect top all] writexyz graphene.xyz; quit" > $tmp; vmd -dispdev text -e $tmp; rm $tmp`

- From paper, sugar, or just garbage ;-)
- TubeGen Online (select
`Crystal Cell: Planar (unrolled)`

)

## Data Sets/Project Archives

- Complete archives: input/output data, figures, custom software, scripts, documents, etc.