Error while running coffee.py

56 views
Skip to first unread message

Amish Chovatiya

unread,
Dec 1, 2020, 7:18:23 PM12/1/20
to CoFFEE code forum
Hi,
I'm getting the following python error while running coffee.py in 2D formulation:

Traceback (most recent call last):
  File "/home/amish/CoFFEE_1.1/coffee.py", line 62, in <module>
    V_r = Solver(c,charge,eps,imax,jmax,kmax,comm)
  File "/home/amish/CoFFEE_1.1/PoissonSolver/Solver.py", line 6, in Solver
    V_r = PS_2D(cell_s,charge_s,eps_s,imax,jmax,kmax,comm)
  File "/home/amish/CoFFEE_1.1/PoissonSolver/PS_main.py", line 238, in PS_2D
    V_G[i+imax]=temp2[j]
ValueError: cannot copy sequence with size 153 to array axis with dimension 159

Am I missing something? The input file looks like this:

&CELL_PARAMETERS

Lattice_Vectors(normalized):
0.500000 -0.8660254037844386 0.0000000
0.500000 0.8660254037844386 0.000000
0.000000 0.000000 1.000000

Cell_dimensions angstrom
36.079 36.079 36.079

Ecut=35.0 Hartree
/

&DIELECTRIC_PARAMETERS Slab
Epsilon1_a1 = 15.0
Epsilon2_a1 = 1.0
Epsilon1_a2 = 15.0
Epsilon2_a2 = 1.0
Epsilon1_a3 = 2.0
Epsilon2_a3 = 1.0
Width = 11.40454 bohr
Centre = 5.70226 bohr
Smoothness = 0.37807 bohr
Plot_eps = True
/

&GAUSSIAN_PARAMETERS:
Total_charge = -1
Sigma = 1.89035
Centre_a1 = 0.5
Centre_a2 = 0.5
Centre_a3 = 0.5
/

Amish Chovatiya

unread,
Dec 2, 2020, 3:21:08 PM12/2/20
to CoFFEE code forum
P.S. I also get the same error when I run it with example files under 2D/MoS2/Model_Scaling.

Amish Chovatiya

unread,
Dec 9, 2020, 5:52:50 PM12/9/20
to CoFFEE code forum
Update: I was trying to run the input file in Examples/2D/MoS2/Model_Scaling/alpha.6 when I got the above error. The input file provided in alpha.6 folder has Ecut=35.0 Hartree whereas it is 15 Hartree in alpha.4 and alpha.8, where coffee.py runs fine. This difference does not hold however when running alpha.20 which runs into the error even though Ecut is set to 15 Hartree . Does that give a hint on what's causing this error and how it can be addressed?

Mit Naik

unread,
Jan 13, 2021, 1:03:18 PM1/13/21
to CoFFEE code forum
Hi Amish,

I'm unable to reproduce your error. 

I ran CoFFEE using your input file and found no issues. Here is the output:
########################################################
CoFFEE: Corrections For Formation Energies and 
        Eigenvalues for charged defect simulations
########################################################
Running on 1 processor(s)
CELL PARAMETERS:
Cell dimensions (bohr): 68.179, 68.179,68.179 
Lattice vectors (normalized):
a1: 0.500, -0.866, 0.000
a2: 0.500, 0.866, 0.000
a3: 0.000, 0.000, 1.000
Plane-wave energy cut-off (Ry): 70.000 

GAUSSIAN_PARAMETERS:
('Total charge:', -1)
Center of the gaussian (in crystal units):
(0.5, 0.5, 0.5)
Gaussian width (bohr):
1.89035


DIELECTRIC PARAMETERS
('Profile:', 'Slab')
Epsilon tensor inside the material:
[[ 15.   0.   0.]
 [  0.  15.   0.]
 [  0.   0.   2.]]
Epsilon tensor outside the material:
[[ 1.  0.  0.]
 [ 0.  1.  0.]
 [ 0.  0.  1.]]
('Slab width (bohr):', 11.40454)
('Slab center (bohr):', 5.70226)
('Smoothness parameter (bohr):', 0.37807)


Grid: 159, 159, 183
Volume: 274467.303
!  Total Energy (eV): 3.4538
Execution time: 80.11 s


Are there any other test cases that fail?

Reply all
Reply to author
Forward
0 new messages