zhongliliu / elastool

A toolkit for automatic calculation and analysis of elastic constants
GNU General Public License v3.0
43 stars 28 forks source link

Error in 1D system: new ver. code #2

Closed shahramyalameha closed 4 months ago

shahramyalameha commented 8 months ago

Hi, I tried to do example "1D-SWCNT" but I got the following error. Thank you for your guidance.

Reading controlling parameters from elastool.in...

Traceback (most recent call last):
  File "/usr/local/bin/elastool", line 4, in <module>
    __import__('pkg_resources').run_script('elastool==1.0.2', 'elastool')
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 667, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1470, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/local/lib/python3.8/dist-packages/elastool-1.0.2-py3.8.egg/EGG-INFO/scripts/elastool", line 42, in <module>
  File "/usr/local/lib/python3.8/dist-packages/elastool-1.0.2-py3.8.egg/make_conv_cell.py", line 51, in make_conventional_cell
    Returns:
UnboundLocalError: local variable 'pos_conv' referenced before assignment
gmp007 commented 8 months ago

Can you send me your input file?Best,ChineduOn Jan 14, 2024, at 7:47 AM, Shahram_Yalameha @.***> wrote: Hi, I tried to do example "1D-SWCNT" but I got the following error. Thank you for your guidance. Reading controlling parameters from elastool.in...

Traceback (most recent call last): File "/usr/local/bin/elastool", line 4, in import('pkg_resources').run_script('elastool==1.0.2', 'elastool') File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 667, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1470, in run_script exec(script_code, namespace, namespace) File "/usr/local/lib/python3.8/dist-packages/elastool-1.0.2-py3.8.egg/EGG-INFO/scripts/elastool", line 42, in File "/usr/local/lib/python3.8/dist-packages/elastool-1.0.2-py3.8.egg/make_conv_cell.py", line 51, in make_conventional_cell Returns: UnboundLocalError: local variable 'pos_conv' referenced before assignment

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

shahramyalameha commented 8 months ago

I have sent the input file related to the "1D-SWCNT" example. Your prompt assistance in resolving the encountered error is highly appreciated.

Thank you for your quick response.

Shahram

On Sun, Jan 14, 2024 at 4:43 PM gmp007 @.***> wrote:

Can you send me your input file?Best,ChineduOn Jan 14, 2024, at 7:47 AM, Shahram_Yalameha @.***> wrote: Hi, I tried to do example "1D-SWCNT" but I got the following error. Thank you for your guidance. Reading controlling parameters from elastool.in...

Traceback (most recent call last): File "/usr/local/bin/elastool", line 4, in import('pkg_resources').run_script('elastool==1.0.2', 'elastool') File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 667, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1470, in run_script exec(script_code, namespace, namespace) File "/usr/local/lib/python3.8/dist-packages/elastool-1.0.2-py3.8.egg/EGG-INFO/scripts/elastool", line 42, in File "/usr/local/lib/python3.8/dist-packages/elastool-1.0.2-py3.8.egg/make_conv_cell.py", line 51, in make_conventional_cell Returns: UnboundLocalError: local variable 'pos_conv' referenced before assignment

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/zhongliliu/elastool/issues/2#issuecomment-1890949719, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF3VJMRPUURRCTXUQO764J3YOPKYVAVCNFSM6AAAAABB2COAQWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJQHE2DSNZRHE . You are receiving this because you authored the thread.Message ID: @.***>

-- Shahram Yalameha

Young Researcher & Ph.D, Department of Physics, University of Isfahan (+98)9395989476 @.*** https://www.researchgate.net/profile/Shahram_Yalameha

gmp007 commented 8 months ago

I cannot see any elastool.in file in your reply, but I can probably tell you what you're doing wrong. Two things:

  1. You're running post-processing, e.g., your run_mode = 3 or 2, without strain-stress data. The message "Reading controlling parameters from elastool.in..." can only appear for post-processing runs.

  2. I see you're using elastool version 1.0.2. I suggest you download the latest version using pip. First do "pip uninstall elastool" and then install the latest version using "elastool install -U". Afterward, look at the README here on GitHub or run elastool -help for some detailed explanations.

Afterward, if you experience any errors, let me know. Good luck!

shahramyalameha commented 8 months ago

elastool.in:

###############################################################################
### The input file to control the calculation details of elastic constants  ###
###############################################################################

# run mode: 1 for automatic run, 2 for pre-processing, 3 for post-processing
# if 2, plz ensure the structure opt. is performed at fixed pressure or volume
# i.e. CONTCAR and OUTCAR files both exist in ./OPT directory.
run_mode = 1

# Define the dimensional of the system: 2D/3D
dimensional = 1D

# the crystal structure file in vasp POSCAR (.vasp) or cif (.cif) format
structure_file = SWCNT.vasp

# if use conventional cell, no for primitive cell, yes for conventional cell
if_conventional_cell = no

# static or dynamic, static for 0 K, dynamic for finite-temperature
method_stress_statistics = static

# strains matrix for solve all elastic constants, asess or ohess or ulics
strains_matrix = ohess

# strains list for deforming lattice cell, 0 will be neglected because of 
# the initial optimization, if method_statistics = dynamic, the first one is used
strains_list = -0.06 -0.03 0.03 0.06

# repeat numbers of three lattice vectors in conventional lattice for making
# supercell of molecular dynamics simulations (method_statistics = dynamic)
repeat_num = 3 3 3

# last number of steps for sampling stresses used in the dynamic method
num_last_samples = 1000

#Potential directory - specify the location of your POTCAR files
#potential_dir = /user/potential/

# The parallel submiting commmd
parallel_submit_command = mpirun -np -np 38 /home/dr-shahram/vasp_std  > log.vasp
gmp007 commented 8 months ago

You’re not following the instruction in the input file. You commented out potential directory and you’re still using the old version of the code. I suggest you glance through the readme. Most of your questions will be addressed there. On Jan 14, 2024, at 9:15 AM, Shahram_Yalameha @.***> wrote: elastool.in: ###############################################################################

The input file to control the calculation details of elastic constants

###############################################################################

run mode: 1 for automatic run, 2 for pre-processing, 3 for post-processing

if 2, plz ensure the structure opt. is performed at fixed pressure or volume

i.e. CONTCAR and OUTCAR files both exist in ./OPT directory.

run_mode = 1

Define the dimensional of the system: 2D/3D

dimensional = 1D

the crystal structure file in vasp POSCAR (.vasp) or cif (.cif) format

structure_file = SWCNT.vasp

if use conventional cell, no for primitive cell, yes for conventional cell

if_conventional_cell = no

static or dynamic, static for 0 K, dynamic for finite-temperature

method_stress_statistics = static

strains matrix for solve all elastic constants, asess or ohess or ulics

strains_matrix = ohess

strains list for deforming lattice cell, 0 will be neglected because of

the initial optimization, if method_statistics = dynamic, the first one is used

strains_list = -0.06 -0.03 0.03 0.06

repeat numbers of three lattice vectors in conventional lattice for making

supercell of molecular dynamics simulations (method_statistics = dynamic)

repeat_num = 3 3 3

last number of steps for sampling stresses used in the dynamic method

num_last_samples = 1000

Potential directory - specify the location of your POTCAR files

potential_dir = /user/potential/

The parallel submiting commmd

parallel_submit_command = mpirun -np -np 38 /home/dr-shahram/vasp_std > log.vasp

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

shahramyalameha commented 8 months ago

Thank you for your guidance. You were right. The code run fine...

shahramyalameha commented 8 months ago

Thank you for your guidance. You were right. The code run fine...

gmp007 commented 8 months ago

Great to hear that. Good luck!