calphy 1.2.14__py3-none-any.whl → 1.3.0__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/liquid.py CHANGED
@@ -25,8 +25,6 @@ import numpy as np
25
25
  import yaml
26
26
 
27
27
  from calphy.integrators import *
28
- import pyscal.traj_process as ptp
29
- import calphy.lattice as pl
30
28
  import calphy.helpers as ph
31
29
  import calphy.phase as cph
32
30
  from calphy.errors import *
@@ -115,11 +113,14 @@ class Liquid(cph.Phase):
115
113
  lmp = ph.create_object(self.cores, self.simfolder, self.calc.md.timestep,
116
114
  self.calc.md.cmdargs, self.calc.md.init_commands)
117
115
 
116
+ lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')
117
+
118
118
  #set up structure
119
119
  lmp = ph.create_structure(lmp, self.calc)
120
120
 
121
121
  #set up potential
122
- lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
122
+ lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}')
123
+ lmp = ph.set_mass(lmp, self.calc)
123
124
 
124
125
  #Melt regime for the liquid
125
126
  lmp.velocity("all create", self.calc._temperature_high, np.random.randint(1, 10000))
@@ -177,6 +178,9 @@ class Liquid(cph.Phase):
177
178
  lmp.command("variable li equal 1.0")
178
179
  lmp.command("variable lf equal 0.0")
179
180
 
181
+
182
+ lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')
183
+
180
184
  #read in the conf file
181
185
  #conf = os.path.join(self.simfolder, "conf.equilibration.dump")
182
186
  conf = os.path.join(self.simfolder, "conf.equilibration.data")
@@ -184,7 +188,8 @@ class Liquid(cph.Phase):
184
188
 
185
189
  #set hybrid ufm and normal potential
186
190
  #lmp = ph.set_hybrid_potential(lmp, self.options, self.eps)
187
- lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
191
+ lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}')
192
+ lmp = ph.set_mass(lmp, self.calc)
188
193
 
189
194
  #remap the box to get the correct pressure
190
195
  lmp = ph.remap_box(lmp, self.lx, self.ly, self.lz)
@@ -326,7 +331,8 @@ class Liquid(cph.Phase):
326
331
  self.rho, 50, 1.5)
327
332
 
328
333
  #Get ideal gas fe
329
- f2 = get_ideal_gas_fe(self.calc._temperature, self.rho,
334
+ f2 = get_ideal_gas_fe(self.calc._temperature,
335
+ self.rho,
330
336
  self.natoms,
331
337
  [val['mass'] for key, val in self.calc._element_dict.items()],
332
338
  [val['composition'] for key, val in self.calc._element_dict.items()])
calphy/phase.py CHANGED
@@ -29,9 +29,8 @@ import numpy as np
29
29
  import yaml
30
30
  import copy
31
31
 
32
- import pyscal.traj_process as ptp
32
+ import pyscal3.traj_process as ptp
33
33
  from calphy.integrators import *
34
- import calphy.lattice as pl
35
34
  import calphy.helpers as ph
36
35
  from calphy.errors import *
37
36
 
@@ -57,11 +56,6 @@ class Phase:
57
56
  logfile = os.path.join(self.simfolder, "calphy.log")
58
57
  self.logger = ph.prepare_log(logfile, screen=log_to_screen)
59
58
 
60
- self.logger.info("---------------input file----------------")
61
- self.logger.info("commented out as causes crash when we're expanding the T range after a fail run")
62
- # self.logger.info(yaml.safe_dump(self.calc.to_dict()))
63
- self.logger.info("------------end of input file------------")
64
-
65
59
  if self.calc._pressure is None:
66
60
  pressure_string = "None"
67
61
  else:
@@ -134,9 +128,6 @@ class Phase:
134
128
  self.l = self.calc.lattice
135
129
  self.alat = self.calc.lattice_constant
136
130
  self.vol = None
137
- #self.concentration = self.calc._composition
138
- #self.dumpfile = False
139
- self.prepare_lattice()
140
131
 
141
132
  #other properties
142
133
  self.cores = self.calc.queue.cores
@@ -196,39 +187,6 @@ class Phase:
196
187
  self._from_dict(org_dict[key], val)
197
188
  else:
198
189
  org_dict[key] = val
199
-
200
- def prepare_lattice(self):
201
- """
202
- Prepare the lattice for the simulation
203
-
204
- Parameters
205
- ----------
206
- None
207
-
208
- Returns
209
- -------
210
- None
211
-
212
- Notes
213
- -----
214
- Calculates the lattic, lattice constant, number of atoms per unit cell
215
- and concentration of the input system.
216
- """
217
- #l, alat, apc, conc, dumpfile = pl.prepare_lattice(self.calc)
218
- #self.l = l
219
- #self.alat = alat
220
- #self.apc = apc
221
- #self.concentration = self.calc.composition
222
- #self.dumpfile = dumpfile
223
- #self.logger.info("Lattice: %s with a=%f"%(self.l, self.alat))
224
- #self.logger.info("%d atoms in the unit cell"%self.apc)
225
- #self.logger.info("concentration:")
226
- #self.logger.info(self.concentration)
227
- #if self.l == "file":
228
- # if self.dumpfile:
229
- # self.logger.info("Input structure is read in from a LAMMPS dump file")
230
- # else:
231
- # self.logger.info("Input structure is read in from a LAMMPS data file")
232
190
 
233
191
  def dump_current_snapshot(self, lmp, filename):
234
192
  """
@@ -669,35 +627,6 @@ class Phase:
669
627
  lmp.command("unfix 1")
670
628
  lmp.command("unfix 2")
671
629
 
672
- def process_traj(self, filename, outfilename):
673
- """
674
- Process the out trajectory after averaging cycle and
675
- extract a configuration to run integration
676
-
677
- Will be phased out...
678
-
679
- Parameters
680
- ----------
681
- None
682
-
683
- Returns
684
- -------
685
- None
686
-
687
- """
688
- trajfile = os.path.join(self.simfolder, filename)
689
- files = ptp.split_trajectory(trajfile)
690
- conf = os.path.join(self.simfolder, outfilename)
691
-
692
- ph.reset_timestep(conf, os.path.join(self.simfolder, "current.data"),
693
- init_commands=self.calc.md.init_commands,
694
- script_mode=self.calc.script_mode)
695
-
696
- os.remove(trajfile)
697
- for file in files:
698
- os.remove(file)
699
-
700
-
701
630
  def submit_report(self, extra_dict=None):
702
631
  """
703
632
  Submit final report containing results
@@ -794,13 +723,16 @@ class Phase:
794
723
  lmp.command("variable li equal %f"%li)
795
724
  lmp.command("variable lf equal %f"%lf)
796
725
 
726
+ lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')
727
+
797
728
  #read in conf file
798
729
  #conf = os.path.join(self.simfolder, "conf.equilibration.dump")
799
730
  conf = os.path.join(self.simfolder, "conf.equilibration.data")
800
731
  lmp = ph.read_data(lmp, conf)
801
732
 
802
733
  #set up potential
803
- lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
734
+ lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}')
735
+ lmp = ph.set_mass(lmp, self.calc)
804
736
 
805
737
  #remap the box to get the correct pressure
806
738
  lmp = ph.remap_box(lmp, self.lx, self.ly, self.lz)
@@ -889,7 +821,7 @@ class Phase:
889
821
  else:
890
822
  self.check_if_solidfied(lmp, "traj.temp.dat")
891
823
 
892
- lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
824
+ lmp = ph.set_potential(lmp, self.calc)
893
825
 
894
826
  #reverse scaling
895
827
  lmp.command("variable flambda equal ramp(${li},${lf})")
@@ -982,13 +914,16 @@ class Phase:
982
914
  lmp.command("variable li equal %f"%li)
983
915
  lmp.command("variable lf equal %f"%lf)
984
916
 
917
+ lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')
918
+
985
919
  #read in conf
986
920
  #conf = os.path.join(self.simfolder, "conf.equilibration.dump")
987
921
  conf = os.path.join(self.simfolder, "conf.equilibration.data")
988
922
  lmp = ph.read_data(lmp, conf)
989
923
 
990
924
  #set up potential
991
- lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
925
+ lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}')
926
+ lmp = ph.set_mass(lmp, self.calc)
992
927
 
993
928
  #remap the box to get the correct pressure
994
929
  lmp = ph.remap_box(lmp, self.lx, self.ly, self.lz)
@@ -1071,13 +1006,16 @@ class Phase:
1071
1006
  lmp.command("variable p0 equal %f"%p0)
1072
1007
  lmp.command("variable pf equal %f"%pf)
1073
1008
 
1009
+ lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')
1010
+
1074
1011
  #read in conf
1075
1012
  #conf = os.path.join(self.simfolder, "conf.dump")
1076
1013
  conf = os.path.join(self.simfolder, "conf.equilibration.data")
1077
1014
  lmp = ph.read_data(lmp, conf)
1078
1015
 
1079
1016
  #set up potential
1080
- lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
1017
+ lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}')
1018
+ lmp = ph.set_mass(lmp, self.calc)
1081
1019
 
1082
1020
  #remap the box to get the correct pressure
1083
1021
  lmp = ph.remap_box(lmp, self.lx, self.ly, self.lz)
calphy/routines.py CHANGED
@@ -443,6 +443,11 @@ def routine_composition_scaling(job):
443
443
  job.logger.info("Update pair coefficients")
444
444
  job.logger.info(f"pair coeff 1: {job.calc.pair_coeff[0]}")
445
445
  job.logger.info(f"pair coeff 2: {job.calc.pair_coeff[1]}")
446
+ job.calc._pair_style_names.append(job.calc._pair_style_names[0])
447
+ job.logger.info("Update pair styles")
448
+ job.logger.info(f"pair style 1: {job.calc._pair_style_names[0]}")
449
+ job.logger.info(f"pair style 2: {job.calc._pair_style_names[1]}")
450
+
446
451
  backup_element = job.calc.element.copy()
447
452
  job.calc.element = comp.pair_list_old
448
453
  #job.calc._ghost_element_count = len(comp.new_atomtype) - len()
calphy/solid.py CHANGED
@@ -26,9 +26,7 @@ import yaml
26
26
  import copy
27
27
  import sys
28
28
 
29
- import pyscal.traj_process as ptp
30
29
  from calphy.integrators import *
31
- import calphy.lattice as pl
32
30
  import calphy.helpers as ph
33
31
  import calphy.phase as cph
34
32
  from calphy.errors import *
@@ -111,9 +109,13 @@ class Solid(cph.Phase):
111
109
  k_std = []
112
110
  for i in range(self.calc.n_elements):
113
111
  quant = np.loadtxt(file, usecols=(i+1, ), unpack=True)[-ncount+1:]
114
- quant = 3*kb*self.calc._temperature/quant
115
- k_mean.append(np.round(np.mean(quant), decimals=2))
116
- k_std.append(np.round(np.std(quant), decimals=2))
112
+ mean_quant = np.round(np.mean(quant), decimals=2)
113
+ std_quant = np.round(np.std(quant), decimals=2)
114
+ if mean_quant == 0:
115
+ mean_quant = 1.00
116
+ mean_quant = 3*kb*self.calc._temperature/mean_quant
117
+ k_mean.append(mean_quant)
118
+ k_std.append(std_quant)
117
119
  return k_mean, k_std
118
120
 
119
121
 
@@ -213,14 +215,18 @@ class Solid(cph.Phase):
213
215
  init_commands=self.calc.md.init_commands,
214
216
  script_mode=self.calc.script_mode)
215
217
 
218
+ #set up potential
219
+ if self.calc.potential_file is None:
220
+ lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')
221
+
216
222
  #set up structure
217
223
  lmp = ph.create_structure(lmp, self.calc)
218
224
 
219
- #set up potential
220
225
  if self.calc.potential_file is None:
221
- lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
226
+ lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}')
222
227
  else:
223
228
  lmp.command("include %s"%self.calc.potential_file)
229
+ lmp = ph.set_mass(lmp, self.calc)
224
230
 
225
231
  #add some computes
226
232
  lmp.command("variable mvol equal vol")
@@ -288,14 +294,19 @@ class Solid(cph.Phase):
288
294
  init_commands=self.calc.md.init_commands,
289
295
  script_mode=self.calc.script_mode)
290
296
 
297
+ #set up potential
298
+ if self.calc.potential_file is None:
299
+ lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')
300
+
291
301
  #set up structure
292
302
  lmp = ph.create_structure(lmp, self.calc, species=self.calc.n_elements+self.calc._ghost_element_count)
293
303
 
294
- #set up potential
295
304
  if self.calc.potential_file is None:
296
- lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
305
+ lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}')
297
306
  else:
298
307
  lmp.command("include %s"%self.calc.potential_file)
308
+ lmp = ph.set_mass(lmp, self.calc)
309
+
299
310
 
300
311
  #add some computes
301
312
  lmp.command("variable mvol equal vol")
@@ -364,16 +375,20 @@ class Solid(cph.Phase):
364
375
  init_commands=self.calc.md.init_commands,
365
376
  script_mode=self.calc.script_mode)
366
377
 
378
+ #set up potential
379
+ if self.calc.potential_file is None:
380
+ lmp.command(f'pair_style {self.calc._pair_style_with_options[0]}')
381
+
367
382
  #read in the conf file
368
383
  #conf = os.path.join(self.simfolder, "conf.equilibration.dump")
369
384
  conf = os.path.join(self.simfolder, "conf.equilibration.data")
370
385
  lmp = ph.read_data(lmp, conf)
371
386
 
372
- #set up potential
373
387
  if self.calc.potential_file is None:
374
- lmp = ph.set_potential(lmp, self.calc, ghost_elements=self.calc._ghost_element_count)
388
+ lmp.command(f'pair_coeff {self.calc.pair_coeff[0]}')
375
389
  else:
376
390
  lmp.command("include %s"%self.calc.potential_file)
391
+ lmp = ph.set_mass(lmp, self.calc)
377
392
 
378
393
  #remap the box to get the correct pressure
379
394
  lmp = ph.remap_box(lmp, self.lx, self.ly, self.lz)
@@ -408,7 +423,7 @@ class Solid(cph.Phase):
408
423
  lmp.command("variable step equal step")
409
424
  lmp.command("variable dU1 equal pe/atoms")
410
425
  for i in range(self.calc.n_elements):
411
- lmp.command("variable dU%d equal f_ff%d/v_count%d"%(i+2, i+1, i+1))
426
+ lmp.command("variable dU%d equal f_ff%d"%(i+2, i+1))
412
427
 
413
428
  lmp.command("variable lambda equal f_ff1[1]")
414
429
 
@@ -432,6 +447,7 @@ class Solid(cph.Phase):
432
447
  str2 = []
433
448
  for i in range(self.calc.n_elements):
434
449
  str2.append("${dU%d}"%(i+2))
450
+
435
451
  str2.append("${lambda}\"")
436
452
  str2 = " ".join(str2)
437
453
  str3 = " screen no file forward_%d.dat"%iteration
@@ -457,6 +473,7 @@ class Solid(cph.Phase):
457
473
  str2 = []
458
474
  for i in range(self.calc.n_elements):
459
475
  str2.append("${dU%d}"%(i+2))
476
+
460
477
  str2.append("${lambda}\"")
461
478
  str2 = " ".join(str2)
462
479
  str3 = " screen no file backward_%d.dat"%iteration
@@ -499,13 +516,15 @@ class Solid(cph.Phase):
499
516
  Calculates the final work, energy dissipation and free energy by
500
517
  matching with Einstein crystal
501
518
  """
502
- f1 = get_einstein_crystal_fe(self.calc._temperature,
503
- self.natoms, [val['mass'] for key, val in self.calc._element_dict.items()],
504
- self.vol, self.k, [val['composition'] for key, val in self.calc._element_dict.items()])
519
+ f1 = get_einstein_crystal_fe(
520
+ self.calc,
521
+ self.vol,
522
+ self.k)
523
+
505
524
  w, q, qerr = find_w(self.simfolder,
506
- nelements=self.calc.n_elements,
507
- concentration=[val['composition'] for key, val in self.calc._element_dict.items()], nsims=self.calc.n_iterations,
508
- full=True, solid=True)
525
+ self.calc,
526
+ full=True,
527
+ solid=True)
509
528
 
510
529
  self.fref = f1
511
530
  self.w = w
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: calphy
3
- Version: 1.2.14
3
+ Version: 1.3.0
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
@@ -21,7 +21,6 @@ Requires-Dist: mendeleev
21
21
  Requires-Dist: tqdm
22
22
  Requires-Dist: scipy
23
23
  Requires-Dist: pydantic
24
- Requires-Dist: pyscal
25
24
  Requires-Dist: pyscal3
26
25
 
27
26
  # calphy
@@ -0,0 +1,23 @@
1
+ calphy/__init__.py,sha256=HnR9XnREXYsTl2lUvRlWplP3iug3Ng_h6Fl7UUAoQXI,233
2
+ calphy/alchemy.py,sha256=MzmeNYz8zDi1ZDsrOErm5gmI5assQvzZwb_sIS3f30I,13257
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=5P2JChRrJ6u5qHvyybGQ8eOumJIHk5no7IreYbg87YM,8244
7
+ calphy/input.py,sha256=DgRSMuLKE5W8DLYg-4O8vuI7TYILA9ByJH1mHF3Q_h8,28774
8
+ calphy/integrators.py,sha256=6r3CrdSep6pTYcUQCtO1_t9ab6U1YMLnHHmMau4NAT0,20709
9
+ calphy/kernel.py,sha256=rd_-EfCiBhQjkxcVaoLtVJB2_qDgS-g-dQ0BZBTJQ_A,6190
10
+ calphy/liquid.py,sha256=SAw7WXMEvWx0Ox02u8RAVxccj6e96Bt8G_vVDTNLDcU,13502
11
+ calphy/phase.py,sha256=PkqG1mFHuXlP2zAeemENQWitAU9nV08GkxpoeH2Ihv0,44147
12
+ calphy/phase_diagram.py,sha256=qXB3E0v3HDDpujPXjhFbx7X_xLpTGQYoWIGXdC_0NA8,10242
13
+ calphy/queuekernel.py,sha256=4GMIYnjMiAPipoLNKP5noYcfeEOI_vCqm84zgokk7Xw,5321
14
+ calphy/routines.py,sha256=W6OZEPv6HEG11EYsoIbum2WVrO3Ly36i5UWsYQ4oBdQ,17473
15
+ calphy/scheduler.py,sha256=TS6aOjp2JpudVWTOIEjptqeDfgruWLwUQ_JVvuUCUgg,8532
16
+ calphy/solid.py,sha256=49gT0wNOP3h8lRDXarULP-bU09lIrnDCTUcyxE7X-UE,19795
17
+ calphy/splines.py,sha256=BGwUVz_qXQxUzpUCuZo6CsELcd5JVNWzI-Ttcz22G_E,61627
18
+ calphy-1.3.0.dist-info/LICENSE,sha256=XIHGB5RZLIhOjjoO1bPf0II-qDbjhP5Cv5HJMRE9v1g,16651
19
+ calphy-1.3.0.dist-info/METADATA,sha256=xJFRd275-y4a4XVzPLuJXuvFnSV4xUh68_s7ncmOpn4,4215
20
+ calphy-1.3.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
21
+ calphy-1.3.0.dist-info/entry_points.txt,sha256=W9qq254koyWnAgo1jtfQP9bO5Q7sgZrzc8BMnfo3vf4,386
22
+ calphy-1.3.0.dist-info/top_level.txt,sha256=w871dhMqPwgjjbifBWdkT9_aOnK1ek4Odrh8UnSG3PE,7
23
+ calphy-1.3.0.dist-info/RECORD,,