Skip to content

tmbeardsley/wtmd_lfts_gpu

Repository files navigation

wtmd_lfts_gpu

Well-tempered metadynamics applied to Langevin field-theoretic simulations of diblock copolymers on the GPU

See https://www.tbeardsley.com/projects/lfts/wtmd for a detailed discussion of this project.

comp.sh:
An example compile script

Running the program:
./<program_name> <lfts_input_file_name> <bias_input_file_name>
Note: Two input files are required. The first specifies the standard parameters and input fields for a Langevin field-theoretic simulation (L-FTS). The second specifies parameters and input potentials related specifically to performing well-tempered metadynamics (WTMD).

"input":
An example L-FTS input file.

L-FTS Input file format:
Line 1: N NA XN C Ndt isXeN
Line 2: mx my mz Lx Ly Lz
Line 3: n_eq n_st n_smpl loadType
Lines 4->(M+3): W-(r)
Lines (M+4)->(2M+3): w+(r)

Note: A real-space position r = (x,y,z) corresponds to a mesh point position r_m = (i,j,k), where i=0->mx-1, j=0->my-1 and k=0->mz-1 are integers. The elements of the fields, W-(r) and w+(r), are then written in ascending order of the row-major index: p = mx*(i*my+j)+k.

L-FTS parameter descriptions:
N is the number of monomers in a single polymer chain (integer).
NA is the number of monomers in the A-block of a polymer chain (integer).
XN is the interaction strength between A and B-type monomers (double).
C is the square root of the invariant polymerisation index, Nbar (double).
Ndt is the size of the time step in the Langevin update of W-(r) (double).
isXeN instructs the program whether the parameter XN is in terms of bare (isXeN=0) or effective (isXeN=1) chi (integer).
mx, my, mz are the number of mesh points in the x, y, and z dimensions of the simulation box (integers).
Lx, Ly, Lz are the dimensions of the simulation box (in units of the polymer end-to-end length, R0) in the x, y, and z dimensions (doubles).
n_eq is the number of langevin steps performed to equilibrate the system (integer).
n_st is the number of langevin steps performed after equilibration has ended, during which statistics are sampled (integer).
n_smpl is the number of steps between samples being taken in the statistics period (integer).
loadType instructs the program whether to load the W-(r) and w+(r) fields from the proceeding file lines (loadType=1), start from a disordered state (loadType=0) or start from a (300) lamellar phase (loadType=2).

M = (mx*my*mz) is the total number of mesh points, such that the proceeding 2*M lines of the file can hold W-(r) and w+(r) fields to load.

"bias_in":
An example WTMD input file.

WTMD Input file format:
Line 1: ell kc sigma_Psi DT Psi_min mPsi dPsi update_freq read_bias
Lines 2->(mPsi+1): Psi u(Psi) up(Psi) I0(Psi) I1(Psi)

WTMD parameter descriptions:
ell is the constant, l, used in the definition of the order parameter (double).
kc is the wavevector cutoff (constant) in order parameter (double).
sigma_Psi is the width of Gaussians added to the bias potential (double).
DT controls the rate at which the amplitude of Guassians is reduced (double).
Psi_min is the lowest value of Psi for which the bias potential is collected (double).
mPsi is the total number of mesh points covering the range of Psi being investigated (integer).
dPsi is the distance between adjacent mesh points in Psi (double).
update_freq is the number of Langevin steps between updates of the bias potential (integer).
read_bias is a flag indicating whether an initial bias potential should be read from file (read_bias=1) or not (read_bias=0) (integer).

Lines 2->(mPsi+1) are only read if read_bias=1, otherwise the bias potential starts with all elements equal to zero.

Output files:
"w_eq_<step_number>": The state of the W-(r) and w+(r) fields at simulation step number <step_number> during the equilibration period. First three lines are simulation parameters so it can be used as an input file.
"w_st_<step_number>": The state of the W-(r) and w+(r) fields at simulation step number <step_number> during the statistics gathering period. First three lines are simulation parameters so it can be used as an input file.
"phi_eq_<step_number>": The state of the phi-(r) and phi+(r) fields at simulation step number <step_number> during the equilibration period.
"phi_eq_<step_number>": The state of the phi-(r) and phi+(r) fields at simulation step number <step_number> during the statistics gathering period.
"bias_st_<step_number>": Output file in the same format as the WTMD input file, containing the current state of the bias potential after step_number Langevin steps in the statistics gathering phase.