def initSimulation(cmd): sim = SimFlat(cmd.nSteps, cmd.printRate, cmd.dt) latticeConstant = cmd.lat if cmd.lat < 0.0: latticeConstant = sim.pot.lat box_size = np.zeros(3) box_size[0] = cmd.nx*latticeConstant box_size[1] = cmd.ny*latticeConstant box_size[2] = cmd.nz*latticeConstant sim.domain = domain.Domain(cmd.xproc, cmd.yproc, cmd.zproc, box_size) sim.boxes = linkcell.initLinkCells(sim, sim.domain) sim.atoms = initatoms.initAtoms(sim.boxes.nTotalBoxes * sim.boxes.MAXATOMS) sim.atoms.setBounds(cmd.nx, cmd.ny, cmd.nz, latticeConstant) initatoms.createFccLattice(cmd.nx, cmd.ny, cmd.nz, latticeConstant, sim.atoms, sim.boxes, sim.domain) initatoms.setTemperature(sim, cmd.temp) sim.atomHalo = halo.Halo(sim.boxes, sim.domain) redistributeAtoms(sim, sim.atoms) return sim
def initSimulation(cmd): sim = SimFlat(cmd.nSteps, cmd.printRate, cmd.dt, cmd.skip) latticeConstant = cmd.lat if cmd.lat < 0.0: latticeConstant = sim.pot.lat sim.atoms = initatoms.initAtoms(cmd.nx, cmd.ny, cmd.nz) sim.atoms.setBounds(cmd.nx, cmd.ny, cmd.nz, latticeConstant) initatoms.createFccLattice(cmd.nx, cmd.ny, cmd.nz, latticeConstant, sim.atoms) initatoms.setTemperature(sim, cmd.temp) return sim