HΦ  3.2.0
CalcByFullDiag.c File Reference
#include "CalcByFullDiag.h"
#include "input.h"
#include "wrapperMPI.h"
#include "CalcTime.h"
+ Include dependency graph for CalcByFullDiag.c:

Go to the source code of this file.

Functions

int CalcByFullDiag (struct EDMainCalStruct *X)
 Parent function for FullDiag mode. More...
 

Function Documentation

◆ CalcByFullDiag()

int CalcByFullDiag ( struct EDMainCalStruct X)

Parent function for FullDiag mode.

Parameters
X[in,out] Struct to get information about file header names, dimension of hirbert space, calc type, physical quantities.
Return values
TRUE(=1)normally finished.
FALSE(=0)abnormally finished.

Definition at line 26 of file CalcByFullDiag.c.

References EDMainCalStruct::Bind, BindStruct::Check, cLogFinish, cLogFullDiag_End, cLogFullDiag_ExpecValue_End, cLogFullDiag_ExpecValue_Start, cLogFullDiag_InputHam_End, cLogFullDiag_InputHam_Start, cLogFullDiag_OutputHam_End, cLogFullDiag_OutputHam_Start, cLogFullDiag_SetHam_End, cLogFullDiag_SetHam_Start, cLogFullDiag_Start, BindStruct::Def, FALSE, CheckList::idim_max, DefineList::iInputHam, inputHam(), DefineList::iOutputHam, lapack_diag(), makeHam(), output(), outputHam(), phys(), DefineList::St, StartTimer(), stdoutMPI, StopTimer(), and TRUE.

Referenced by main().

29 {
30  int iret=0;
31  fprintf(stdoutMPI, "%s", cLogFullDiag_SetHam_Start);
32  StartTimer(5100);
33  if(X->Bind.Def.iInputHam==FALSE){
34  makeHam(&(X->Bind));
35  }
36  else if(X->Bind.Def.iInputHam==TRUE){
37  fprintf(stdoutMPI, "%s", cLogFullDiag_InputHam_Start);
38  inputHam(&(X->Bind));
39  fprintf(stdoutMPI, "%s", cLogFullDiag_InputHam_End);
40  }
41  StopTimer(5100);
42  fprintf(stdoutMPI, "%s", cLogFullDiag_SetHam_End);
43  if(iret != 0) return FALSE;
44 
45 
46  if(X->Bind.Def.iOutputHam == TRUE){
48  StartTimer(5500);
49  iret=outputHam(&(X->Bind));
50  StopTimer(5500);
51  fprintf(stdoutMPI, "%s", cLogFullDiag_OutputHam_End);
52  if(iret != 0) return FALSE;
53  return TRUE;
54  }
55 
56  fprintf(stdoutMPI, "%s", cLogFullDiag_Start);
57  StartTimer(5200);
58  iret=lapack_diag(&(X->Bind));
59  StopTimer(5200);
60  fprintf(stdoutMPI, "%s", cLogFullDiag_End);
61  if(iret != 0) return FALSE;
62 
63  X->Bind.Def.St=0;
65  StartTimer(5300);
66  phys(&(X->Bind), X->Bind.Check.idim_max);
67  StopTimer(5300);
68  fprintf(stdoutMPI, "%s", cLogFullDiag_ExpecValue_End);
69 
70  StartTimer(5400);
71  iret=output(&(X->Bind));
72  StopTimer(5400);
73  fprintf(stdoutMPI, "%s", cLogFinish);
74  if(iret != 0) return FALSE;
75 
76  return TRUE;
77 }
int iInputHam
Definition: struct.h:205
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
int St
0 or 1, but it affects nothing.
Definition: struct.h:80
void StartTimer(int n)
function for initializing elapse time [start]
Definition: time.c:71
const char * cLogFullDiag_Start
unsigned long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.h:303
int output(struct BindStruct *X)
output function for FullDiag mode
Definition: output.c:27
void StopTimer(int n)
function for calculating elapse time [elapse time=StartTimer-StopTimer]
Definition: time.c:83
const char * cLogFullDiag_ExpecValue_Start
int lapack_diag(struct BindStruct *X)
performing full diagonalization using lapack
Definition: lapack_diag.c:35
void phys(struct BindStruct *X, unsigned long int neig)
A main function to calculate physical quantities by full diagonalization method.
Definition: phys.c:48
const char * cLogFullDiag_SetHam_Start
const char * cLogFullDiag_SetHam_End
int makeHam(struct BindStruct *X)
Making Hamiltonian for the full diagonalization method. The Hamiltonian is stored in the two dimensio...
Definition: makeHam.c:55
#define TRUE
Definition: global.h:26
const char * cLogFullDiag_End
const char * cLogFullDiag_ExpecValue_End
int inputHam(struct BindStruct *X)
Definition: input.c:20
const char * cLogFullDiag_InputHam_Start
const char * cLogFullDiag_OutputHam_End
int outputHam(struct BindStruct *X)
output Hamiltonian only used for FullDiag mode
Definition: output.c:73
#define FALSE
Definition: global.h:25
const char * cLogFinish
const char * cLogFullDiag_OutputHam_Start
int iOutputHam
Definition: struct.h:204
struct CheckList Check
Size of the Hilbert space.
Definition: struct.h:411
const char * cLogFullDiag_InputHam_End
struct BindStruct Bind
Binded struct.
Definition: struct.h:420
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: