#include "output.h"
#include "FileIO.h"
#include "wrapperMPI.h"
Go to the source code of this file.
◆ output()
output function for FullDiag mode
- Parameters
-
[in] | X | Struct to get information about file header names, dimension of hirbert space, calc type, physical quantities. |
- Return values
-
0 | normally finished. |
-1 | abnormally finished. |
Definition at line 27 of file output.c.
References cFileNamePhys_FullDiag, cFileNamePhys_FullDiag_GC, childfopenMPI(), D_FileNameMax, stdoutMPI, and X.
Referenced by CalcByFullDiag().
32 i_max =
X->Check.idim_max;
34 if (
X->Def.iCalcType == FullDiag) {
35 switch (
X->Def.iCalcModel) {
52 fprintf(fp,
" <H> <N> <Sz> <S2> <D> \n");
53 for (i = 0; i < i_max; i++) {
54 fprintf(fp,
" %10lf %10lf %10lf %10lf %10lf\n",
X->Phys.all_energy[i],
X->Phys.all_num_up[i]+
X->Phys.all_num_down[i],
X->Phys.all_sz[i],
55 X->Phys.all_s2[i],
X->Phys.all_doublon[i]);
60 fprintf(
stdoutMPI,
"Error: output function is used only for FullDiag mode.");
const char * cFileNamePhys_FullDiag
const char * cFileNamePhys_FullDiag_GC
int childfopenMPI(const char *_cPathChild, const char *_cmode, FILE **_fp)
Only the root process open file in output/ directory.
FILE * stdoutMPI
File pointer to the standard output defined in InitializeMPI()
◆ outputHam()
output Hamiltonian only used for FullDiag mode
- Note
- global: [in] Ham
- Parameters
-
[in] | X | Struct to get information about file header names, dimension of hirbert space. |
- Return values
-
0 | normally finished. |
-1 | abnormally finished. |
Definition at line 73 of file output.c.
References cFileNamePhys_FullDiag_Ham, childfopenMPI(), D_FileNameMax, Ham, and X.
Referenced by CalcByFullDiag().
76 long int imax =
X->Check.idim_max;
82 #pragma omp parallel for default(none) reduction(+:ihermite) firstprivate(imax) private(i, j) shared(Ham) 83 for (i=1; i<=imax; i++){
85 if(cabs(
Ham[i][j])>1.0e-13){
91 strcpy(cHeader,
"%%%%MatrixMarket matrix coordinate complex hermitian\n");
96 fprintf(fp,
"%s", cHeader);
97 fprintf(fp,
"%ld %ld %ld \n", imax, imax, ihermite);
98 for (i=1; i<=imax; i++){
100 if(cabs(
Ham[i][j])>1.0e-13){
101 fprintf(fp,
"%ld %ld %lf %lf\n",i,j,creal(
Ham[i][j]),cimag(
Ham[i][j]));
int childfopenMPI(const char *_cPathChild, const char *_cmode, FILE **_fp)
Only the root process open file in output/ directory.
const char * cFileNamePhys_FullDiag_Ham