ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
hterm_writer.h
Go to the documentation of this file.
1#ifndef HTERM_WRITER_H
2#define HTERM_WRITER_H
3
6#include "source_cell/klist.h"
13
14#include <complex>
15#include <fstream>
16#include <string>
17#include <vector>
18
19template <typename T, typename Tdata>
21
22namespace ModuleIO
23{
24
26{
27 const UnitCell* ucell = nullptr;
28 const Grid_Driver* gd = nullptr;
29 const Parallel_Orbitals* pv = nullptr;
31 const LCAO_Orbitals* orb = nullptr;
32 const K_Vectors* kv = nullptr;
33 const elecstate::Potential* pot = nullptr; // used by the local-pp term only
34 const Charge* chg = nullptr; // used by the Hartree / XC terms
35 const ModulePW::PW_Basis* rho_basis = nullptr; // used by the Hartree term
36 int nrxx = 0; // used by the XC term
37 int nspin = 1;
38 int istep = 0;
39 bool append = false;
40 const int* iat2iwt = nullptr;
41 int nat = 0;
42 bool also_hR = false; // H(k) is always written; H(R) (CSR) only when this is true
43 int nlocal = 0;
44 int precision = 8; // text precision of the H(k) component matrices (second INPUT value)
45 bool gamma_only_local = false;
46 int npol = 1;
47 bool domag = false;
48 bool domag_z = false;
49 int gga_grad = 0; // used by the XC term
50 int out_app_flag = 0;
51 std::string calculation;
52 std::string global_out_dir;
53 std::string global_matrix_dir;
54 std::string ks_solver;
55 int drank = 0;
56 std::ofstream* ofs_running = nullptr; // running log for the "Write ... to file" messages
57#ifdef __EXX
58 // The gamma-only (TK==double) exx interfaces used by the EXX term.
59 // Deliberately NOT templated on TK, because it would force WriteHParams and
60 // every free function taking it to become templates as well -- a large,
61 // purely mechanical change for a case nobody needs.
62 // Multi-k + EXX is therefore rejected up front (see write_h_exx_term)
63 // instead of silently producing output with the EXX term missing.
66#endif
67};
68
69// Individual Hamiltonian-term writers. write_h_vnl/vl/vh/vxc share a common
70// build -> write H(k) -> optionally write H(R) skeleton (see hterm_writer.cpp);
71// the term-specific part is only how hR_tmp is filled.
72// The kinetic T(k) output is handled by the out_mat_tk path in ctrl_scf_lcao,
73// so there is no write_h_t here.
74void write_h_vnl(WriteHParams& params);
75
76void write_h_vl(WriteHParams& params);
77
78void write_h_vh(WriteHParams& params);
79
80void write_h_vxc(WriteHParams& params);
81
82#ifdef __EXX
83// Build V^EXX(R) into a real HContainer via add_HexxR (from exd/exc->get_Hexxs()) and write it.
84// exd (real Hexx) and exc (complex Hexx) are mutually exclusive; picked by info_ri.real_number.
85void write_h_exx(WriteHParams& params, const Exx_Info& exx_info);
86#endif
87
88} // namespace ModuleIO
89
90#endif
Definition charge.h:24
Definition exx_lri_interface.h:43
Grid_Driver class for neighbor search interface.
Definition sltk_grid_driver.h:63
Class for k-points management.
Definition klist.h:20
Definition orb_read.h:18
A class which can convert a function of "r" to the corresponding linear superposition of plane waves ...
Definition pw_basis.h:60
Definition parallel_orbitals.h:16
Definition two_center_bundle.h:11
Provide the basic information about unitcell.
Definition unitcell.h:16
Definition potential_new.h:58
Internal helpers shared by the R-space sparse text writers. Declared here (instead of duplicated in e...
Definition csr_reader.cpp:8
void write_h_vl(WriteHParams &params)
Definition hterm_writer.cpp:431
void write_h_vxc(WriteHParams &params)
Definition hterm_writer.cpp:496
void write_h_vh(WriteHParams &params)
Definition hterm_writer.cpp:460
void write_h_vnl(WriteHParams &params)
Definition hterm_writer.cpp:406
Grid_Driver class for neighbor search interface.
Definition exx_info.h:10
Definition hterm_writer.h:26
const UnitCell * ucell
Definition hterm_writer.h:27
const elecstate::Potential * pot
Definition hterm_writer.h:33
std::string ks_solver
Definition hterm_writer.h:54
const Grid_Driver * gd
Definition hterm_writer.h:28
int out_app_flag
Definition hterm_writer.h:50
int npol
Definition hterm_writer.h:46
std::ofstream * ofs_running
Definition hterm_writer.h:56
const Charge * chg
Definition hterm_writer.h:34
const TwoCenterBundle * two_center_bundle
Definition hterm_writer.h:30
std::string global_out_dir
Definition hterm_writer.h:52
const K_Vectors * kv
Definition hterm_writer.h:32
int nspin
Definition hterm_writer.h:37
bool gamma_only_local
Definition hterm_writer.h:45
bool append
Definition hterm_writer.h:39
int istep
Definition hterm_writer.h:38
int gga_grad
Definition hterm_writer.h:49
const int * iat2iwt
Definition hterm_writer.h:40
std::string calculation
Definition hterm_writer.h:51
int precision
Definition hterm_writer.h:44
bool also_hR
Definition hterm_writer.h:42
const ModulePW::PW_Basis * rho_basis
Definition hterm_writer.h:35
int nat
Definition hterm_writer.h:41
const LCAO_Orbitals * orb
Definition hterm_writer.h:31
int nrxx
Definition hterm_writer.h:36
bool domag
Definition hterm_writer.h:47
const Parallel_Orbitals * pv
Definition hterm_writer.h:29
int nlocal
Definition hterm_writer.h:43
std::string global_matrix_dir
Definition hterm_writer.h:53
int drank
Definition hterm_writer.h:55
bool domag_z
Definition hterm_writer.h:48