Skip to content

tmbeardsley/clfts_gpu

Repository files navigation

clfts_gpu

Complex Langevin Field-Theoretic Simulation of Diblock Copolymers on the GPU

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

comp.sh:
An example compile script

Running the program:
./<program_name> <input_file_name>

input:
An example input file.

Input file format:
Line 1: N NA XeN zetaN C Ndt
Line 2: mx my mz Lx Ly Lz
Line 3: n_eq n_st n_smpl save_freq
Lines 4->(M+3): REAL[W-(r)] IMAG[W-(r)]
Lines (M+4)->(2M+3): REAL[W+(r)] IMAG[W+(r)]

Notes:
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.
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.

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).
XeN is the interaction strength between A and B-type monomers (double).
zetaN is the compressibility factor, zeta, multiplied by N (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).
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).
save_freq is the number of steps between saving outputs to file.

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_st_<step_number>": The state of the phi-(r) and phi+(r) fields at simulation step number <step_number> during the statistics gathering period.
"Sk_<step_number>": The spherically-averaged structure function at simulation step number <step_number> during the statistics gathering period.