forked from deepmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrite_hs_r.h
More file actions
136 lines (119 loc) · 5.21 KB
/
Copy pathwrite_hs_r.h
File metadata and controls
136 lines (119 loc) · 5.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#ifndef WRITE_HS_R_H
#define WRITE_HS_R_H
#include "source_base/matrix.h"
#include "source_basis/module_nao/two_center_bundle.h"
#include "source_cell/klist.h"
#include "source_hamilt/hamilt.h"
#include "source_lcao/lcao_hs_arrays.hpp"
#include "source_lcao/module_dftu/dftu_lcao.h" // mohan add 20251107
#ifdef __EXX
#include "RI/global/Tensor.h" // for RI::Tensor
#endif
namespace ModuleIO
{
void output_dHR(const int& istep,
const ModuleBase::matrix& v_eff,
const UnitCell& ucell,
const Parallel_Orbitals& pv,
LCAO_HS_Arrays& HS_Arrays,
const Grid_Driver& grid, // mohan add 2024-04-06
const TwoCenterBundle& two_center_bundle,
const LCAO_Orbitals& orb,
const K_Vectors& kv,
const bool& binary = false,
const double& sparse_threshold = 1e-10,
const int precision = 16);
void output_dSR(const int& istep,
const UnitCell& ucell,
const Parallel_Orbitals& pv,
LCAO_HS_Arrays& HS_Arrays,
const Grid_Driver& grid, // mohan add 2024-04-06
const TwoCenterBundle& two_center_bundle,
const LCAO_Orbitals& orb,
const K_Vectors& kv,
const bool& binary = false,
const double& sparse_thr = 1e-10,
const int precision = 16);
void output_TR(const int istep,
const UnitCell& ucell,
const Parallel_Orbitals& pv,
LCAO_HS_Arrays& HS_Arrays,
const Grid_Driver& grid,
const TwoCenterBundle& two_center_bundle,
const LCAO_Orbitals& orb,
const std::string& TR_filename = "trs1_nao.csr",
const bool& binary = false,
const double& sparse_threshold = 1e-10,
const int precision = 16);
template <typename TK>
void output_SR(Parallel_Orbitals& pv,
const Grid_Driver& grid,
hamilt::Hamilt<TK>* p_ham,
const std::string& SR_filename = "sr_nao.csr",
const bool& binary = false,
const double& sparse_threshold = 1e-10,
const int precision = 16);
/// Generate filename for spin-dependent HR output.
std::string hsr_gen_fname(const std::string& prefix,
const int ispin,
const bool append,
const int istep);
/// Generate filename for spin-dependent HR output in the selected format.
std::string hsr_gen_fname(const std::string& prefix,
const int ispin,
const bool append,
const int istep,
const int out_type);
/// Generate filename for spin-independent SR output.
std::string sr_gen_fname(const bool append, const int istep);
/// Generate filename for spin-independent SR output in the selected format.
std::string sr_gen_fname(const bool append, const int istep, const int out_type);
/// Generate filename for derivative matrices (dH/dR, dS/dR).
std::string dhr_gen_fname(const std::string& prefix,
const int ispin,
const bool append,
const int istep);
/// Write a single HContainer to CSR file with header.
template <typename TR>
void write_hcontainer_csr(const std::string& fname,
const UnitCell* ucell,
const int precision,
hamilt::HContainer<TR>* mat_serial,
const int istep,
const int ispin,
const int nspin,
const std::string& label,
const std::string& representation_note);
/// Write one HContainer record in the native binary CSR format.
template <typename TR>
void write_hcontainer_csr_binary(const std::string& fname,
hamilt::HContainer<TR>* mat_serial,
const int istep,
const bool append);
/// Write H(R) and S(R) in CSR format, unified with write_dmr interface.
template <typename TR>
void write_hsr(const std::vector<hamilt::HContainer<TR>*>& hr_vec,
const hamilt::HContainer<TR>* sr,
const UnitCell* ucell,
const int out_type,
const int precision,
const Parallel_2D& paraV,
const bool append,
const bool gamma_only,
const int* iat2iwt,
const int nat,
const int istep);
/// Write real-space matrix in CSR format (generic interface).
template <typename TR>
void write_matrix_r(const std::string& matrix_label,
const std::string& description,
const std::vector<hamilt::HContainer<TR>*>& matrices,
const UnitCell* ucell,
const int precision,
const Parallel_2D& paraV,
const bool append,
const int* iat2iwt,
const int nat,
const int istep);
} // namespace ModuleIO
#endif