#include "input.h"
#include "FileIO.h"
#include "wrapperMPI.h"
Go to the source code of this file.
◆ inputHam()
Definition at line 20 of file input.c.
References DefineList::CDataFileHead, cFileNamePhys_FullDiag_Ham, BindStruct::Check, childfopenMPI(), D_FileNameMax, BindStruct::Def, fgetsMPI(), Ham, CheckList::idim_max, and stdoutMPI.
Referenced by CalcByFullDiag().
28 double dHam_re, dHam_im;
29 char ctmp[256], ctmp2[256];
40 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
42 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
43 sscanf(ctmp,
"%ld %ld %ld\n", &itmp, &itmp, &ihermite);
45 fprintf(
stdoutMPI,
"Error: The dimension of input Hamiltonian is wrong: input=%ld, idim=%ld.\n", itmp, imax);
48 for(i=1; i<= ihermite; i++){
49 fgetsMPI(ctmp2,
sizeof(ctmp2) /
sizeof(
char), fp);
50 sscanf(ctmp2,
"%ld %ld %lf %lf\n",
51 &ham_i, &ham_j, &dHam_re, &dHam_im);
52 Ham[ham_i][ham_j]=dHam_re+I*dHam_im;
53 Ham[ham_j][ham_i]=conj(
Ham[ham_i][ham_j]);
struct DefineList Def
Definision of system (Hamiltonian) etc.
unsigned long int idim_max
The dimension of the Hilbert space of this process.
int childfopenMPI(const char *_cPathChild, const char *_cmode, FILE **_fp)
Only the root process open file in output/ directory.
const char * cFileNamePhys_FullDiag_Ham
char * fgetsMPI(char *InputString, int maxcount, FILE *fp)
MPI file I/O (get a line, fgets) wrapper. Only the root node (myrank = 0) reads and broadcast string...
struct CheckList Check
Size of the Hilbert space.
char * CDataFileHead
Read from Calcmod in readdef.h. Header of output file such as Green's function.
FILE * stdoutMPI
File pointer to the standard output defined in InitializeMPI()