bertdupe / Matjes

MC and SD
GNU General Public License v3.0
6 stars 2 forks source link

MD weird neighbour distance error for 2nd nn interaction #135

Closed loudesplat closed 1 year ago

loudesplat commented 1 year ago

[still github because trying to keep all MD issues in the same place]

ERROR, found the same distance twice for Hamiltonian phonon_harmonic
        at atom indices  :           1           1
        with the distance:           2
STOP THIS IS MOST PROBABLY AN INPUT MISTAKE

I dont know what this error even is but F1,2,3 works and F1,2 gives this error, exactly same system otherwise. spindyn with J1,2 with 3 sites works fine.


simulation molecular_dynamics
phonon_harmonic
1 1 1 10.0d-3
1 1 2 -3.5d-3
#1 1 3 -1.5d-3
set_ASR T

atomtypes  1
Na  0.0 0.01 47.0 T 0 ##atom type: name, magnetic moment (in muB), charge (in units of electronic charge), mass (atomic mass unit), displacement, number TB-orb

atoms 1
Na   0.0  0.0   0.0

Periodic_log .T .F. .F.
Nsize 3 1 1
alat 1.0 1.0 1.0
lattice
1.0 0.0 0.0
0.0 1.0 0.0
0.0 0.0 1.0

#input for the dynamic
integration 2  (1: simple integration 2:Heun  3: SIB ) 
timestep 10 (fs)
duration 1 (in units of dt)
patrick432 commented 1 year ago

Hi Louise,

this error is a sanity check of the input which finds a mistake that it was not intended to find.

What it is supposed to find is 2 inputs of the same atom types and same distance.

Here however there seems to be a real programming error reading in the input. It seems that it finds 2 instances of the same input line with distance 2, although there is only one.

Most probably this is due to the commented lines after the last used phonon_harmonic input. Adding a new line to separate the last entry, the error disappears and at first gaze it looks reasonable.

For now I think adding this input line should be sufficient, in general someone should look at the input routine to find out why it fails so drastically.

loudesplat commented 1 year ago

Thanks Patrick! Extra line indeed works as temporary fix.

patrick432 commented 1 year ago

Hi Louise,

I made a commit in a new branch:fix-Hinput-comments.

This should fix that issue and allow comments within that type of multiline Hamiltonian input.

Please test that and merge that branch into yours if that works (and then delete the fix-branch).

Cheers, Patrick

loudesplat commented 1 year ago

Hi Patrick, as far as I can tell that seems to have fixed the issue! Thanks!