parser.add_argument( '-t', '--type_offset', type=int, default=0, help= 'the type offset for the rod models of the simulation (for cluster data)') parser.add_argument('-n', '--every', type=int, default=1, help='every which snapshot to analyse (for cluster data') args = parser.parse_args() model = rods.Rod_model(rods.Rod_params().from_file(args.config_file)) for in_file in args.in_files: raw_data = rods_tools.parse_dump_file(in_file) _, _, data_structure, _ = next(raw_data) del raw_data if args.cluster_data: if 'c_micelle_ID' in data_structure: timesteps, box_sizes, cluster_data = rods_tools.clusters.get_cluster_data( rods_tools.parse_dump_file(in_file), 'micelle_ID', args.every, model, args.type_offset) micelle_output_path = os.path.splitext(
if mpi_rank == 0: py_lmp = PyLammps(cmdargs=['-echo', 'both'], comm=mpi_comm, verbose=args.verbose) else: py_lmp = PyLammps(cmdargs=['-echo', 'both'], comm=mpi_comm) py_lmp.log('"' + log_path + '"') rod_params = rods.Rod_params() if mpi_rank == 0: rod_params.from_file(args.cfg_file) rod_params = mpi_comm.bcast(rod_params, root=0) # CREATE BASE OBJECTS model = rods.Rod_model(rod_params) simulation = rods.Simulation(py_lmp, model, run_args.temp, seed, output_folder) py_lmp.units("lj") py_lmp.dimension(3) py_lmp.boundary("p p p") py_lmp.lattice("sc", 1 / (run_args.cell_size**3)) py_lmp.region("box", "block", -run_args.num_cells / 2, run_args.num_cells / 2, -run_args.num_cells / 2, run_args.num_cells / 2, -run_args.num_cells / 2, run_args.num_cells / 2) simulation.setup("box") simulation.create_rods(box=None) # ROD DYNAMICS py_lmp.fix("thermostat", "all", "langevin", run_args.temp, run_args.temp, run_args.damp, seed) #, "zero yes")
parser.add_argument('-c', '--cluster_data', action='store_true', help='produce a "_micelle_data" and/or a "_fibril_data" file for each input file') parser.add_argument('-l', '--last_dump', action='store_true', help='produce a "_last_dump" file, containing the last snapshot, for each input file') parser.add_argument('-m', '--membrane', action='store_true', help='produce an "_adsorbed" file for each input file') parser.add_argument('-t', '--type_offset', type=int, default=0, help='the type offset for the rod models of the simulation (for cluster data)') parser.add_argument('-n', '--every', type=int, default=1, help='every which snapshot to analyse (for cluster data') args = parser.parse_args() model = rods.Rod_model(args.config_file) for in_file in args.in_files: raw_data = rods_tools.parse_dump_file(in_file) _, _, data_structure, _ = next(raw_data) del raw_data if args.cluster_data: if 'c_micelle_ID' in data_structure: timesteps, box_sizes, cluster_data = rods_tools.clusters.get_cluster_data( rods_tools.parse_dump_file(in_file), 'micelle_ID', args.every, model, args.type_offset) micelle_output_path = os.path.splitext(in_file)[0]+"_micelle_data"
log_filename = '{:d}.lammps'.format(seed) log_path = os.path.join(output_folder, log_filename) run_args = rods.rod_model.Params() execfile(args.run_file, { '__builtins__': None, 'True': True, 'False': False, 'None': None }, vars(run_args)) out_freq = args.output_freq if args.output_freq != None else run_args.run_length py_lmp = PyLammps(cmdargs=['-screen', 'none']) py_lmp.log('"' + log_path + '"') model = rods.Rod_model(args.cfg_file) simulation = rods.Simulation(py_lmp, model, seed, output_folder) py_lmp.units("lj") py_lmp.dimension(3) py_lmp.boundary("p p p") py_lmp.lattice("sc", 1 / (run_args.cell_size**3)) py_lmp.region("box", "block", -run_args.num_cells / 2, run_args.num_cells / 2, -run_args.num_cells / 2, run_args.num_cells / 2, -run_args.num_cells / 2, run_args.num_cells / 2) simulation.setup("box") simulation.create_rods(box=None) # DYNAMICS py_lmp.fix("thermostat", "all", "langevin", run_args.temp, run_args.temp, run_args.damp, seed) #, "zero yes")