I am trying to rewrite the output of "VertexCoordinates" such that instead of a hybrid list of atoms and coordinates that result from using the following input program, I want all coordinates of the SAME atom (e.g. H atoms) listed first, preceded by the total number of H atoms, and then followed by the total number of C atoms before a list of all coordinates of C atoms and so on. This will be used as input to an ELK file.
Import["ExampleData/caffeine.xyz", {{"VertexTypes", "VertexCoordinates"}}]
ExportString[%, {"XYZ", {"VertexTypes", "VertexCoordinates"}}]
Expected output is as follows (pls note that this is not exactly a molecule due to compression)
atoms
3 : nspecies
'H.in' : spfname
5 : natoms; atposl, bfcmt below
0.34100000 0.52900000 0.10100000 0.00000000 0.00000000 0.00000000
0.65900000 0.47100000 0.60100000 0.00000000 0.00000000 0.00000000
0.15900000 0.02900000 0.60100000 0.00000000 0.00000000 0.00000000
0.84100000 0.97100000 0.10100000 0.00000000 0.00000000 0.00000000
0.34700000 0.34800000 0.99500000 0.00000000 0.00000000 0.00000000
'C.in' : spfname
6 : natoms; atposl, bfcmt below
0.48630000 0.11560000 0.04910000 0.00000000 0.00000000 0.00000000
0.51370000 0.88440000 0.54910000 0.00000000 0.00000000 0.00000000
0.01370000 0.61560000 0.54910000 0.00000000 0.00000000 0.00000000
0.98630000 0.38440000 0.04910000 0.00000000 0.00000000 0.00000000
0.44602000 0.30860000 0.10260000 0.00000000 0.00000000 0.00000000
0.55398000 0.69140000 0.60260000 0.00000000 0.00000000 0.00000000
'N.in' : spfname
4 : natoms; atposl, bfcmt below
0.37630000 0.42680000 0.04850000 0.00000000 0.00000000 0.00000000
0.62370000 0.57320000 0.54850000 0.00000000 0.00000000 0.00000000
0.12370000 0.92680000 0.54850000 0.00000000 0.00000000 0.00000000
0.87630000 0.07320000 0.04850000 0.00000000 0.00000000 0.00000000