2
0
mirror of https://github.com/LCPQ/DEHam synced 2024-06-18 19:25:27 +02: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

@ -127,13 +127,15 @@ int main(int argc,char **argv)
getdata.l2,
getdata.ktyp,
&iii,
&getdata.nnz,
&getdata.nnz,
getdata.xjjxy,
getdata.xjjz ,
getdata.xtt ,
tcountcol,
&getdata.ntrou,
&getdata.isz,
&getdata.fix_trou1,
&getdata.fix_trou2,
&getdata.FAM1,
tcol,
val);

View File

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

View File

@ -97,6 +97,9 @@ BEGIN_PROVIDER [integer, natom]
write(6,*)'HAMILTONIEN t-J'
write(6,*)'Le nombre de trou est : ',ntrou
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,*)' '

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)
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))
write(6,*)'nt1',nt1
END_PROVIDER

View File

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

View File

@ -1,12 +1,14 @@
BEGIN_PROVIDER[integer,l1, (maxlien)]
&BEGIN_PROVIDER[integer,l2, (maxlien)]
&BEGIN_PROVIDER[integer,ktyp,(maxlien)]
&BEGIN_PROVIDER [real*8, xtt ,(maxlien)]
&BEGIN_PROVIDER[real*8, xtt ,(maxlien)]
&BEGIN_PROVIDER[real*8, xjjz ,(maxlien)]
&BEGIN_PROVIDER[real*8, xjjxy,(maxlien)]
&BEGIN_PROVIDER [integer, ntrou]
&BEGIN_PROVIDER [integer, isz]
&BEGIN_PROVIDER [logical*1, FAM1]
&BEGIN_PROVIDER[integer, ntrou]
&BEGIN_PROVIDER[integer, isz]
&BEGIN_PROVIDER[logical*1, FAM1]
&BEGIN_PROVIDER[integer, fix_trou1]
&BEGIN_PROVIDER[integer, fix_trou2]
implicit none
! integer::i
! 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
presence would allow to handle lines longer that sizeof(line) */
if (count != 26){
if (count != 29){
count++;
switch(count){
case 1:
@ -223,6 +223,12 @@ void Data_new(FILE* file, Data* dat) {
case 27:
dat->postrou=atol(line);
break;
case 28:
dat->fix_trou1=atol(line);
break;
case 29:
dat->fix_trou2=atol(line);
break;
} /* end of switch */
} /* end of the input file */
@ -232,7 +238,7 @@ void Data_new(FILE* file, Data* dat) {
//return dat;
}
PetscBool to_bool(const char* str) {
_Bool to_bool(const char* str) {
PetscBool strflg;
PetscStrcmp("true\n",str, &strflg);
if(!strflg) PetscStrcmp("True\n",str, &strflg);

View File

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

View File

@ -9,10 +9,14 @@
tcountcol, &
tntrou, &
tisz, &
tfix_trou1, &
tfix_trou2, &
tfam1, &
tcol,tval)
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
integer::i
real*8,INTENT(INOUT)::tval(maxlien)
@ -34,6 +38,8 @@
ntrou = tntrou
isz = tisz
FAM1 = tfam1
fix_trou1 = tfix_trou1
fix_trou2 = tfix_trou2
tcol=0
tval=0d0
provide l1 l2 ktyp xtt xjjxy xjjz ntrou