Configuration Files for htpolynet postsim¶
postsim is a subcommand that provides for convenient post-build MD simulations for annealing, equilibration, and making measurements of properties, like Young’s modulus and glass transition temperature. Its main advantage is that it understands the project file system structure and uses many sensible default values, making it easy to run post-build MD simulations.
A postsim configuration file is written in YAML and structured as a list of dictionaries, each entry of which is a stage which together constitute a sequence of stages. Each stage involves an MD simulation for which you can specify the input coordinates and mdp parameters. Because postsim executes a sequence of stages, the output of one stage can be the input for a later stage.
HTPolyNet recoginizes the following types of post-build MD simulations
Simulation Type |
keyword |
Description |
|---|---|---|
Equilibration |
|
Plain MD in NVT or NPT |
Annealing |
|
Temperature annealing using a low T and a high T and a schedule for cycling between them |
Temperature-ladder |
|
Controlled change in T from one temperature to another over some number of stages of some duration |
Uniaxial deformation |
|
Uniaxial strain at a constant rate in one direction for a specified duration |
Equilibration directives
An
equilibratedirective allows specification of several parameters:Keyword
Description
subdirName of directory in which simulation is conducted relative to the project directory default:
postsim/equilibrateinput_topInput topology file relative to the project directory; default:
systems/final-results/final.topinput_groInput coordinate file relative to the project directory; default:
systems/final-results/final.groinput_grxInput extended atom attribute file relative to the project directory; default:
systems/final-results/final.grxoutput_deffnmdefault gromacs output file basename; default:
equilibratetracesList of trace types to generate output files for
scatterTuple specifying a scatter plot to generate based on the traces
gromacsGromacs directives; see here
TTemperature in K default: 300
PPressure in bar default: 1
psDuration of simulation in picoseconds; default: 1000
A minimal post-build equilibration file for 100 ns at 310 K and 5 bar would contain:
- equilibrate: ps: 100000 T: 310 P: 5
Here, it uses the topology and coordinate files at the end of the build, and runs for 100 ns, with the results in
<proj-dir>/postsim/equilibrate. Notice the-character at the left-most indent level; this indicates that the file is a list of items; the indentation ofps:indicates it that the identifierequilibrateis a keyword whose value is a dictionary.Traces
postsimprovides a shortcut approach to usinggmx energyto extract energy-like quantities from Gromacs energy file (edr). For example, if we would like to extract traces of temperature and density:- equilibrate: ps: 1000 traces: - Temperature - Density
Note we have to list the names of the energy-like quantities exactly how
gmx energyreports them.Scatter plots
postsimalso provides a shortcut interface tomatplotlibto generate simple trace plots of any quantity extracted usingtraces. The single argument of thescatterkeyword is a tuple in which the first element is the name of the x-data (typicallytime(ps)), the second is a list of names of energy-like quantities to trace (e.g.,[Density, Temperature]), and the third element is the name of an output image file to contain the plot.We can add a
scatterdirective thusly- equilibrate: ps: 1000 T: 310 P: 5 traces: - Temperature - Density scatter: - time(ps) - - Density - Temperature - my_plot.png
Running
postsimSuppose we put the YAML shown above into the file
eq.yml. To use this input configuration to launch a new post-build equilibration in the project directoryproj-1, one would issue the commandhtpolynet postsim -cfg eq.yml -proj proj-1 -ocfg <build.cfg>
The
-ocfgkey identifies the YAML config file used for the actual build;postsimextracts some information about the monomer library and other inputs from here; it also uses the Gromacs configuration of the original build config unless overridded in the postsim config.
Annealing
Annealing simulations are useful to help in densifying amorphous systems; the idea is that cycles of heating and cooling help the atoms fall deeper into local potential energy wells. It is usually a good idea to anneal a newly built system before measuring any properties.
An
annealdirective allows specification of several parameters:Keyword
Description
subdirName of directory in which simulation is conducted relative to the project directory default:
postsim/annealinput_topInput topology file relative to the project directory; default:
systems/final-results/final.topinput_groInput coordinate file relative to the project directory; default:
systems/final-results/final.groinput_grxInput extended atom attribute file relative to the project directory; default:
systems/final-results/final.grxoutput_deffnmdefault gromacs output file basename; default:
equilibratetracesList of trace types to generate output files for
scatterTuple specifying a scatter plot to generate based on the traces
gromacsGromacs directives; see here
PPressure (bar)
ncyclesnumber of annealing cycles
T0“low” temperature
T1“high” temperature
T0_to_T1_psduration of T-change simulation for T0 to T1 in ps
T1_psduration of T-hold at T1 in ps
T1_to_T0_psduration of T-change simulaiton for T1 to T0 in ps
T0_psduration of T-hold at T0 in ps (completing a cycle)
An example
annealpostsim directive might look like:- anneal: input_top: 'systems/final-results/final.top' input_gro: 'systems/final-results/final.gro' P: 1 T0: 300 T1: 600 ncycles: 3 T0_to_T1_ps: 10000 T1_ps: 10000 T1_to_T0_ps: 10000 T0_ps: 10000
Temperature ladders
Temperature-ladder simulations are useful in the response of system density to temperature over a wide temperature domain. This can be useful for estimating the coefficient of thermal expansion and the glass transition temperature.
A
ladderdirective allows specification of several parameters:Keyword
Description
subdirName of directory in which simulation is conducted relative to the project directory default:
postsim/annealinput_topInput topology file relative to the project directory; default:
systems/final-results/final.topinput_groInput coordinate file relative to the project directory; default:
systems/final-results/final.groinput_grxInput extended atom attribute file relative to the project directory; default:
systems/final-results/final.grxoutput_deffnmdefault gromacs output file basename; default:
equilibratetracesList of trace types to generate output files for
scatterTuple specifying a scatter plot to generate based on the traces
gromacsGromacs directives; see here
PPressure (bar)
Tlo“low” temperature (K)
Thi“high” temperature (K)
deltaTchange in temperature between subsequent simulations on the ladder
ps_per_riseduration (ps) of T-change simulation beginning a new step on the ladder
ps_per_runduration (ps) of T-hold simulation at each step
warmup_psduration (ps) of a warmup simulation before beginning T-changes
An example
ladderpostsim directive might look like:- ladder: input_top: 'systems/final-results/final.top' input_gro: 'postsim/equilibrate/equilibrate.gro' subdir: 'postsim/ladder-heat' Tlo: 300 Thi: 600 deltaT: 5 ps_per_rise: 100 ps_per_run: 900 warmup_ps: 1000
One can go either up or down a ladder. If
deltaTis specified as a postive number, the initial temperature isTlo. However, ifdeltaTis specified as a negative number, the intial temperature isThiinstead ofTlo. One way I like to use ladders is as one big cycle, measuring thermal response in both directions:- ladder: input_top: 'systems/final-results/final.top' input_gro: 'postsim/equilibrate/equilibrate.gro' subdir: 'postsim/ladder-heat' Tlo: 300 Thi: 600 deltaT: 5 ps_per_rise: 100 ps_per_run: 900 warmup_ps: 1000 - ladder: input_top: 'systems/final-results/final.top' input_gro: 'postsim/ladder-heat/ladder.gro' subdir: 'postsim/ladder-cool' Tlo: 300 Thi: 600 deltaT: -5 ps_per_rise: 100 ps_per_run: 900 warmup_ps: 1000
A measure of how well equilibrated your system is and how carefully you conducted the ladder simulations is agreement between the thermal responses in the T-up and T-down ladders.
By default, a
laddergenerates a trace of both temperature and density from the associatededrfiles. Theplotssubcommand can be used to read these files for a set of equivalent project directories and compute a glass transition temperature.Uniaxial deformation
Constant strain-rate uniaxial deformation MD simulations can be performed using
postsimas well. Such simulations are used to generate stress-strain curves from which moduli are extracted.A
deformdirective allows specification of several parameters:Keyword
Description
subdirName of directory in which simulation is conducted relative to the project directory default:
postsim/annealinput_topInput topology file relative to the project directory; default:
systems/final-results/final.topinput_groInput coordinate file relative to the project directory; default:
systems/final-results/final.groinput_grxInput extended atom attribute file relative to the project directory; default:
systems/final-results/final.grxoutput_deffnmdefault gromacs output file basename; default:
equilibratetracesList of trace types to generate output files for
scatterTuple specifying a scatter plot to generate based on the traces
gromacsGromacs directives; see here
directionDirection along with strain is applied; x, y, or z
edotDimensionless strain rate in ps-1; 0.0001 = 108 s-1
psDuration of the simulation in ps; product of
psandedotgives the strain at the end of the simulation.An example
deformpostsim directive might look like:- deform: input_top: 'systems/final-results/final.top' input_gro: 'postsim/equilibrate/equilibrate.gro' subdir: 'postsim/deform-x' direction: x edot: 0.0001 ps: 1000 # final strain 10%
For isotropic (bulk) systems, the x, y, and z directions are equivalent, and one should measure material response along all three directions. One can use a single input configuration file to stipulate all three such simulations, each starting from a common initial condition:
- deform: input_top: 'systems/final-results/final.top' input_gro: 'postsim/equilibrate/equilibrate.gro' subdir: 'postsim/deform-x' direction: x edot: 0.0001 ps: 1000 # final strain 10% - deform: input_top: 'systems/final-results/final.top' input_gro: 'postsim/equilibrate/equilibrate.gro' subdir: 'postsim/deform-y' direction: y edot: 0.0001 ps: 1000 # final strain 10% - deform: input_top: 'systems/final-results/final.top' input_gro: 'postsim/equilibrate/equilibrate.gro' subdir: 'postsim/deform-z' direction: z edot: 0.0001 ps: 1000 # final strain 10%
By default, a
deformblock generates a traces of normal stress tensor components along the pulling direction and box size along that direction. This allows theplotssubcommand to estimate Young’s modulus.