EMC Build Scripting - All Atom Polyethylene

Hello everyone,

I’m trying to build an all atom (pcff force field) model of semicrystalline polyethylene. I’m relatively new to scripting for the EMC executable itself (as opposed to using the setup.pl script), and I was confused by some of the syntax in the example scripts lib/polyethylene.emc (unit cell structure) and build/polymer/polyethylene/build.emc (build script for semicrystalline model).

I’ve been able to successfully build the original opls-ua model using the build script (included in EMC v9.4.2) with the fixes implemented by Pieter in 't Veld. However, I’m unsure how to specify the groups and sites definitions in the polyethylene.emc script to account for the presence of H atoms. Based on section 5 of the user guide, I’ve attempted to partially modify the file (attached below). It seems like the syntax in the example is slightly different than the user guide though, so I’m fairly sure most of my script is nonsense.


build_original.emc (3.4 KB)
polyethylene_original.emc (3.7 KB)
polyethylene_allatom.emc (6.6 KB)

Any insight into how to interpret and modify the original structure and build script would be appreciated. Thanks in advance!

Best,
Kajsa

Dear Kajsa,

The Monte Carlo moves – rebridge, endbridge, reptate, and rotate – used to equilibrate the semi-crystalline polyethylene model currently only allow the use of linear chains without decoration. This means that only united atom force fields can be used (OPLS-UA, TraPPE, or self-defined fields). Direct simulation of all atom force fields such as PCFF is currently not possible. Serious recoding would be needed to allow for decoration. An easier option would be to equilibrate with united atom force fields, followed by adding in hydrogen decoration. This would also need recoding, but it would be not as problematic as adapting the topology altering moves mentioned above.

Best,
Pieter

Dear Pieter,

Thank you explaining the key assumptions of the rebridge, endbridge, reptate, and rotate methods. I hadn’t connected the requirement of linear undecorated chains with the need to use united atom force fields, but it makes sense in retrospect.

That said, I’m mostly working through this example to learn how to build crystalline polymer structures with PCFF. Even being able to generate the crystalline region without the MC simulation to equilibrate the interlamellar part would be hugely helpful. If you could help me understand the syntax for the groups = {} through sites = {} portion of polyethylene.emc file, I would appreciate it.

Specifically, I’m unsure how to specify sites → {} within each group, including the bonds → and connects → keywords. The final sites ={} section that lists each site and the cluster & group it belongs to is also a bit hard to parse for me. I couldn’t find a description of what the connects → {} argument means in section 5.33 of the manual. Is this the same as the {source → int, destination → {index → const, site → int}} syntax in the groups section 5.17?

Apologies for peppering you with such detailed questions and thank you for your help.

build_crystal.emc (1.6 KB)
polyethylene_crystal.emc (6.8 KB)
(I trimmed down the build script to generate only the crystalline phase and tested it with the opls-ua unit cell. The polyethylene.emc file is again an attempt to create an all-atom unit cell for the crystal builder.)

Best,
Kajsa

Dear Kasja,

The best way to look at the polyethylene.emc structure is to consider it as a sort of function, which can be used in conjunction with preset variables – either of which can be provided on the command line or as part of a wrap-around input script (also typically with a .emc extension). EMC operates in two modes:

  1. Script mode in which the first line of .emc reads (* EMC: Script *),
  2. Structural input/output mode in which the first line of .emc reads (* EMC: Enhanced Monte Carlo simulations *); this format is normally used as restart exchange format and gzipped by default.

The easiest way to see the difference between the two modes is to go through the exercise of a simple EMC Setup example (create setup.esh with emc_template.sh chemistry followed by execution of setup.esh). This EMC Setup .esh script generates build.emc by default, which can either be executed manually by emc.sh build.emc, or automatically by adding emc_execute true to the ITEM OPTIONS section.

A group – part of the (* Groups *) section – represents a repeat unit, which defines the chemical environment of a site. This chemical environment in groups is used to determine types during the force field typing process. These resulting types are then transferred to each site in the (* Sites *) section. The (* Clusters *) section maintains the beginning and end site of a cluster (which equals a molecule in atomistic representations). The connects keyword of a site in the (* Sites *) section defines the connectivity of all sites in a cluster. Internally, recursive algorithms are used to determine all member sites of a cluster. The choice for determining member sites recursively stems from Monte Carlo simulations being able to make and break bonds during the simulation. Maintaining continuously altering lists of member sites is thought of being inefficient.

Having said all this, I would suggest using an InsightII unit cell for crystalline polyethylene, which contains connectivity and use this to import a structure using EMC Setup, since direct alteration of EMC Script files tends to be tedious.

A simple EMC Setup .esh could look like

# Options section

ITEM	OPTIONS

replace		true
field		pcff
mass		true
ntotal		2000
density		0.85
expert		true
emc_execute	true

ITEM	END	# OPTIONS

# Variables section

ITEM	VARIABLES	spot=0

nx		4
ny		5
nz		10
nrepeat		10

ITEM	END	# VARIABLES

# Groups section

ITEM	GROUPS

ethylene	*CC*,1,ethylene:2
methyl		*C,1,ethylene:1, 1,ethylene:2

ITEM	END	# GROUPS

# Clusters section

ITEM	CLUSTERS

surface		import, name="ethylene.car", &
		type=surface, percolate=true, formal=false, &
		ncells=nx:ny:nz, field=pcff
polymer		alternate,1

ITEM	END	# CLUSTERS

# Polymers section

ITEM	POLYMERS

polymer
1		ethylene,nrepeat,methyl,2

ITEM	END	# POLYMERS

for which you need the following two input structures

ethylene.car (1.1 KB), and
ethylene.mdf (1.4 KB),

to be installed in the same directory as

setup.esh (830 Bytes).

This creates a crystal with polyethylene molecules parallel to the surface, above which oligomeric amorphous ethylene consisting of 22 carbons is grown. As an aside: please use a fresh version of EMC (uploaded at or after April 16, 2025) since I noticed a mistake in importing InsightII structures.

Best,
Pieter