Skip to content

Commit

Permalink
mod
Browse files Browse the repository at this point in the history
  • Loading branch information
三澤貴宏 authored and 三澤貴宏 committed Jan 16, 2024
1 parent 6b3cb60 commit dfd6a47
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
9 changes: 6 additions & 3 deletions src/CalcByCanonicalTPQ.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ int CalcByCanonicalTPQ(
rand_max = NumAve;
step_spin = ExpecInterval;

flag_read_invtemp = 1;
if (flag_read_invtemp==1){
strcpy(file_name,"inv_temp.dat");
flag_read_invtemp = X->Bind.Def.flag_read_invtemp;
strcpy(file_name,X->Bind.Def.file_invtemp);
printf("check %d \n",X->Bind.Def.flag_read_invtemp);
printf("check %s \n",file_name);
if (X->Bind.Def.flag_read_invtemp==1){
//strcpy(file_name,"inv_temp.dat");
num_line = func_read_invtemp(read_invtemp,read_nmax,read_physcal,file_name,0); /*count lines of files*/
//[s] allocate
read_invtemp = (double*)malloc(num_line * sizeof(double));
Expand Down
1 change: 1 addition & 0 deletions src/include/readdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#define KWThreeBodyG 21
#define KWFourBodyG 22
#define KWSixBodyG 23
#define KWInvTemp 24

int CheckSite(
const int iListToSite,
Expand Down
3 changes: 3 additions & 0 deletions src/include/struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ struct DefineList {
int **SBody;/**<@brief [DefineList::SBody][24] Indices of six-body correlation function. malloc in setmem_def().*/
unsigned int NSBody;/**<@brief Number of indices of six-body correlation function.*/

int flag_read_invtemp;
char file_invtemp[D_FileNameMax];

int **SingleExcitationOperator;/**<@brief [DefineList::NSingleExcitationOperator][3]
Indices of single excitaion operator for spectrum. malloc in setmem_def().*/
unsigned int NSingleExcitationOperator;/**<@brief Number of single excitaion operator for spectrum.*/
Expand Down
17 changes: 10 additions & 7 deletions src/readdef.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ static char cKWListOfFileNameList[][D_CharTmpReadDef]={
"TETwoBody",
"ThreeBodyG",
"FourBodyG",
"SixBodyG"
"SixBodyG",
"InvTemp"
};

int D_iKWNumDef = sizeof(cKWListOfFileNameList)/sizeof(cKWListOfFileNameList[0]);
Expand Down Expand Up @@ -744,7 +745,13 @@ int ReadDefFileNInt(
fgetsMPI(ctmp2, 256, fp);
sscanf(ctmp2, "%s %d\n", ctmp, &(X->NSBody));
break;


case KWInvTemp:
X->flag_read_invtemp = 1;
strcpy(X->file_invtemp,defname);
printf("CCC %s %s \n", X->file_invtemp,defname);
break;

case KWLaser:
/* Read laser.def--------------------------------*/
fgetsMPI(ctmp, sizeof(ctmp)/sizeof(char), fp);
Expand Down Expand Up @@ -1727,11 +1734,6 @@ int ReadDefFileIdxPara(
}
break;






case KWLaser:
//printf("KWLaser\n");
/*laser.def----------------------------------*/
Expand Down Expand Up @@ -2815,6 +2817,7 @@ void InitializeInteractionNum
X->NTBody=0;
X->NFBody=0;
X->NSBody=0;
X->flag_read_invtemp=0;
X->NSingleExcitationOperator=0;
X->NPairExcitationOperator=0;
//[s] Time Evolution
Expand Down

0 comments on commit dfd6a47

Please sign in to comment.