Deposit Commandline Usage

Setup

To allow for commandline execution export the Nanomatch directory and source the parameterizer config file:

export NANOMATCH=/path/to/your/nanomatch
export NANOVER=V2
source $NANOMATCH/$NANOVER/config/deposit.config

As a side note it is very much advised to export the NANOMATCH directory and NANOVER in your .bashrc file and source the config file during the batch job.

General remarks

Deposit contains lots of parameters, many of which can be left at their default. To see all available parameters invoke Deposit without any arguments:

Deposit.py

Deposition of heterogeneous thin-film morphologies

The deposition of heterogeneous thin-film morphologies can mostly be started with standard parameters. Please provide two input files and one mixing ratio for each component of the simulation:

Deposit.py  molecule.0.pdb=phenantrene.pdb molecule.0.spf=phenantrene.spf molecule.0.conc=1.0 \
               molecule.1.pdb=succino.pdb molecule.1.spf=succino.spf molecule.1.conc=1.0 \
               simparams.sa.cycles=30 simparams.sa.steps=4000 \
               Box.Lx=25 Box.Ly=25 Box.Lz=80 Box.pbc_cutoff=25.0 \
               simparams.Nmol=500 simparams.PBC=True \
               machineparams.ncpu=30

Box parameters are the half box size (i.e. the box will be 50 Angströms wide, if Lx == 25). If one of the molecules has a parametrized dihedral forcefield and the dihedrals should be flexible, also specify

simparams.moves.dihedralmoves=True

Deposition of separated crystalline-amorphous and amorphous-amorphous phases

Preparation of Input files

To deposit amorphous-amorphous and amorphous-crystalline structures a merged input file is required from the CGMC tool. CGMC usually outputs one xyz file per component, for example:

end_all_component_0.xyz  and
end_all_component_1.xyz

Furthermore you will need an estimate for the mean size of one CG cell, estimated for example using the mean volume of a molecule.

To merge the files call

$DEPOSIT_PATH/Tools/convert_cgmc_to_unified.sh --spacing 6 --phase1 end_all_component_0.xyz --phase2 end_all_component_1.xyz

Remark: The option --crystal is gone and does not need to be specified anymore. A single file phase_field_grid.xyz will be generated, which has to be put into the deposition directory.

Estimation of the chemical potential

Do a small heterogeneous deposition without any crystalline or dynamic flags: Example:

Deposit.py  molecule.0.pdb=phenantrene.pdb molecule.0.spf=phenantrene.spf molecule.0.conc=1.0 \
               molecule.1.pdb=succino.pdb molecule.1.spf=succino.spf molecule.1.conc=1.0 \
               simparams.sa.cycles=30 simparams.sa.steps=15000 \
               Box.Lx=25 Box.Ly=25 Box.Lz=80 Box.pbc_cutoff=25.0 \
               simparams.Nmol=500 simparams.PBC=True \
               machineparams.ncpu=30

To estimate the chemical potential, run

$DEPOSIT3_PATH/Tools/estimate_chempot.py

inside the folder of the deposition.

Output

Mol LIG had an average total energy of: -26.5576
Mol AAA had an average total energy of: -15.7221
LIG, AAA, AAB are named as in the .pdb.gz files

Starting the amorphous-amorphous deposition

Besides the usual heterogenous mixture command from Deposit the following new commands were added:

  • codeposit.enabled=True : This enables the read-in of the phase_field_grid to generate phase-separated morphologies.
  • codeposit.contains_crystal=False : This is required for amorphous-amorphous mixtures. If it is enabled, Deposit expects another file containing information about the crystalline molecules
  • codeposit.mu0=XXX and codeposit.mu1=YYY : These set the chemical potential for the respective molecules. mu0 and mu1 should be set according to the values obtained in the previous step. The lower (more negative) of those values will align the energy levels at 0.
  • the size of the simulation box needs to be defined with respect to the dimensions of the previously created phase_field_grid file to enable good periodicity in x- and y-direction. The total size for the x and y direction (Box.Lx, Box.Ly are half the size of the simulation box) should match the size of the phase-field grid (2. and 3. row of phase_field_grid) multiplied with the used spacing factor (6 was used in this example). E.g. if your phasefield grid is 12x12 nm in x and y direction and your spacing factor is 8, then set Lx=Ly=12*8/2.0=48 in Deposit. Please note that the phase-field grid will be centered in x-y-direction (e.g. instead of going from 0 to 12 nm, it will match the Deposit-standard going from -6 to 6). In z direction the Box should be larger than the maximum value of the phase field grid (4. row of phase_field_grid) multiplied with the used spacing factor. The maximum values of phase_field_grid can be determined using this command as an example ($column = 2,3,4 ):
    awk 'BEGIN{max=0}{if(($column)>max) max=($column)}END {print max}' phase_field_grid

A full command could be:

Deposit.py molecule.0.pdb=phenantrene.pdb molecule.0.spf=phenantrene.spf molecule.0.conc=1.0 molecule.1.pdb=succino.pdb molecule.1.spf=succino.spf molecule.1.conc=1.0 simparams.sa.cycles=32 simparams.sa.steps=15000 Box.Lx=25 Box.Ly=25 Box.Lz=80 Box.pbc_cutoff=10.0 dynamic.dodynamic=False simparams.Nmol=5000 simparams.PBC=True codeposit.enabled=True codeposit.contains_crystal=False simparams.PBC=True machineparams.ncpu=32  codeposit.mu0=26.5576 codeposit.mu1=15.7221

Deposition of separated crystalline-amorphous phases

Preparing the crystal template

In addition to the files and information above a perfect crystal representation of the molecules is required. The underlying crystal does not actually have to be crystalline - two crystal directions in the same file are possible, too. The crystal will be overlayed with the phasefield grid and crystal molecules, which do not overlap with the species with id 0 will be deleted. To generate the required file: 1.) Prepare the crystal as separated pdbs in a directory.

One unsupported way to generate the crystal morphology is using gdis and fragmentizer. Use gdis to create sufficient periodic copies of a CIF file and save it as xyz, then:

fragmentizer --input-file c60.xyz --output-file ignore.mol2

Output: Separated CMLs of complete molecules, One file called deposited_0.mol2 This file has the same ordering as all molecules in the crystal and can be used for Deposit input generation

Conversion of all files into pdb.gz:

for file in *.cml; do babel $file ${file%.cml}.pdb; done
# Convert pdb HETATM to ATOM records and delete existing Bonds (sometimes babel can be very slow otherwise):
for file in deposited_*.pdb; do sed -i ´s/HETATM/ATOM  /g;/CONECT/d´ $file; done
gzip *.pdb
rm *.cml; rm ignore.mol2;

2.) Call $DEPOSIT_PATH/Tools/babel_merge_molecules to generate a new xyzv file 3.) Afterwards you can call: rm *.pdb.gz 4.) Two important files remain: deposited_0.mol2 and crystal_molecules.xyzw It is very important that the order of the atoms in the crystal molecules and the atoms in the deposit pdb is the same everywhere.

Starting a simulation

Start the simulation just like the amorphous amorphous phase. Set the concentration of the first phase to 0.0 if you do not want extra crystalline molecules in the amorphous phase. One example might be:

Deposit.py molecule.0.pdb=phenantrene.pdb molecule.0.spf=phenantrene.spf molecule.0.conc=0.0 \
              molecule.1.pdb=succino.pdb molecule.1.spf=succino.spf molecule.1.conc=100.0 \
              simparams.sa.cycles=30 simparams.sa.steps=15000 Box.Lx=30 Box.Ly=30 Box.Lz=100 \
              Box.pbc_cutoff=25.0 dynamic.dodynamic=False simparams.Nmol=2000 \
              simparams.PBC=True codeposit.enabled=True codeposit.contains_crystal=True \
              machineparams.ncpu=30  codeposit.mu1=15.646 codeposit.mu0=26.7821 

The results of the search are