HΦ  3.2.0
output_list.c File Reference

Output list_1 for canonical ensembles obtained in sz.c. More...

#include "output_list.h"
#include "FileIO.h"
#include "wrapperMPI.h"
+ Include dependency graph for output_list.c:

Go to the source code of this file.

Functions

int output_list (struct BindStruct *X)
 Output list_1 for canonical ensembles. More...
 

Detailed Description

Output list_1 for canonical ensembles obtained in sz.c.

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)

Definition in file output_list.c.

Function Documentation

◆ output_list()

int output_list ( struct BindStruct X)

Output list_1 for canonical ensembles.

Parameters
X[in] Struct to get the dimension of the target Hilbert space and the information for making the output file name.
Return values
-1fail to output the list.
0success to output the list.
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)

Definition at line 40 of file output_list.c.

References cFileNameListModel, BindStruct::Check, childfopenMPI(), cProEndOutputList, cProStartOutputList, D_FileNameMax, BindStruct::Def, DefineList::iCalcModel, CheckList::idim_max, list_1, DefineList::Ndown, DefineList::Ne, DefineList::Nsite, DefineList::Nup, and stdoutMPI.

Referenced by main().

40  {
41 
42  FILE *fp;
43  char sdt[D_FileNameMax];
44  int i,i_max;
45 
46  fprintf(stdoutMPI, "%s", cProStartOutputList);
47  i_max=X->Check.idim_max;
48  switch(X->Def.iCalcModel){
49  case HubbardGC:
50  case Hubbard:
51  case Spin:
52  case SpinGC:
53  sprintf(sdt, cFileNameListModel, X->Def.Nsite,X->Def.Nup,X->Def.Ndown);
54  break;
55  case Kondo:
56  case KondoGC:
57  sprintf(sdt, "ListForKondo_Ns%d_Ncond%d", X->Def.Nsite,X->Def.Ne);
58  break;
59  default:
60  return -1;
61  }
62  if(childfopenMPI(sdt,"w",&fp)!=0){
63  return -1;
64  }
65  for(i=1;i<=i_max;i++){
66  fprintf(fp," %lu \n",list_1[i]);
67  }
68  fclose(fp);
69 
70  fprintf(stdoutMPI, "%s", cProEndOutputList);
71  return 0;
72 }
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
unsigned long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.h:303
const char * cProStartOutputList
#define D_FileNameMax
Definition: global.h:23
int childfopenMPI(const char *_cPathChild, const char *_cmode, FILE **_fp)
Only the root process open file in output/ directory.
Definition: FileIO.c:27
unsigned int Nup
Number of spin-up electrons in this process.
Definition: struct.h:58
const char * cProEndOutputList
const char * cFileNameListModel
Definition: global.c:48
unsigned int Ndown
Number of spin-down electrons in this process.
Definition: struct.h:59
unsigned int Nsite
Number of sites in the INTRA process region.
Definition: struct.h:56
long unsigned int * list_1
Definition: global.h:47
unsigned int Ne
Number of electrons in this process.
Definition: struct.h:71
int iCalcModel
Switch for model. 0:Hubbard, 1:Spin, 2:Kondo, 3:HubbardGC, 4:SpinGC, 5:KondoGC, 6:HubbardNConserved.
Definition: struct.h:198
struct CheckList Check
Size of the Hilbert space.
Definition: struct.h:411
FILE * stdoutMPI
File pointer to the standard output defined in InitializeMPI()
Definition: global.h:165
+ Here is the call graph for this function:
+ Here is the caller graph for this function: