#Add simulation box and boundary condition. The box size can be updated later if #necessary. config.add_simbox(10.0, 10.0, 10.0, 1) #Molecule details num_mols_A = 60 num_mols_B = 60 mol_t_A = config.add_molecule_type('A', num_mols_A) mol_t_B = config.add_molecule_type('B', num_mols_B) #Total number of atoms in the molecule natm = 1 #Atom types # natm atoms as point particles with mass 1.0 atm_t_a = config.add_atom_type('A', 1, 1.0) atm_t_b = config.add_atom_type('B', 1, 1.0) #Vdw interaction eps = 1.0 sigma = 2.0 rcut = 2.0**(1.0 / 6) * sigma rcut_coul = 0 C = 2.0 config.add_ia_vdw('A', 'A', 5, np.array([eps, sigma, rcut, rcut_coul, C])) config.add_ia_vdw('B', 'B', 5, np.array([eps, sigma, rcut, rcut_coul, C])) config.add_ia_vdw('A', 'B', 5, np.array([eps, sigma, rcut, rcut_coul, C])) #Add atoms, bonds, and angles sep = 1.95 # Must be <= len_bond
#Add simulation box and boundary condition. The box size can be updated later if #necessary. config.add_simbox(40.0, 40.0, 40.0, 0) #Number of backbone atoms na_bbone = 30 #int(sys.argv[1]) #Number of atoms on each side chain na_sc = 4 #int(sys.argv[2]) #Number of atoms between consecutive branch points na_sp = 0 #Number of side chains growing from a branch point f = 1 #Atom types #All atoms are point particles with unit mass atm_t_bb = config.add_atom_type('BB', 1, 1.0) atm_t_sc = config.add_atom_type('SC', 1, 1.0) #Vdw interaction eps = 1.0 sigma = 2.0 rcut = 2.0**(1.0 / 6) * sigma config.add_ia_vdw('BB', 'BB', 1, np.array([eps, sigma, rcut])) config.add_ia_vdw('BB', 'SC', 1, np.array([eps, sigma, rcut])) config.add_ia_vdw('SC', 'SC', 1, np.array([eps, sigma, rcut])) #Bond types bnd_t_bb = config.add_bond_type( 3, np.array([30 * eps / sigma**2, 1.5 * sigma, eps, sigma])) bnd_t_bs = config.add_bond_type( 3, np.array([30 * eps / sigma**2, 1.5 * sigma, eps, sigma]))
import numpy as np from configuration import Configuration from config_io import * #------------------------------------------------------------------------------- config = Configuration() #Add simulation box with PBC. config.add_simbox(30.0, 30.0, 30.0, 1) #The system consists of polymer chains and couterions. #Atom types #Monomer atoms as point particles with mass 1.0 atm_t_m = config.add_atom_type('M', 1, 1.0) #Counterion atoms as point particles with mass 1.0. atm_t_c = config.add_atom_type('C', 1, 1.0) #Bond types #Bonds along the chain. (Kremer-Grest) eps = 1.0 sigma = 2.0 rcut = 2.0**(1.0 / 6) * sigma bnd_t_chn = config.add_bond_type( 3, np.array([30 * eps / sigma**2, 1.5 * sigma, eps, sigma])) #Angle types #Angles along the chain. (Cosine) ang_t_chn = config.add_angle_type(1, np.array([2.0, 1.0]))