Closed Vishwa-adi closed 2 years ago
pyiron saves your calculation in the database pr.job_table()
so the second time you execute this function, it just reloads the job from the database. To change this behavior you can by adding the parameter delete_existing_job=True
to the run()
function.
pyiron saves your calculation in the database
pr.job_table()
so the second time you execute this function, it just reloads the job from the database. To change this behavior you can by adding the parameterdelete_existing_job=True
to therun()
function.
I would like to have the same structure for future calculations. By using delete_existing_job=True
, it would give me a new structure.
If you only want to change the lattice constant, but not redo the SQS calculation, you can also use the set_cell()
function of the atomistic structure.
If you only want to change the lattice constant, but not redo the SQS calculation, you can also use the
set_cell()
function of the atomistic structure.
The set_cell() function changes the cell size. Even if I use scale_atoms=True, the distance between the adjacent atoms are same as used in the beginning.
B2NiAl_Pt_sqs.set_cell([eq_lat_const*n_repeat, eq_lat_const*n_repeat, eq_lat_const*n_repeat], scale_atoms=True)
B2NiAl_Pt_sqs.get_distance(B2NiAl_Pt_sqs.positions[0], B2NiAl_Pt_sqs.positions[1])
The cell should be 3x3
so I would use:
B2NiAl_Pt_sqs.set_cell([[eq_lat_const*n_repeat, 0, 0], [0, eq_lat_const*n_repeat, 0], [0,0, eq_lat_const*n_repeat]], scale_atoms=True)
B2NiAl_Pt_sqs.get_distance(B2NiAl_Pt_sqs.positions[0], B2NiAl_Pt_sqs.positions[1])
The cell should be
3x3
so I would use:B2NiAl_Pt_sqs.set_cell([[eq_lat_const*n_repeat, 0, 0], [0, eq_lat_const*n_repeat, 0], [0,0, eq_lat_const*n_repeat]], scale_atoms=True) B2NiAl_Pt_sqs.get_distance(B2NiAl_Pt_sqs.positions[0], B2NiAl_Pt_sqs.positions[1])
It's still giving the lattice constant used in the beginning i.e 2.8...
The cell should be
3x3
so I would use:B2NiAl_Pt_sqs.set_cell([[eq_lat_const*n_repeat, 0, 0], [0, eq_lat_const*n_repeat, 0], [0,0, eq_lat_const*n_repeat]], scale_atoms=True) B2NiAl_Pt_sqs.get_distance(B2NiAl_Pt_sqs.positions[0], B2NiAl_Pt_sqs.positions[1])
It's still giving the lattice constant used in the beginning i.e 2.8...
Make sure that you didn't call set_cell
previously with scale_atoms=True
by accident. I've checked just now that set_cell(scale_atoms=True)
does correctly move atoms accordingly.
As a side note: I'd recommend using apply_strain(a0_new/a0_old - 1)
or something similar, since it harder to get wrong.
The cell should be
3x3
so I would use:B2NiAl_Pt_sqs.set_cell([[eq_lat_const*n_repeat, 0, 0], [0, eq_lat_const*n_repeat, 0], [0,0, eq_lat_const*n_repeat]], scale_atoms=True) B2NiAl_Pt_sqs.get_distance(B2NiAl_Pt_sqs.positions[0], B2NiAl_Pt_sqs.positions[1])
It's still giving the lattice constant used in the beginning i.e 2.8...
Make sure that you didn't call
set_cell
previously withscale_atoms=True
by accident. I've checked just now thatset_cell(scale_atoms=True)
does correctly move atoms accordingly.As a side note: I'd recommend using
apply_strain(a0_new/a0_old - 1)
or something similar, since it harder to get wrong.
apply_strain
function did work perfectly. Thanks 👍
Summary
This gives a warning: /u/system/SLES12/soft/pyiron/dev/anaconda3/lib/python3.8/site-packages/pyiron_atomistics/atomistics/structure/atoms.py:2021: UserWarning: You are adding structures with different cell shapes. Taking the cell and pbc of the first structure:Cell([11.457285687808415, 11.457285687808415, 11.457285687808415]) warnings.warn(
It should make the supercell with the equilibrium lattice constant i.e 2.939179031767603 instead of the first structure (as mentioned by the warning) i.e 2.864321421952104
pyiron Version and Platform
Pyiron version 0.4.6
TYPE = Postgres HOST =
NAME = pyiron
USER =
PASSWD =
JOB_TABLE = jobs_cmmc
TOP_LEVEL_DIRS = /cmmc/u
VIEWERUSER = cmmc_view
VIEWERPASSWD =
VIEWER_TABLE = jobs_cmmc_admin
RESOURCE_PATHS = /u/system/SLES12/soft/pyiron/dev/pyiron-resources-cmmc
Expected Behavior
Should provide the supercell with a new lattice parameter(i.e equilibrium lattice constant).
Actual Behavior Provides the supercell with the lattice parameter given in the beginning.