示例#1
0
}

with open('../example_grand_canonical/metropolis_grand_canonical.json',
          'r') as f:
    input = json.load(f)

cwd = os.getcwd()
proj = Project()

index = 0
for xi in np.arange(-3., 0., 0.1):
    path = 'path.' + str(index)

    tinput = copy.deepcopy(input)
    tinput['driver'] = d
    tinput['driver']['initial_conditions']['param_chem_pot']['a'] = xi
    tinput['driver']['final_conditions']['param_chem_pot']['a'] = xi

    os.mkdir(path)
    os.chdir(path)

    with open('input.json', 'w') as f:
        json.dump(tinput, f)

    stdout, stderr, returncode = proj.command('monte -s input.json')

    print stdout

    os.chdir(cwd)
    index += 1
示例#2
0
  input = json.load(f)

cwd = os.getcwd()
proj = Project()

index = 0
for xi in np.arange(-3.,0.,0.1):
  path = 'path.' + str(index)
  
  tinput = copy.deepcopy(input)
  tinput['driver'] = d
  tinput['driver']['initial_conditions']['param_chem_pot']['a'] = xi
  tinput['driver']['final_conditions']['param_chem_pot']['a'] = xi
  
  os.mkdir(path)
  os.chdir(path)
  
  with open('input.json','w') as f:
    json.dump(tinput, f)
  
  stdout, stderr, returncode = proj.command('monte -s input.json')
  
  print stdout
  
  os.chdir(cwd)
  index += 1




示例#3
0
def monte_cmd(input):
    global proj
    if proj is None:
        proj = Project()
    stdout, stderr, returncode = proj.command('monte -s input.json')
    print stdout