print("{:40}{:15.6f}".format('Specified activity', activity)) print("{:40}{:15.6f}".format('Probability of move', prob_move)) print("{:40}{:15.6f}".format('Probability of create/destroy', prob_create)) print("{:40}{:15.6f}".format('Potential cutoff distance', r_cut)) print("{:40}{:15.6f}".format('Maximum displacement', dr_max)) # Read in initial configuration n, box, r = read_cnf_atoms(cnf_prefix + inp_tag) print("{:40}{:15d} ".format('Number of particles', n)) print("{:40}{:15.6f}".format('Box length', box)) print("{:40}{:15.6f}".format('Density', n / box**3)) r = r / box # Convert positions to box units r = r - np.rint(r) # Periodic boundaries # Initial energy and overlap check total = potential(box, r_cut, r) assert not total.ovr, 'Overlap in initial configuration' # Initialize arrays for averaging and write column headings m_ratio = 0.0 c_ratio = 0.0 d_ratio = 0.0 run_begin(calc_variables()) for blk in range(1, nblock + 1): # Loop over blocks blk_begin() for stp in range(nstep): # Loop over steps m_try, m_acc = 0, 0
print("{:40}{:15.6f}".format('Maximum displacement', dr_max)) print("{:40}{:15.6f}".format('Maximum volume change', dv_max)) # Read in initial configurations n1, box1, r1 = read_cnf_atoms(cnf1_prefix + inp_tag) n2, box2, r2 = read_cnf_atoms(cnf2_prefix + inp_tag) print("{:40}{:15d}{:15d} ".format('Number of particles', n1, n2)) print("{:40}{:15.6f}{:15.6f}".format('Simulation box length', box1, box2)) print("{:40}{:15.6f}{:15.6f}".format('Density', n1 / box1**3, n2 / box2**3)) r1 = r1 / box1 # Convert positions to box units r2 = r2 / box2 # Convert positions to box units r1 = r1 - np.rint(r1) # Periodic boundaries r2 = r2 - np.rint(r2) # Periodic boundaries # Initial energy and overlap check total1 = potential(box1, r_cut, r1) assert not total1.ovr, 'Overlap in initial configuration 1' total2 = potential(box2, r_cut, r2) assert not total2.ovr, 'Overlap in initial configuration 2' # Initialize arrays for averaging and write column headings m1_ratio = 0.0 m2_ratio = 0.0 x12_ratio = 0.0 x21_ratio = 0.0 v_ratio = 0.0 run_begin(calc_variables()) # Initialize histograms nh = 300 rho_min, rho_max = 0.0, 0.9
print("{:40}{:15.6f}".format('Specified temperature', temperature)) print("{:40}{:15.6f}".format('Specified pressure', pressure)) print("{:40}{:15.6f}".format('Potential cutoff distance', r_cut)) print("{:40}{:15.6f}".format('Maximum displacement', dr_max)) print("{:40}{:15.6f}".format('Maximum box displacement', db_max)) # Read in initial configuration n, box, r = read_cnf_atoms(cnf_prefix + inp_tag) print("{:40}{:15d} ".format('Number of particles', n)) print("{:40}{:15.6f}".format('Box length', box)) print("{:40}{:15.6f}".format('Density', n / box**3)) r = r / box # Convert positions to box units r = r - np.rint(r) # Periodic boundaries # Initial energy and overlap check total = potential(box, r_cut, r) assert not total.ovr, 'Overlap in initial configuration' # Initialize arrays for averaging and write column headings m_ratio = 0.0 v_ratio = 0.0 run_begin(calc_variables()) for blk in range(1, nblock + 1): # Loop over blocks blk_begin() for stp in range(nstep): # Loop over steps moves = 0
print(cnf_prefix + inp_tag + ' file does not exist') all_exist = comm.allreduce(exists, op=MPI.LAND) if not all_exist: print('Exiting: one or more configuration files do not exist') sys.exit() # Read in initial configuration n, box, r = read_cnf_atoms(cnf_prefix + inp_tag) print("{:40}{:15d} ".format('Number of particles', n)) print("{:40}{:15.6f}".format('Box length', box)) print("{:40}{:15.6f}".format('Density', n / box**3)) r = r / box # Convert positions to box units r = r - np.rint(r) # Periodic boundaries # Initial energy and overlap check total = potential(box, r_cut, r) assert not total.ovr, 'Overlap in initial configuration' # Initialize arrays for averaging and write column headings m_ratio = 0.0 x_ratio = 0.0 run_begin(calc_variables()) for blk in range(1, nblock + 1): # Loop over blocks blk_begin() for stp in range(nstep): # Loop over steps moves = 0