# do the warmup until the particles have at least the distance min_dist min_dist = 0.9 # integration int_steps = 1000 int_n_times = 20 ############################################################# # Setup System # ############################################################# # structure factor file structurefactor_type_list = [0, 1] structurefactor_order = 20 structurefactor_file = open("pylj_liquid_structurefactor.dat", "w") structurefactor_file.write("# k\tS(k)\n") structurefactor_bins = len( system.analysis.structure_factor([0], structurefactor_order)[0]) structurefactor_k = np.zeros(structurefactor_bins) structurefactor_Sk = np.zeros(structurefactor_bins) # Interaction setup ############################################################# system.non_bonded_inter[0, 0].lennard_jones.set_params(epsilon=lj_eps, sigma=lj_sig, cutoff=lj_cut, shift="auto") system.force_cap = lj_cap print("LJ-parameters:")
print("\nSCRIPT--->P3M parameter:\n") p3m_params = p3m.get_params() for key in list(p3m_params.keys()): print("{} = {}".format(key, p3m_params[key])) # elc=electrostatic_extensions.ELC(maxPWerror=1.0,gap_size=1.0) # system.actors.add(elc) print(system.actors) ############################################################# # Warmup Integration # ############################################################# # open Observable file obs_file = open("pylj_liquid.obs", "w") obs_file.write("# Time\tE_tot\tE_kin\tE_pot\n") print(""" Start warmup integration: At maximum {} times {} steps Stop if minimal distance is larger than {} """.strip().format(warm_n_times, warm_steps, min_dist)) # set LJ cap lj_cap = 20 system.force_cap = lj_cap print(system.non_bonded_inter[0, 0].lennard_jones) # Warmup Integration Loop i = 0
int_n_times = 5 ############################################################# # Setup System # ############################################################# # distribution file distr_type_list_a = [0] distr_type_list_b = [1] distr_r_min = 0.1 distr_r_max = box_l / 2.0 distr_r_bins = 200 distr_log_flag = 0 distr_int_flag = 1 distr_file = open("pylj_liquid_distribution.dat", "w") distr_file.write("# r\tdistribution\n") distr_r = np.zeros(distr_r_bins) distr_values = np.zeros(distr_r_bins) # Interaction setup ############################################################# system.non_bonded_inter[0, 0].lennard_jones.set_params(epsilon=lj_eps, sigma=lj_sig, cutoff=lj_cut, shift="auto") system.force_cap = lj_cap print("LJ-parameters:") print(system.non_bonded_inter[0, 0].lennard_jones.get_params())
system.analysis.dist_to(0) print("Simulate {} monovalent salt in a cubic simulation box {} at molar concentration {}." .format(n_part, box_l, mol_dens).strip()) print("Interactions:\n") act_min_dist = system.analysis.min_dist() print("Start with minimal distance {}".format(act_min_dist)) system.cell_system.max_num_cells = 2744 ############################################################# # Warmup Integration # ############################################################# # open Observable file obs_file = open("pydebye_hueckel.obs", "w") obs_file.write("# Time\tE_tot\tE_kin\tE_pot\n") print(""" Start warmup integration: At maximum {} times {} steps Stop if minimal distance is larger than {} """.strip().format(warm_n_times, warm_steps, min_dist)) # set LJ cap lj_cap = 20 system.force_cap = lj_cap print(system.non_bonded_inter[0, 0].lennard_jones) # Warmup Integration Loop i = 0