Esempio n. 1
0
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")
Esempio n. 2
0
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")
simulation.set_rod_dynamics("nve")