calphy 1.3.11__py3-none-any.whl → 1.4.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- calphy/__init__.py +1 -1
- calphy/alchemy.py +66 -8
- calphy/clitools.py +6 -0
- calphy/composition_transformation.py +63 -9
- calphy/helpers.py +6 -2
- calphy/input.py +478 -245
- calphy/kernel.py +3 -1
- calphy/liquid.py +199 -118
- calphy/phase.py +815 -378
- calphy/phase_diagram.py +500 -26
- calphy/postprocessing.py +274 -5
- calphy/routines.py +13 -2
- calphy/scheduler.py +2 -0
- calphy/solid.py +35 -0
- {calphy-1.3.11.dist-info → calphy-1.4.2.dist-info}/METADATA +14 -2
- calphy-1.4.2.dist-info/RECORD +25 -0
- {calphy-1.3.11.dist-info → calphy-1.4.2.dist-info}/WHEEL +1 -1
- {calphy-1.3.11.dist-info → calphy-1.4.2.dist-info}/entry_points.txt +1 -0
- calphy-1.3.11.dist-info/RECORD +0 -25
- {calphy-1.3.11.dist-info → calphy-1.4.2.dist-info/licenses}/LICENSE +0 -0
- {calphy-1.3.11.dist-info → calphy-1.4.2.dist-info}/top_level.txt +0 -0
calphy/postprocessing.py
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import numpy as np
|
|
3
3
|
import yaml
|
|
4
|
+
import matplotlib.pyplot as plt
|
|
5
|
+
import warnings
|
|
6
|
+
import pandas as pd
|
|
4
7
|
|
|
5
8
|
def read_report(folder):
|
|
6
9
|
"""
|
|
@@ -38,7 +41,8 @@ def _extract_error(errfile):
|
|
|
38
41
|
pass
|
|
39
42
|
return error_code
|
|
40
43
|
|
|
41
|
-
def gather_results(mainfolder
|
|
44
|
+
def gather_results(mainfolder, reduce_composition=True,
|
|
45
|
+
extract_phase_prefix=False):
|
|
42
46
|
"""
|
|
43
47
|
Gather results from all subfolders in a given folder into a Pandas DataFrame
|
|
44
48
|
|
|
@@ -47,6 +51,14 @@ def gather_results(mainfolder):
|
|
|
47
51
|
mainfolder: string
|
|
48
52
|
folder where calculations are stored
|
|
49
53
|
|
|
54
|
+
reduce_composition: bool
|
|
55
|
+
If True, per species composition arrays are added.
|
|
56
|
+
Might be redundant.
|
|
57
|
+
|
|
58
|
+
extract_phase_prefix: bool
|
|
59
|
+
Should be used in conjuction with phase diagram mode.
|
|
60
|
+
Extracts the prefix and add it as a phase_name column.
|
|
61
|
+
|
|
50
62
|
Returns
|
|
51
63
|
-------
|
|
52
64
|
df: pandas DataFrame
|
|
@@ -56,9 +68,10 @@ def gather_results(mainfolder):
|
|
|
56
68
|
import pandas as pd
|
|
57
69
|
except ImportError:
|
|
58
70
|
raise ImportError('Please install pandas to use this function')
|
|
59
|
-
|
|
71
|
+
|
|
72
|
+
unique_elements = []
|
|
60
73
|
datadict = {}
|
|
61
|
-
datadict['
|
|
74
|
+
datadict['calculation_mode'] = []
|
|
62
75
|
datadict['status'] = []
|
|
63
76
|
datadict['temperature'] = []
|
|
64
77
|
datadict['pressure'] = []
|
|
@@ -67,6 +80,9 @@ def gather_results(mainfolder):
|
|
|
67
80
|
datadict['error_code'] = []
|
|
68
81
|
datadict['composition'] = []
|
|
69
82
|
datadict['calculation'] = []
|
|
83
|
+
datadict['ideal_entropy'] = []
|
|
84
|
+
datadict['phase_name'] = []
|
|
85
|
+
datadict['reference_composition'] = []
|
|
70
86
|
|
|
71
87
|
folders = next(os.walk(mainfolder))[1]
|
|
72
88
|
for folder in folders:
|
|
@@ -88,11 +104,14 @@ def gather_results(mainfolder):
|
|
|
88
104
|
inp = inp['calculations'][0]
|
|
89
105
|
#mode
|
|
90
106
|
mode = inp['mode']
|
|
91
|
-
datadict['
|
|
107
|
+
datadict['calculation_mode'].append(mode)
|
|
92
108
|
datadict['temperature'].append(inp['temperature'])
|
|
93
109
|
datadict['pressure'].append(inp['pressure'])
|
|
94
110
|
datadict['reference_phase'].append(inp['reference_phase'])
|
|
111
|
+
datadict['phase_name'].append(inp['phase_name'])
|
|
112
|
+
datadict['reference_composition'].append(inp['reference_composition'])
|
|
95
113
|
datadict['composition'].append(None)
|
|
114
|
+
datadict['ideal_entropy'].append(0)
|
|
96
115
|
datadict['calculation'].append(folder)
|
|
97
116
|
|
|
98
117
|
#check output file
|
|
@@ -130,6 +149,15 @@ def gather_results(mainfolder):
|
|
|
130
149
|
for key, val in compdict.items():
|
|
131
150
|
compdict[key] = val/maxatoms
|
|
132
151
|
datadict['composition'][-1] = compdict
|
|
152
|
+
el_arr = list(compdict.keys())
|
|
153
|
+
|
|
154
|
+
#we also need to update entropy
|
|
155
|
+
if 'entropy_contribution' in out['results'].keys():
|
|
156
|
+
datadict['ideal_entropy'][-1] = -1*out['results']['entropy_contribution']
|
|
157
|
+
|
|
158
|
+
for el in el_arr:
|
|
159
|
+
if el not in unique_elements:
|
|
160
|
+
unique_elements.append(el)
|
|
133
161
|
|
|
134
162
|
#parse extra info
|
|
135
163
|
if mode in ['ts', 'tscale']:
|
|
@@ -144,5 +172,246 @@ def gather_results(mainfolder):
|
|
|
144
172
|
errfile = os.path.join(os.getcwd(), mainfolder, folder+'.sub.err')
|
|
145
173
|
datadict['error_code'][-1] = _extract_error(errfile)
|
|
146
174
|
|
|
175
|
+
if reduce_composition:
|
|
176
|
+
unique_element_dict = {x: [] for x in unique_elements}
|
|
177
|
+
for x in datadict['composition']:
|
|
178
|
+
if x is None:
|
|
179
|
+
for key in unique_element_dict.keys():
|
|
180
|
+
unique_element_dict[key].append(0)
|
|
181
|
+
else:
|
|
182
|
+
for el in unique_elements:
|
|
183
|
+
if el in x.keys():
|
|
184
|
+
unique_element_dict[el].append(x[el])
|
|
185
|
+
else:
|
|
186
|
+
unique_element_dict[el].append(0)
|
|
187
|
+
#add the keys to datadict
|
|
188
|
+
for key, val in unique_element_dict.items():
|
|
189
|
+
datadict[key] = val
|
|
190
|
+
|
|
191
|
+
if not extract_phase_prefix:
|
|
192
|
+
del datadict['phase_name']
|
|
193
|
+
|
|
147
194
|
df = pd.DataFrame(data=datadict)
|
|
148
|
-
return df
|
|
195
|
+
return df
|
|
196
|
+
|
|
197
|
+
def _entropy(compC, comp_init=[1, 0]):
|
|
198
|
+
"""
|
|
199
|
+
l1: initial concentration [Au, Cu]
|
|
200
|
+
l2: final concentration [Au, Cu]
|
|
201
|
+
"""
|
|
202
|
+
compA = 1 - compC
|
|
203
|
+
def _log(val):
|
|
204
|
+
if val == 0:
|
|
205
|
+
return 0
|
|
206
|
+
else:
|
|
207
|
+
return np.log(val)
|
|
208
|
+
dA = compA*_log(compA) - comp_init[0]*_log(comp_init[0])
|
|
209
|
+
dC = compC*_log(compC) - comp_init[1]*_log(comp_init[1])
|
|
210
|
+
return kb*(dA+dC)
|
|
211
|
+
|
|
212
|
+
def clean_df(df, reference_element, combine_direct_calculations=False, fit_order=0):
|
|
213
|
+
"""
|
|
214
|
+
Clean a parsed dataframe and drop unnecessary columns. This gets it ready for further processing
|
|
215
|
+
Note that `gather_results` should be run with `reduce_composition` and `extract_phase_name` for this to work.
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
Parameters
|
|
219
|
+
----------
|
|
220
|
+
df: DataFrame
|
|
221
|
+
dataframe parsed by `gather_results` with `reduce_composition=True`.
|
|
222
|
+
|
|
223
|
+
reference_element: str
|
|
224
|
+
reference element from the compositions, which will be renamed to `composition`
|
|
225
|
+
|
|
226
|
+
combine_direct_calculations: bool, optional
|
|
227
|
+
If True, combine direct calculations by fitting to produce temperature and free energy arrays
|
|
228
|
+
If used, an extra column `error` with mean square error of the fitting is also created
|
|
229
|
+
|
|
230
|
+
fit_order: int, optional
|
|
231
|
+
If `combine_direct_calculations` is used, this argument is used for fitting order.
|
|
232
|
+
|
|
233
|
+
Returns
|
|
234
|
+
-------
|
|
235
|
+
df: DataFrame
|
|
236
|
+
combined, finished DataFrame
|
|
237
|
+
"""
|
|
238
|
+
|
|
239
|
+
if "phase_name" not in df.keys():
|
|
240
|
+
raise ValueError("phase_name key is not found, maybe add it?")
|
|
241
|
+
|
|
242
|
+
df = df.loc[df.status=='True']
|
|
243
|
+
df = df.drop(labels=['status', 'pressure', 'reference_phase',
|
|
244
|
+
'error_code', 'composition', 'calculation'], axis='columns')
|
|
245
|
+
|
|
246
|
+
phases = df.groupby(df.phase_name)
|
|
247
|
+
phases = [phases.get_group(x) for x in phases.groups]
|
|
248
|
+
|
|
249
|
+
df_dict = {}
|
|
250
|
+
|
|
251
|
+
for phase in phases:
|
|
252
|
+
if combine_direct_calculations:
|
|
253
|
+
gb = phase.groupby(by=reference_element)
|
|
254
|
+
gbs = [gb.get_group(x) for x in gb.groups]
|
|
255
|
+
|
|
256
|
+
fes = []
|
|
257
|
+
tes = []
|
|
258
|
+
errors = []
|
|
259
|
+
comps = []
|
|
260
|
+
mode_list = []
|
|
261
|
+
entropies = []
|
|
262
|
+
is_refs = []
|
|
263
|
+
|
|
264
|
+
for exdf in gbs:
|
|
265
|
+
temps = np.array(exdf.temperature.values)
|
|
266
|
+
fe = np.array(exdf.free_energy.values)
|
|
267
|
+
modes = np.array(exdf.calculation_mode.values)
|
|
268
|
+
entropy = np.array(exdf.ideal_entropy.values)
|
|
269
|
+
comp_ref = np.array(exdf.reference_composition.values)
|
|
270
|
+
|
|
271
|
+
unique_modes = np.unique(modes)
|
|
272
|
+
if len(unique_modes)>1:
|
|
273
|
+
warnings.warn("mixing calculations from more than one mode!")
|
|
274
|
+
unique_mode = unique_modes[0]
|
|
275
|
+
|
|
276
|
+
#REMEMBER TO SORT EVERYTHING
|
|
277
|
+
args = np.argsort(temps)
|
|
278
|
+
temps = temps[args]
|
|
279
|
+
fe = fe[args]
|
|
280
|
+
#entropy = entropy[args]
|
|
281
|
+
#print(fe, entropy)
|
|
282
|
+
#print(len(fe), len(entropy))
|
|
283
|
+
|
|
284
|
+
if fit_order > 0:
|
|
285
|
+
fit = np.polyfit(temps, fe, fit_order)
|
|
286
|
+
temp_arr = np.arange(temps.min(), temps.max()+1, 1)
|
|
287
|
+
|
|
288
|
+
#estimate error
|
|
289
|
+
fe_eval = np.polyval(fit, temps)
|
|
290
|
+
error = np.sum((fe_eval-fe)**2)
|
|
291
|
+
|
|
292
|
+
fe_arr = np.polyval(fit, temp_arr)
|
|
293
|
+
else:
|
|
294
|
+
fe_arr = fe
|
|
295
|
+
temp_arr = temps
|
|
296
|
+
error = 0
|
|
297
|
+
|
|
298
|
+
fes.append(fe_arr)
|
|
299
|
+
tes.append(temp_arr)
|
|
300
|
+
errors.append(error)
|
|
301
|
+
entropies.append(entropy[0])
|
|
302
|
+
comps.append(float(exdf[reference_element].values[0]))
|
|
303
|
+
is_refs.append(np.abs(float(exdf[reference_element].values[0])-comp_ref[0])<1E-5)
|
|
304
|
+
|
|
305
|
+
mode_list.append(unique_mode)
|
|
306
|
+
|
|
307
|
+
#replace df
|
|
308
|
+
df = pd.DataFrame(data={'temperature':tes, 'free_energy': fes,
|
|
309
|
+
'error':errors, reference_element:comps, 'ideal_entropy': entropies,
|
|
310
|
+
'calculation_mode': mode_list, "is_reference":is_refs})
|
|
311
|
+
|
|
312
|
+
df = df.rename(columns={reference_element:'composition'})
|
|
313
|
+
df_dict[phase.phase_name.values[0]] = df
|
|
314
|
+
return df_dict
|
|
315
|
+
|
|
316
|
+
def fix_composition_scaling(dfdict, fit_order=4, correct_entropy=True, add_ideal_entropy=False):
|
|
317
|
+
#NOTE: at the moment, the temperature ranges have to be same! but that should be fixed with fitting
|
|
318
|
+
#there could be calculations that failed, no?
|
|
319
|
+
#lets just fit, maybe a 2d?
|
|
320
|
+
for key, val in dfdict.items():
|
|
321
|
+
x=val
|
|
322
|
+
ref_fe = x.loc[x.is_reference==True].free_energy.values[0]
|
|
323
|
+
ref_temp = x.loc[x.is_reference==True].temperature.values[0]
|
|
324
|
+
ref_fe_fit = np.polyfit(ref_temp, ref_fe, fit_order)
|
|
325
|
+
|
|
326
|
+
for index, row in x.iterrows():
|
|
327
|
+
if (not row.is_reference) and (row.calculation_mode == 'composition_scaling'):
|
|
328
|
+
if correct_entropy:
|
|
329
|
+
#note that we need a factor of 2, because the first one is directly coming in from the equations
|
|
330
|
+
if add_ideal_entropy:
|
|
331
|
+
x.at[index, 'free_energy'] = row.free_energy - row.temperature*row.ideal_entropy + np.polyval(ref_fe_fit, row.temperature)
|
|
332
|
+
else:
|
|
333
|
+
x.at[index, 'free_energy'] = row.free_energy - row.temperature*row.ideal_entropy + np.polyval(ref_fe_fit, row.temperature)
|
|
334
|
+
else:
|
|
335
|
+
x.at[index, 'free_energy'] = row.free_energy + np.polyval(ref_fe_fit, row.temperature)
|
|
336
|
+
#x.at[index, 'free_energy'] = row.free_energy + np.polyval(ref_fe_fit, row.temperature)
|
|
337
|
+
dfdict[key] = x
|
|
338
|
+
return dfdict
|
|
339
|
+
|
|
340
|
+
def find_transition_temperature(folder1, folder2, fit_order=4, plot=True):
|
|
341
|
+
"""
|
|
342
|
+
Find transition temperature where free energy of two phases are equal.
|
|
343
|
+
|
|
344
|
+
Parameters
|
|
345
|
+
----------
|
|
346
|
+
folder1: string
|
|
347
|
+
directory with temperature scale calculation
|
|
348
|
+
|
|
349
|
+
folder2: string
|
|
350
|
+
directory with temperature scale calculation
|
|
351
|
+
|
|
352
|
+
fit_order: int, optional
|
|
353
|
+
default 4. Order for polynomial fit of temperature vs free energy
|
|
354
|
+
|
|
355
|
+
plot: bool, optional
|
|
356
|
+
default True. Plot the results.
|
|
357
|
+
"""
|
|
358
|
+
file1 = os.path.join(folder1, 'temperature_sweep.dat')
|
|
359
|
+
file2 = os.path.join(folder2, 'temperature_sweep.dat')
|
|
360
|
+
if not os.path.exists(file1):
|
|
361
|
+
raise FileNotFoundError(f'{file1} does not exist')
|
|
362
|
+
if not os.path.exists(file2):
|
|
363
|
+
raise FileNotFoundError(f'{file2} does not exist')
|
|
364
|
+
|
|
365
|
+
t1, f1 = np.loadtxt(file1, unpack=True, usecols=(0,1))
|
|
366
|
+
t2, f2 = np.loadtxt(file2, unpack=True, usecols=(0,1))
|
|
367
|
+
|
|
368
|
+
#do some fitting to determine temps
|
|
369
|
+
t1min = np.min(t1)
|
|
370
|
+
t2min = np.min(t2)
|
|
371
|
+
t1max = np.max(t1)
|
|
372
|
+
t2max = np.max(t2)
|
|
373
|
+
|
|
374
|
+
tmin = np.min([t1min, t2min])
|
|
375
|
+
tmax = np.max([t1max, t2max])
|
|
376
|
+
|
|
377
|
+
#warn about extrapolation
|
|
378
|
+
if not t1min == t2min:
|
|
379
|
+
warnings.warn(f'free energy is being extrapolated!')
|
|
380
|
+
if not t1max == t2max:
|
|
381
|
+
warnings.warn(f'free energy is being extrapolated!')
|
|
382
|
+
|
|
383
|
+
#now fit
|
|
384
|
+
f1fit = np.polyfit(t1, f1, fit_order)
|
|
385
|
+
f2fit = np.polyfit(t2, f2, fit_order)
|
|
386
|
+
|
|
387
|
+
#reevaluate over the new range
|
|
388
|
+
fit_t = np.arange(tmin, tmax+1, 1)
|
|
389
|
+
fit_f1 = np.polyval(f1fit, fit_t)
|
|
390
|
+
fit_f2 = np.polyval(f2fit, fit_t)
|
|
391
|
+
|
|
392
|
+
#now evaluate the intersection temp
|
|
393
|
+
arg = np.argsort(np.abs(fit_f1-fit_f2))[0]
|
|
394
|
+
transition_temp = fit_t[arg]
|
|
395
|
+
|
|
396
|
+
#warn if the temperature is shady
|
|
397
|
+
if np.abs(transition_temp-tmin) < 1E-3:
|
|
398
|
+
warnings.warn('It is likely there is no intersection of free energies')
|
|
399
|
+
elif np.abs(transition_temp-tmax) < 1E-3:
|
|
400
|
+
warnings.warn('It is likely there is no intersection of free energies')
|
|
401
|
+
|
|
402
|
+
#plot
|
|
403
|
+
if plot:
|
|
404
|
+
c1lo = '#ef9a9a'
|
|
405
|
+
c1hi = '#b71c1c'
|
|
406
|
+
c2lo = '#90caf9'
|
|
407
|
+
c2hi = '#0d47a1'
|
|
408
|
+
|
|
409
|
+
plt.plot(fit_t, fit_f1, color=c1lo, label=f'{folder1} fit')
|
|
410
|
+
plt.plot(fit_t, fit_f2, color=c2lo, label=f'{folder2} fit')
|
|
411
|
+
plt.plot(t1, f1, color=c1hi, label=folder1, ls='dashed')
|
|
412
|
+
plt.plot(t2, f2, color=c2hi, label=folder2, ls='dashed')
|
|
413
|
+
plt.axvline(transition_temp, ls='dashed', c='#37474f')
|
|
414
|
+
plt.ylabel('Free energy (eV/atom)')
|
|
415
|
+
plt.xlabel('Temperature (K)')
|
|
416
|
+
plt.legend(frameon=False)
|
|
417
|
+
return transition_temp
|
calphy/routines.py
CHANGED
|
@@ -338,6 +338,7 @@ def routine_fe(job):
|
|
|
338
338
|
|
|
339
339
|
job.thermodynamic_integration()
|
|
340
340
|
job.submit_report()
|
|
341
|
+
job.clean_up()
|
|
341
342
|
return job
|
|
342
343
|
|
|
343
344
|
def routine_ts(job):
|
|
@@ -354,6 +355,7 @@ def routine_ts(job):
|
|
|
354
355
|
job.logger.info("TS integration cycle %d finished in %f s"%(i+1, te))
|
|
355
356
|
|
|
356
357
|
job.integrate_reversible_scaling(scale_energy=True)
|
|
358
|
+
job.clean_up()
|
|
357
359
|
return job
|
|
358
360
|
|
|
359
361
|
|
|
@@ -387,6 +389,7 @@ def routine_tscale(job):
|
|
|
387
389
|
job.logger.info("Temperature scaling cycle %d finished in %f s"%(i+1, te))
|
|
388
390
|
|
|
389
391
|
job.integrate_reversible_scaling(scale_energy=False)
|
|
392
|
+
job.clean_up()
|
|
390
393
|
return job
|
|
391
394
|
|
|
392
395
|
def routine_pscale(job):
|
|
@@ -403,6 +406,7 @@ def routine_pscale(job):
|
|
|
403
406
|
job.logger.info("Pressure scaling cycle %d finished in %f s"%(i+1, te))
|
|
404
407
|
|
|
405
408
|
job.integrate_pressure_scaling()
|
|
409
|
+
job.clean_up()
|
|
406
410
|
return job
|
|
407
411
|
|
|
408
412
|
def routine_alchemy(job):
|
|
@@ -423,6 +427,7 @@ def routine_alchemy(job):
|
|
|
423
427
|
|
|
424
428
|
job.thermodynamic_integration()
|
|
425
429
|
job.submit_report()
|
|
430
|
+
job.clean_up()
|
|
426
431
|
return job
|
|
427
432
|
|
|
428
433
|
|
|
@@ -433,6 +438,8 @@ def routine_composition_scaling(job):
|
|
|
433
438
|
#we set up comp scaling first
|
|
434
439
|
job.logger.info("Calculating composition scaling")
|
|
435
440
|
comp = CompositionTransformation(job.calc)
|
|
441
|
+
swap_list = comp.get_swap_types()
|
|
442
|
+
job.calc.monte_carlo.swap_types = swap_list
|
|
436
443
|
|
|
437
444
|
#update pair styles
|
|
438
445
|
res = comp.update_pair_coeff(job.calc.pair_coeff[0])
|
|
@@ -453,7 +460,7 @@ def routine_composition_scaling(job):
|
|
|
453
460
|
#job.calc._ghost_element_count = len(comp.new_atomtype) - len()
|
|
454
461
|
|
|
455
462
|
#write new file out and update lattice
|
|
456
|
-
outfilename = ".".join([job.calc.lattice, "comp", "
|
|
463
|
+
outfilename = ".".join([job.calc.lattice, "comp", "data"])
|
|
457
464
|
comp.write_structure(outfilename)
|
|
458
465
|
job.calc.lattice = outfilename
|
|
459
466
|
job.logger.info(f"Modified lattice written to {outfilename}")
|
|
@@ -487,6 +494,8 @@ def routine_composition_scaling(job):
|
|
|
487
494
|
job.calc.mass = [ref_mass for x in range(len(job.calc.element))]
|
|
488
495
|
job.logger.info(f"Temporarily replacing mass: {job.calc.mass}")
|
|
489
496
|
|
|
497
|
+
#update fict elements if needed
|
|
498
|
+
#job.calc._totalelements = comp.maxtype
|
|
490
499
|
|
|
491
500
|
#now start cycle
|
|
492
501
|
ts = time.time()
|
|
@@ -512,10 +521,12 @@ def routine_composition_scaling(job):
|
|
|
512
521
|
netfe = w_arr - mcorrarr
|
|
513
522
|
|
|
514
523
|
job.fe = job.fe - mcorsum
|
|
515
|
-
job.submit_report(extra_dict = {"results":{"mass_correction": float(mcorsum)
|
|
524
|
+
job.submit_report(extra_dict = {"results":{"mass_correction": float(mcorsum),
|
|
525
|
+
"entropy_contribution": float(comp.entropy_contribution)}})
|
|
516
526
|
|
|
517
527
|
outfile = os.path.join(job.simfolder, "composition_sweep.dat")
|
|
518
528
|
np.savetxt(outfile, np.column_stack((flambda_arr, netfe, w_arr, mcorrarr)))
|
|
519
529
|
|
|
520
530
|
job.logger.info('Composition scaling does not include free energy of mixing!')
|
|
531
|
+
job.clean_up()
|
|
521
532
|
return job
|
calphy/scheduler.py
CHANGED
calphy/solid.py
CHANGED
|
@@ -458,6 +458,19 @@ class Solid(cph.Phase):
|
|
|
458
458
|
lmp.command("dump d1 all custom %d traj.fe.forward_%d.dat id type mass x y z fx fy fz"%(self.calc.n_print_steps,
|
|
459
459
|
iteration))
|
|
460
460
|
|
|
461
|
+
#turn on swap moves
|
|
462
|
+
#if self.calc.monte_carlo.n_swaps > 0:
|
|
463
|
+
# self.logger.info(f'{self.calc.monte_carlo.n_swaps} swap moves are performed between 1 and 2 every {self.calc.monte_carlo.n_steps}')
|
|
464
|
+
# lmp.command("fix swap all atom/swap %d %d %d %d ke yes types 1 2"%(self.calc.monte_carlo.n_steps,
|
|
465
|
+
# self.calc.monte_carlo.n_swaps,
|
|
466
|
+
# np.random.randint(1, 10000),
|
|
467
|
+
# self.calc._temperature))
|
|
468
|
+
#
|
|
469
|
+
# lmp.command("variable a equal f_swap[1]")
|
|
470
|
+
# lmp.command("variable b equal f_swap[2]")
|
|
471
|
+
# lmp.command("fix swap2 all print 1 \"${a} ${b}\" screen no file swap.fe.forward_%d.dat"%iteration)
|
|
472
|
+
|
|
473
|
+
|
|
461
474
|
#Forward switching over ts steps
|
|
462
475
|
lmp.command("run %d"%self.calc._n_switching_steps)
|
|
463
476
|
lmp.command("unfix f4")
|
|
@@ -465,6 +478,10 @@ class Solid(cph.Phase):
|
|
|
465
478
|
if self.calc.n_print_steps > 0:
|
|
466
479
|
lmp.command("undump d1")
|
|
467
480
|
|
|
481
|
+
#if self.calc.monte_carlo.n_swaps > 0:
|
|
482
|
+
# lmp.command("unfix swap")
|
|
483
|
+
# lmp.command("unfix swap2")
|
|
484
|
+
|
|
468
485
|
#Equilibriate
|
|
469
486
|
lmp.command("run %d"%self.calc.n_equilibration_steps)
|
|
470
487
|
|
|
@@ -484,6 +501,20 @@ class Solid(cph.Phase):
|
|
|
484
501
|
lmp.command("dump d1 all custom %d traj.fe.backward_%d.dat id type mass x y z fx fy fz"%(self.calc.n_print_steps,
|
|
485
502
|
iteration))
|
|
486
503
|
|
|
504
|
+
#add swaps if n_swap is > 0
|
|
505
|
+
#if self.calc.monte_carlo.n_swaps > 0:
|
|
506
|
+
# self.logger.info(f'{self.calc.monte_carlo.n_swaps} swap moves are performed between 1 and 2 every {self.calc.monte_carlo.n_steps}')
|
|
507
|
+
# lmp.command("fix swap all atom/swap %d %d %d %d ke yes types 2 1"%(self.calc.monte_carlo.n_steps,
|
|
508
|
+
# self.calc.monte_carlo.n_swaps,
|
|
509
|
+
# np.random.randint(1, 10000),
|
|
510
|
+
# self.calc._temperature))
|
|
511
|
+
#
|
|
512
|
+
# lmp.command("variable a equal f_swap[1]")
|
|
513
|
+
# lmp.command("variable b equal f_swap[2]")
|
|
514
|
+
# lmp.command("fix swap2 all print 1 \"${a} ${b}\" screen no file swap.fe.backward_%d.dat"%iteration)
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
487
518
|
#Reverse switching over ts steps
|
|
488
519
|
lmp.command("run %d"%self.calc._n_switching_steps)
|
|
489
520
|
lmp.command("unfix f4")
|
|
@@ -491,6 +522,10 @@ class Solid(cph.Phase):
|
|
|
491
522
|
if self.calc.n_print_steps > 0:
|
|
492
523
|
lmp.command("undump d1")
|
|
493
524
|
|
|
525
|
+
#if self.calc.monte_carlo.n_swaps > 0:
|
|
526
|
+
# lmp.command("unfix swap")
|
|
527
|
+
# lmp.command("unfix swap2")
|
|
528
|
+
|
|
494
529
|
#close object
|
|
495
530
|
if not self.calc.script_mode:
|
|
496
531
|
lmp.close()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: calphy
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.2
|
|
4
4
|
Summary: free energy calculation for python
|
|
5
5
|
Home-page: https://github.com/ICAMS/calphy
|
|
6
6
|
Author: Sarath Menon, Yury Lysogorskiy, Ralf Drautz
|
|
@@ -22,6 +22,18 @@ Requires-Dist: tqdm
|
|
|
22
22
|
Requires-Dist: scipy
|
|
23
23
|
Requires-Dist: pydantic
|
|
24
24
|
Requires-Dist: pyscal3
|
|
25
|
+
Dynamic: author
|
|
26
|
+
Dynamic: author-email
|
|
27
|
+
Dynamic: classifier
|
|
28
|
+
Dynamic: description
|
|
29
|
+
Dynamic: description-content-type
|
|
30
|
+
Dynamic: home-page
|
|
31
|
+
Dynamic: keywords
|
|
32
|
+
Dynamic: license
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
Dynamic: requires-dist
|
|
35
|
+
Dynamic: requires-python
|
|
36
|
+
Dynamic: summary
|
|
25
37
|
|
|
26
38
|
# calphy
|
|
27
39
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
calphy/__init__.py,sha256=WONVW52HjHXP8BT3dosVaobLr_YWtIvVgasXKBL54ts,233
|
|
2
|
+
calphy/alchemy.py,sha256=IEYLfsJRsjfB0zFfApmxGbYXif7IE6mUY_vjTZoXdII,17236
|
|
3
|
+
calphy/clitools.py,sha256=CjADSz3nc8CLYhAmw2Os7aT-Iu_0LLIF6tdAmUMJErw,4398
|
|
4
|
+
calphy/composition_transformation.py,sha256=z3X4fFVoym6QgRDpLBYZ_fM9V0IgJvBq-wITu1nwVmw,17247
|
|
5
|
+
calphy/errors.py,sha256=KN47RWTLbg1H_NZMrhCiJCbqjqJScJ1pgQAuzj1-l84,1268
|
|
6
|
+
calphy/helpers.py,sha256=goN_n5kceSaevjBilQDgHD5-QZxsQsOwTiWsY00jMcM,8411
|
|
7
|
+
calphy/input.py,sha256=CVQKGwZQcrAWIzQl-O_I-067BAUJEtFtB0B_0mohUqc,33169
|
|
8
|
+
calphy/integrators.py,sha256=hJYmbznsgY-x-eZm7ng8gW0qsGbopERl5gGDnw5uLms,21719
|
|
9
|
+
calphy/kernel.py,sha256=wjSpQ59PN-aqHQ1kvOxTYnP2d3wE1Zx4A9ZhqQFqGlI,6311
|
|
10
|
+
calphy/liquid.py,sha256=ECF3DxPZv7XHnmQzk_yz1fol-Vsd98lRojTMAR1YS3M,15025
|
|
11
|
+
calphy/phase.py,sha256=rmOb_T2IsSR48HNvpACnlw9USYagzWT5zqZXymnVVA4,53231
|
|
12
|
+
calphy/phase_diagram.py,sha256=r8uX-0-o5BWhJVi4Xesf8UPZmSK_u6rpOPgYzHzkDYk,27673
|
|
13
|
+
calphy/postprocessing.py,sha256=WmCVj_xyCOU3pO5hycj8Qmfrx-bhIWcVnSfjx_yZkwQ,15164
|
|
14
|
+
calphy/queuekernel.py,sha256=4GMIYnjMiAPipoLNKP5noYcfeEOI_vCqm84zgokk7Xw,5321
|
|
15
|
+
calphy/routines.py,sha256=YaVoAbeAbZ3ytAP_A0o5ngkpPiXpc_lk2I0bN3nqhPs,17858
|
|
16
|
+
calphy/scheduler.py,sha256=nIxlKKGj8ol_FuYMMtXrQinPGhPlYs2h-JsEGHC7_wY,8666
|
|
17
|
+
calphy/solid.py,sha256=Pv2sUuVt-9vIrC_Y0YPJIWn2OJlCkyltBAnOFea9jug,21972
|
|
18
|
+
calphy/splines.py,sha256=BGwUVz_qXQxUzpUCuZo6CsELcd5JVNWzI-Ttcz22G_E,61627
|
|
19
|
+
calphy/utils.py,sha256=0UpsYoxjS5N-iGs-cdm0YDMkLF8IHvKO3smXDHrj3eg,3818
|
|
20
|
+
calphy-1.4.2.dist-info/licenses/LICENSE,sha256=XIHGB5RZLIhOjjoO1bPf0II-qDbjhP5Cv5HJMRE9v1g,16651
|
|
21
|
+
calphy-1.4.2.dist-info/METADATA,sha256=11GAgEYkb-lnkSlfyq9ZQCjU6-ZNGZ67GGjEVa_0s4M,4469
|
|
22
|
+
calphy-1.4.2.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
23
|
+
calphy-1.4.2.dist-info/entry_points.txt,sha256=KX5dP2iYy9GB4Mo0lbCPAz6jo-8b1Gt9GDmsDFzt9pQ,439
|
|
24
|
+
calphy-1.4.2.dist-info/top_level.txt,sha256=w871dhMqPwgjjbifBWdkT9_aOnK1ek4Odrh8UnSG3PE,7
|
|
25
|
+
calphy-1.4.2.dist-info/RECORD,,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
calphy = calphy.kernel:main
|
|
3
3
|
calphy_convert_input = calphy.clitools:convert_legacy_inputfile
|
|
4
4
|
calphy_kernel = calphy.queuekernel:main
|
|
5
|
+
calphy_phase_diagram = calphy.clitools:phase_diagram
|
|
5
6
|
calphy_process_averaging = calphy.clitools:process_averaging
|
|
6
7
|
calphy_process_integration = calphy.clitools:process_integration
|
|
7
8
|
calphy_run_averaging = calphy.clitools:run_averaging
|
calphy-1.3.11.dist-info/RECORD
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
calphy/__init__.py,sha256=yzftsRGAExKS7j5P49gh0fpg-c43MIsUCXKiUgGnCCg,234
|
|
2
|
-
calphy/alchemy.py,sha256=epv_vJoAMVbj-S1TuPSbBGr4w_a9qEr4EIxKlgwdlSo,12893
|
|
3
|
-
calphy/clitools.py,sha256=oDqaw0s-LJ7tAdW_Njk2SFljVx6K34Rs8sdMz48SNSI,4125
|
|
4
|
-
calphy/composition_transformation.py,sha256=Hh240-iVGC8ATlJ3nQK757qVZIBrE2aw7dsF46mi3oo,15353
|
|
5
|
-
calphy/errors.py,sha256=KN47RWTLbg1H_NZMrhCiJCbqjqJScJ1pgQAuzj1-l84,1268
|
|
6
|
-
calphy/helpers.py,sha256=nj8g53H6ScohQtyV7Enzms8Rv_89PRrDDY1IHjFSZdQ,8292
|
|
7
|
-
calphy/input.py,sha256=R-M0C-7i1ux1IWop0UzlqAKoYIre7cxVuFLspcUwsPk,29400
|
|
8
|
-
calphy/integrators.py,sha256=hJYmbznsgY-x-eZm7ng8gW0qsGbopERl5gGDnw5uLms,21719
|
|
9
|
-
calphy/kernel.py,sha256=rd_-EfCiBhQjkxcVaoLtVJB2_qDgS-g-dQ0BZBTJQ_A,6190
|
|
10
|
-
calphy/liquid.py,sha256=a5NTAjc3VsrPBQoEMGe9O1WXfv1vxGoB0xPguf0fOyM,13762
|
|
11
|
-
calphy/phase.py,sha256=FOm5_eP_8XbCYG3_UJoAToD3KKxlXcbSoEfQncZXTeA,44967
|
|
12
|
-
calphy/phase_diagram.py,sha256=2EwmT_qkT5BEP6Sx0_rm09kPP2RWh5JY4sogIBK_AhA,12992
|
|
13
|
-
calphy/postprocessing.py,sha256=hFsc5Kr1FOgfjicjm23Dy19BUbZU9GxKpbCa8_U6gbU,4947
|
|
14
|
-
calphy/queuekernel.py,sha256=4GMIYnjMiAPipoLNKP5noYcfeEOI_vCqm84zgokk7Xw,5321
|
|
15
|
-
calphy/routines.py,sha256=W6OZEPv6HEG11EYsoIbum2WVrO3Ly36i5UWsYQ4oBdQ,17473
|
|
16
|
-
calphy/scheduler.py,sha256=IN8ogDedpTbZZsdpOj-hYZI05gWoD4bN7mHOb1z77Vo,8579
|
|
17
|
-
calphy/solid.py,sha256=ZU_c4LqASoLzhjXX6eQY_8k_FNO9wjmMVTiOCKNsmis,19896
|
|
18
|
-
calphy/splines.py,sha256=BGwUVz_qXQxUzpUCuZo6CsELcd5JVNWzI-Ttcz22G_E,61627
|
|
19
|
-
calphy/utils.py,sha256=0UpsYoxjS5N-iGs-cdm0YDMkLF8IHvKO3smXDHrj3eg,3818
|
|
20
|
-
calphy-1.3.11.dist-info/LICENSE,sha256=XIHGB5RZLIhOjjoO1bPf0II-qDbjhP5Cv5HJMRE9v1g,16651
|
|
21
|
-
calphy-1.3.11.dist-info/METADATA,sha256=Pw5F6YJyyaGZlJG4kPU_MMf8UoilMH16JPa4iU7TFvY,4216
|
|
22
|
-
calphy-1.3.11.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
23
|
-
calphy-1.3.11.dist-info/entry_points.txt,sha256=W9qq254koyWnAgo1jtfQP9bO5Q7sgZrzc8BMnfo3vf4,386
|
|
24
|
-
calphy-1.3.11.dist-info/top_level.txt,sha256=w871dhMqPwgjjbifBWdkT9_aOnK1ek4Odrh8UnSG3PE,7
|
|
25
|
-
calphy-1.3.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|