2
0
mirror of https://github.com/LCPQ/DEHam synced 2024-12-22 04:13:44 +01:00

now limit the hole movement by giving range

This commit is contained in:
vijay gopal chilkuri 2018-01-28 11:05:08 +01:00
parent 3278aabfeb
commit 62dba9a3c5
9 changed files with 57 additions and 15 deletions

View File

@ -134,6 +134,8 @@ int main(int argc,char **argv)
tcountcol, tcountcol,
&getdata.ntrou, &getdata.ntrou,
&getdata.isz, &getdata.isz,
&getdata.fix_trou1,
&getdata.fix_trou2,
&getdata.FAM1, &getdata.FAM1,
tcol, tcol,
val); val);

View File

@ -22,7 +22,14 @@ subroutine getdet(add,ideter)
i=1 i=1
detb = det(ib,1) detb = det(ib,1)
deta = deth(ia,1) deta = deth(ia,1)
if(FAM1) deta = ISHFT(deta,-(natom/2)) if(FAM1) then
if(fix_trou1 .eq. fix_trou2) then
deta = ISHFT(deta,-(natom/2))
else
natom2 = natom - (fix_trou2 - fix_trou1)
deta = ISHFT(deta, -natom2)
endif
endif
! do while (i.le.(ib)) ! do while (i.le.(ib))
! const=1 ! const=1
! do while(popcnt(detb).ne.nbeta .or. const==1) ! do while(popcnt(detb).ne.nbeta .or. const==1)
@ -44,7 +51,11 @@ subroutine getdet(add,ideter)
! enddo ! enddo
const=0 const=0
if(FAM1) then if(FAM1) then
if(fix_trou1 .eq. fix_trou2) then
natom2 = natom/2 natom2 = natom/2
else
natom2 = (fix_trou2 - fix_trou1)
endif
else else
natom2 = natom natom2 = natom
endif endif

View File

@ -97,6 +97,9 @@ BEGIN_PROVIDER [integer, natom]
write(6,*)'HAMILTONIEN t-J' write(6,*)'HAMILTONIEN t-J'
write(6,*)'Le nombre de trou est : ',ntrou write(6,*)'Le nombre de trou est : ',ntrou
write(6,*)'Famille 1 : ',FAM1 write(6,*)'Famille 1 : ',FAM1
if(FAM1) then
if(fix_trou1 .ne. fix_trou2) write(6,*)'Trou fixe entre :', fix_trou1, "et ", fix_trou2
endif
!--------------------------------------------- !---------------------------------------------
write(6,*)' ' write(6,*)' '
write(6,*)' ' write(6,*)' '

View File

@ -7,7 +7,13 @@ BEGIN_PROVIDER [integer(kind=selected_int_kind(16)), nt1]
! call combin(idet1(1,nt1+1),natom,ntrou,nt1,32,jrangmax) ! call combin(idet1(1,nt1+1),natom,ntrou,nt1,32,jrangmax)
natom2=natom natom2=natom
if(FAM1)natom2=natom/2 if(FAM1) then
if(fix_trou1 .eq. fix_trou2) then
natom2=natom/2
else
natom2 = fix_trou2 - fix_trou1
endif
endif
nt1= nint(gamma(real(natom2+1,16))/(gamma(real(natom2-ntrou+1,16))*gamma(real(ntrou+1,16))),selected_int_kind(16)) nt1= nint(gamma(real(natom2+1,16))/(gamma(real(natom2-ntrou+1,16))*gamma(real(ntrou+1,16))),selected_int_kind(16))
write(6,*)'nt1',nt1 write(6,*)'nt1',nt1
END_PROVIDER END_PROVIDER

View File

@ -31,7 +31,11 @@ BEGIN_PROVIDER[integer(kind=selected_int_kind(16)),det,(nt2,2)]
enddo enddo
count+=1 count+=1
if(FAM1) then if(FAM1) then
if(fix_trou1 .eq. fix_trou2) then
deth(count,1)=ISHFT(a,natom/2) deth(count,1)=ISHFT(a,natom/2)
else
deth(count,1)=ISHFT(a,natom - (fix_trou2-fix_trou1))
endif
else else
deth(count, 1) = a deth(count, 1) = a
endif endif

View File

@ -7,6 +7,8 @@ BEGIN_PROVIDER[integer,l1, (maxlien)]
&BEGIN_PROVIDER[integer, ntrou] &BEGIN_PROVIDER[integer, ntrou]
&BEGIN_PROVIDER[integer, isz] &BEGIN_PROVIDER[integer, isz]
&BEGIN_PROVIDER[logical*1, FAM1] &BEGIN_PROVIDER[logical*1, FAM1]
&BEGIN_PROVIDER[integer, fix_trou1]
&BEGIN_PROVIDER[integer, fix_trou2]
implicit none implicit none
! integer::i ! integer::i
! open(unit=11,file="l1.dat",form="formatted") ! open(unit=11,file="l1.dat",form="formatted")

View File

@ -13,7 +13,7 @@ void Data_new(FILE* file, Data* dat) {
/* note that fgets don't strip the terminating \n, checking its /* note that fgets don't strip the terminating \n, checking its
presence would allow to handle lines longer that sizeof(line) */ presence would allow to handle lines longer that sizeof(line) */
if (count != 26){ if (count != 29){
count++; count++;
switch(count){ switch(count){
case 1: case 1:
@ -223,6 +223,12 @@ void Data_new(FILE* file, Data* dat) {
case 27: case 27:
dat->postrou=atol(line); dat->postrou=atol(line);
break; break;
case 28:
dat->fix_trou1=atol(line);
break;
case 29:
dat->fix_trou2=atol(line);
break;
} /* end of switch */ } /* end of switch */
} /* end of the input file */ } /* end of the input file */
@ -232,7 +238,7 @@ void Data_new(FILE* file, Data* dat) {
//return dat; //return dat;
} }
PetscBool to_bool(const char* str) { _Bool to_bool(const char* str) {
PetscBool strflg; PetscBool strflg;
PetscStrcmp("true\n",str, &strflg); PetscStrcmp("true\n",str, &strflg);
if(!strflg) PetscStrcmp("True\n",str, &strflg); if(!strflg) PetscStrcmp("True\n",str, &strflg);

View File

@ -6,13 +6,13 @@
#include <petscsys.h> #include <petscsys.h>
#include <slepceps.h> #include <slepceps.h>
PetscBool to_bool(const char* str); _Bool to_bool(const char* str);
typedef struct { typedef struct {
PetscInt n; PetscInt n;
long int nnz,npar; long int nnz,npar;
long int ntrou,isz; long int ntrou,isz;
PetscBool FAM1; _Bool FAM1;
long int l1[700]; long int l1[700];
long int l2[700]; long int l2[700];
long int ktyp[700]; long int ktyp[700];
@ -33,7 +33,9 @@ typedef struct {
int s23a2; int s23a2;
int s23b1; int s23b1;
int s23b2; int s23b2;
int postrou; long int postrou;
long int fix_trou1;
long int fix_trou2;
} Data ; } Data ;

View File

@ -9,10 +9,14 @@
tcountcol, & tcountcol, &
tntrou, & tntrou, &
tisz, & tisz, &
tfix_trou1, &
tfix_trou2, &
tfam1, & tfam1, &
tcol,tval) tcol,tval)
implicit none implicit none
integer,INTENT(INOUT)::tistart, tnrows, tntrou, tisz integer,INTENT(INOUT)::tistart, tnrows
integer,INTENT(INOUT)::tntrou, tisz
integer,INTENT(INOUT)::tfix_trou1, tfix_trou2
logical*1,INTENT(INOUT)::tfam1 logical*1,INTENT(INOUT)::tfam1
integer::i integer::i
real*8,INTENT(INOUT)::tval(maxlien) real*8,INTENT(INOUT)::tval(maxlien)
@ -34,6 +38,8 @@
ntrou = tntrou ntrou = tntrou
isz = tisz isz = tisz
FAM1 = tfam1 FAM1 = tfam1
fix_trou1 = tfix_trou1
fix_trou2 = tfix_trou2
tcol=0 tcol=0
tval=0d0 tval=0d0
provide l1 l2 ktyp xtt xjjxy xjjz ntrou provide l1 l2 ktyp xtt xjjxy xjjz ntrou