lanl / LATTE

Developer repository for the LATTE code
Other
40 stars 22 forks source link

Wrong pair potential will be used for those pairs not specified in parameter file #76

Open chliu1990 opened 6 years ago

chliu1990 commented 6 years ago

In subroutines like PAIRPOTTAB, the part for determine which pair potential to use is like this:

DO K = 1, NOPPS

              IF ((ATELE(I) .EQ. PPELE1(K) .AND. ATELE(J) .EQ. PPELE2(K)) &
                   .OR. (ATELE(J) .EQ. PPELE1(K) .AND. &
                   ATELE(I) .EQ. PPELE2(K))) THEN

                 PPSEL = K

                 R1 = POTCOEF(9,PPSEL)
                 RCUT = POTCOEF(10,PPSEL)
                 RCUT2 = RCUT*RCUT

              ENDIF

           ENDDO

If the pair potential is not defined for a pair of atom, it will use the pair potential function of last loop to compute the pair potential. Maybe it will be better to use zero for these non-existing parameters? It seems set RCUT2=ZERO for those pairs will make it work. (the code just put is wrong, just corrected it)

RCUT2=0
DO K = 1, NOPPS

              IF ((ATELE(I) .EQ. PPELE1(K) .AND. ATELE(J) .EQ. PPELE2(K)) &
                   .OR. (ATELE(J) .EQ. PPELE1(K) .AND. &
                   ATELE(I) .EQ. PPELE2(K))) THEN

                 PPSEL = K

                 R1 = POTCOEF(9,PPSEL)
                 RCUT = POTCOEF(10,PPSEL)
                 RCUT2 = RCUT*RCUT

              ENDIF

           ENDDO
cnegre commented 6 years ago

I think if the parameters are not defined and we are using ppoton = 1 the program should give an error. Why would we want them to be 0 if they are not defined?

On Thu, Jul 12, 2018 at 7:37 PM, Chang Liu notifications@github.com wrote:

In subroutines like PAIRPOTTAB, the part for determine which pair potential to use is like this:

IF ((ATELE(I) .EQ. PPELE1(K) .AND. ATELE(J) .EQ. PPELE2(K)) & .OR. (ATELE(J) .EQ. PPELE1(K) .AND. & ATELE(I) .EQ. PPELE2(K))) THEN

PPSEL = K
RCUT = PPR(PPTABLENGTH(PPSEL), PPSEL)
RCUT2 = RCUT*RCUT

ENDIF

If the pair potential is not defined for a pair of atom, it will use the pair potential function of last loop to compute the pair potential. Maybe it will be better to use zero for these non-existing parameters? It seems set RCUT2=ZERO for those pairs will make it wok.

IF ((ATELE(I) .EQ. PPELE1(K) .AND. ATELE(J) .EQ. PPELE2(K)) & .OR. (ATELE(J) .EQ. PPELE1(K) .AND. & ATELE(I) .EQ. PPELE2(K))) THEN

PPSEL = K
RCUT = PPR(PPTABLENGTH(PPSEL), PPSEL)
RCUT2 = RCUT*RCUT

ELSE
    RCUT2 = ZERO

ENDIF

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lanl/LATTE/issues/76, or mute the thread https://github.com/notifications/unsubscribe-auth/APQltX_GmKPGIyleUyQBQrRs5Uf6SQ-Cks5uF_nBgaJpZM4VOKyC .

-- Dr. Christian F. A . Negre

LOS ALAMOS NATIONAL LABORATORY T-1 Division, Mail Stop B221 Los Alamos, NM 87545

chliu1990 commented 6 years ago

Give an error message will also work. It will not give an error for PPOTON=2. I'm trying to fit the repulsive potential for Fe-C in the table format. In order to do that, I will need to set Fe-C repulsive potential to be zero first. I try both setting Fe-C pair potential to zero or directly remove the Fe-C parameter from ppots.dftb file. The two ways gave very different forces and energy. That's why I open this issue...

cnegre commented 6 years ago

So you need to turn of ppot only for a selected pair of species. Could you do that by setting the preexponential factor to 0?

On Thu, Jul 12, 2018 at 8:09 PM, Chang Liu notifications@github.com wrote:

Give an error message will also work. It will not give an error for PPOTON=2. I'm trying to fit the repulsive potential for Fe-C in the table format. In order to do that, I will need to set Fe-C repulsive potential to be zero first. I try both setting Fe-C pair potential to zero or directly remove the Fe-C parameter from ppots.dftb file. The two ways gave very different forces and energy. That's why I open this issue...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lanl/LATTE/issues/76#issuecomment-404704020, or mute the thread https://github.com/notifications/unsubscribe-auth/APQltdzSGOy0HHZ-YSr8C6BbSJ7Jj81eks5uGAFJgaJpZM4VOKyC .

-- Dr. Christian F. A . Negre

LOS ALAMOS NATIONAL LABORATORY T-1 Division, Mail Stop B221 Los Alamos, NM 87545

chliu1990 commented 6 years ago

Yes, I can do that. And in fact, that is just what I did. I'm using table format (PPOTON= 2), I just set the second column of the table to be zero for Fe C.

It seems on my computer, for PPOTON= 1, it will not raise an error if a pair parameter is not defined either. (see attached example) test_ppots.zip

cnegre commented 6 years ago

I see. Feel free to add an error message if ppot is 1 and the parameters are not defined. That is something that we need.

On Thu, Jul 12, 2018 at 8:44 PM, Chang Liu notifications@github.com wrote:

Yes, I can do that. And in fact, that is just what I did. I'm using table format (PPOTON= 2), I just set the second column of the table to be zero for Fe C.

It seems on my computer, for PPOTON= 1, it will not raise an error if a pair parameter is not defined either. (see attached example) test_ppots.zip https://github.com/lanl/LATTE/files/2191028/test_ppots.zip

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lanl/LATTE/issues/76#issuecomment-404709021, or mute the thread https://github.com/notifications/unsubscribe-auth/APQltXkDlP6jurEX9PruIJ-JIPIe4M29ks5uGAmUgaJpZM4VOKyC .

-- Dr. Christian F. A . Negre

LOS ALAMOS NATIONAL LABORATORY T-1 Division, Mail Stop B221 Los Alamos, NM 87545