Skip to content

Commit

Permalink
Minor: do not rewrite the parameters file, but just append.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommaso Comparin committed Feb 9, 2018
1 parent 9bd8a1c commit 0659b5f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib_laughlin_metropolis.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,17 @@ def main_laughlin_mc(int N, double m, int Nqh, double [:, :] xqh, double delta,
cdef double [:, :] x = numpy.zeros((N, 2))
cdef double[:, :] xnew = numpy.zeros((N, 2))
if ContinuePreviousRun and os.path.isfile(file_config):
with open(fparams, 'w') as out_params:
with open(fparams, 'a') as out_params:
out_params.write('# Reading initial configuration from %s.\n' % file_config)
x = numpy.loadtxt(file_config)
else:
with open(fparams, 'w') as out_params:
with open(fparams, 'a') as out_params:
out_params.write('# Generating random initial configuration with xmax=%f.' % xmax)
for i_part in xrange(N):
x[i_part, 0] = random.uniform(-xmax, xmax)
x[i_part, 1] = random.uniform(-xmax, xmax)
cdef double betaE = compute_beta_energy(x, N, xqh, Nqh, m), deltabetaE
cdef double betaE = compute_beta_energy(x, N, xqh, Nqh, m)
cdef double deltabetaE

# Monte Carlo loop
for step in xrange(nsteps):
Expand Down

0 comments on commit 0659b5f

Please sign in to comment.