I plan to use memc2 to generate a sample of likely structures at a given temperature and composition. Based upon my tests, the snapshot output routines include only "active" lattice sites, where "active" denotes a site capable of hosting more than one species. Before I hack together a solution to re-insert lattice sites that only host a single species, I’m wondering if this has been done before, if I’m missing something, or if there exists an elegant solution (that doesn’t involve grep and friends).
You could use cellcvrt with the -uss option to generate a supercell of a structure containing only the inactive sites. And then paste the active sites from Monte Carlo and the inactive sites from above.
Of course, that solution would still involve some text manipulation commands, something like:
Thank you. For posterity, below is the helper script I created, which is easily modified for various sorting preferences.
#!/usr/bin/bash
# Fill in a MC snapshot with spectator atoms.
usage="$0 mcsnapshot"
if [ $# -ne 1 ]; then
echo $usage
exit 1
fi
mcsnapshot="$1"
dir=$(dirname "$mcsnapshot")
# Create a file describing the supercell lattice.
head -n6 "$mcsnapshot" | tail -n3 > _supercell
# Create a lat.in file with only spectator atoms.
grep -v ',' < "$dir/lat.in" > _lat.in
# Output coordinate system and lattice.
head -n6 "$mcsnapshot"
# Output all species coordinates
(
tail -n+7 "$mcsnapshot";
cellcvrt -uss=_supercell < _lat.in | tail -n+7;
)
| sort -k4
rm _supercell
rm _lat.in