GaPFlow.md.moltemplate#

Moltemplate helper functions.

This module contains functions that help setting up the gold/alkane system.

Functions

build_template(args)

config_fluid(file, Lx, Ly, H, density[, ...])

Calculate an initial molecule grid given the box dimensions and adjust the gap height for the initial setup to fit all molecules without overlap.

write_fluid(name, Nf, mol_grid, slab_size, gap)

write_init([preset])

write_mixing()

write_restart(restart_file)

write_run()

write_settings(args)

write_slab([name, shift])

Write the moltemplate input for the two wall slabs

write_solid_data(slabL, slabU[, pair_style, ...])

write_template(args[, template_dir, output_dir])

Generate a moltemplate template file (./moltemplate_files/system.lt).

GaPFlow.md.moltemplate.build_template(args)#
GaPFlow.md.moltemplate.config_fluid(file, Lx, Ly, H, density, buffer=25.0, flat=True)#

Calculate an initial molecule grid given the box dimensions and adjust the gap height for the initial setup to fit all molecules without overlap.

Parameters:
  • file (str) – Molecule topography filename

  • Lx (float) – Box dimension x

  • Ly (float) – Box dimension y

  • H (float) – Target gap height

  • density (float) – Target fluid density

  • buffer (float) – “Safety distance” between the outermost fluid layer and the wall

  • flat (bool) – Flags flat systems in which a slight density correction is applied.

Returns:

  • tuple – Molecule grid

  • int – Number of fluid molecules

  • int – Number of fluid atoms

  • float – Initial gap height

Raises:

RuntimeError – Lateral box size too small for molecule

GaPFlow.md.moltemplate.write_fluid(name, Nf, mol_grid, slab_size, gap, buffer=25.0)#
GaPFlow.md.moltemplate.write_init(preset='TraPPE', **kwargs)#
GaPFlow.md.moltemplate.write_mixing()#
GaPFlow.md.moltemplate.write_restart(restart_file)#
GaPFlow.md.moltemplate.write_run()#
GaPFlow.md.moltemplate.write_settings(args)#
GaPFlow.md.moltemplate.write_slab(name='solid', shift=0.0)#

Write the moltemplate input for the two wall slabs

Parameters:
  • name (str, optional) – The name (the default is ‘solid’)

  • shift (float, optional) – A vertical (z) shift applied to all coordinates (the default is 0.)

GaPFlow.md.moltemplate.write_solid_data(slabL, slabU, pair_style='eam', eps=5.29, sig=2.629)#
GaPFlow.md.moltemplate.write_template(args, template_dir='moltemplate_files', output_dir='moltemplate_files')#

Generate a moltemplate template file (./moltemplate_files/system.lt).

Moltemplate builds LAMMPS input scripts from the definitions in the template.

The general structure of the input file is:

  • Init: units, atom_style, interaction_style, MPI domain partitioning

  • Atom Definition: coordinates, moelcule topographies and pair_coeffs

  • Settings: variable/group/… definitions, computes, thermo settings, …

  • Run: fixes, runs

System agnostic sections may be included, e.g. from the static subdirectory.

Parameters:

args (dict) – Dictionary

Returns:

Number of MPI processes for MD run

Return type:

int