ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
cal_ldos.h
Go to the documentation of this file.
1#ifndef CAL_LDOS_H
2#define CAL_LDOS_H
3
6
7#include "source_estate/fp_energy.h" // eferm
9#include "source_lcao/allocate_dm.h" // module_dm::Setup_DM
10#include "source_cell/klist.h" // K_Vectors
12#include "source_base/matrix.h" // matrix
13
14#include <fstream>
15
16namespace ModuleIO
17{
18template <typename T>
20{
21 public:
24
25 static void cal_ldos_lcao(
26 const elecstate::Efermi &eferm, // mohan add 2025-11-02
27 const Charge &chr, // mohan add add 2025-11-02
28 const module_dm::Setup_DM<T> &dmat, // mohan add 2025-11-02
29 const K_Vectors &kv, // k points, mohan add 2025-11-02
30 const ModuleBase::matrix &ekb, // mohan add 2025-11-02
31 const ModuleBase::matrix &wg, // mohan add 2025-11-02
32 const psi::Psi<T>& psi,
33 const Parallel_Grid& pgrid,
34 const Parallel_Orbitals& pv,
35 const Grid_Driver& grid_driver,
36 const UnitCell& ucell,
37 const std::vector<double>& stm_bias,
38 const int nspin,
39 const int istep,
40 const std::string& global_out_dir,
41 const bool two_fermi,
42 const int out_ldos_precision,
43 std::ofstream& ofs_running);
44
45}; // namespace Cal_ldos
46
47template <typename Device>
48void cal_ldos_pw(const elecstate::ElecStatePW<std::complex<double>>* pelec,
49 const psi::Psi<std::complex<double>, Device>& psi,
50 const Device* ctx,
51 const Parallel_Grid& pgrid,
52 const UnitCell& ucell,
53 const std::vector<int>& out_ldos,
54 const std::vector<double>& stm_bias,
55 const int nspin,
56 const int istep,
57 const std::string& global_out_dir,
58 const bool two_fermi,
59 const int nbands,
60 const double dos_edelta_ev,
61 const double dos_scale,
62 const bool dos_setemax,
63 const double dos_emax_ev,
64 const bool dos_setemin,
65 const double dos_emin_ev,
66 const double dos_sigma,
67 const std::vector<double>& ldos_line,
68 std::ofstream& ofs_running);
69
70template <typename Device>
71void stm_mode_pw(const elecstate::ElecStatePW<std::complex<double>>* pelec,
72 const psi::Psi<std::complex<double>, Device>& psi,
73 const Device* ctx,
74 const Parallel_Grid& pgrid,
75 const UnitCell& ucell,
76 const std::vector<double>& stm_bias,
77 const int nspin,
78 const int istep,
79 const std::string& global_out_dir,
80 const bool two_fermi,
81 const int out_ldos_precision,
82 std::ofstream& ofs_running);
83
84template <typename Device>
85void ldos_mode_pw(const elecstate::ElecStatePW<std::complex<double>>* pelec,
86 const psi::Psi<std::complex<double>, Device>& psi,
87 const Device* ctx,
88 const Parallel_Grid& pgrid,
89 const UnitCell& ucell,
90 const int istep,
91 const std::string& global_out_dir,
92 const int nbands,
93 const double dos_edelta_ev,
94 const double dos_scale,
95 const bool dos_setemax,
96 const double dos_emax_ev,
97 const bool dos_setemin,
98 const double dos_emin_ev,
99 const bool two_fermi,
100 const double dos_sigma,
101 const std::vector<double>& ldos_line,
102 std::ofstream& ofs_running);
103
104/*
105 * @brief Get grid points and shifts for interpolation.
106 *
107 * @param start The starting point of the line.
108 * @param end The ending point of the line.
109 * @param npoints The number of points in the line.
110 * @param nx The dimension of 3D grids in the x direction.
111 * @param ny The dimension of 3D grids in the y direction.
112 * @param nz The dimension of 3D grids in the z direction.
113 * @param points The grid index that the points in the line are placed in.
114 * @param shifts The shifts along three directions due to the points are not on the grid exactly.
115 */
116void get_grid_points(const std::vector<double>& start,
117 const std::vector<double>& end,
118 const int& npoints,
119 const int& nx,
120 const int& ny,
121 const int& nz,
122 std::vector<std::vector<int>>& points,
123 std::vector<std::vector<double>>& shifts);
124
125/*
126 * @brief Trilinear interpolation of data on a 3D grid.
127 *
128 * @param points The grid points for interpolation.
129 * @param shifts The shifts for interpolation.
130 * @param pgrid The parallel grid object.
131 * @param data The data to be interpolated.
132 * @param results The results of the interpolation.
133 */
134void trilinear_interpolate(const std::vector<std::vector<int>>& points,
135 const std::vector<std::vector<double>>& shifts,
136 const Parallel_Grid& pgrid,
137 const std::vector<double>& data,
138 std::vector<double>& results);
139
140} // namespace ModuleIO
141
142#endif // CAL_LDOS_H
Definition charge.h:24
Grid_Driver class for neighbor search interface.
Definition sltk_grid_driver.h:63
Class for k-points management.
Definition klist.h:20
Definition matrix.h:15
Cal_ldos()
Definition cal_ldos.h:22
static void cal_ldos_lcao(const elecstate::Efermi &eferm, const Charge &chr, const module_dm::Setup_DM< T > &dmat, const K_Vectors &kv, const ModuleBase::matrix &ekb, const ModuleBase::matrix &wg, const psi::Psi< T > &psi, const Parallel_Grid &pgrid, const Parallel_Orbitals &pv, const Grid_Driver &grid_driver, const UnitCell &ucell, const std::vector< double > &stm_bias, const int nspin, const int istep, const std::string &global_out_dir, const bool two_fermi, const int out_ldos_precision, std::ofstream &ofs_running)
~Cal_ldos()
Definition cal_ldos.h:23
Definition parallel_grid.h:8
Definition parallel_orbitals.h:16
Provide the basic information about unitcell.
Definition unitcell.h:16
Definition elecstate_pw.h:21
Definition dm_holder.h:10
Definition psi.h:37
This file contains all energies about first-principle calculations.
Internal helpers shared by the R-space sparse text writers. Declared here (instead of duplicated in e...
Definition csr_reader.cpp:8
void trilinear_interpolate(const std::vector< std::vector< int > > &points, const std::vector< std::vector< double > > &shifts, const Parallel_Grid &pgrid, const std::vector< double > &data, std::vector< double > &results)
Definition cal_ldos.cpp:427
void cal_ldos_pw(const elecstate::ElecStatePW< std::complex< double > > *pelec, const psi::Psi< std::complex< double >, Device > &psi, const Device *ctx, const Parallel_Grid &pgrid, const UnitCell &ucell, const std::vector< int > &out_ldos, const std::vector< double > &stm_bias, const int nspin, const int istep, const std::string &global_out_dir, const bool two_fermi, const int nbands, const double dos_edelta_ev, const double dos_scale, const bool dos_setemax, const double dos_emax_ev, const bool dos_setemin, const double dos_emin_ev, const double dos_sigma, const std::vector< double > &ldos_line, std::ofstream &ofs_running)
Definition cal_ldos.cpp:122
void ldos_mode_pw(const elecstate::ElecStatePW< std::complex< double > > *pelec, const psi::Psi< std::complex< double >, Device > &psi, const Device *ctx, const Parallel_Grid &pgrid, const UnitCell &ucell, const int istep, const std::string &global_out_dir, const int nbands, const double dos_edelta_ev, const double dos_scale, const bool dos_setemax, const double dos_emax_ev, const bool dos_setemin, const double dos_emin_ev, const bool two_fermi, const double dos_sigma, const std::vector< double > &ldos_line, std::ofstream &ofs_running)
Definition cal_ldos.cpp:242
void get_grid_points(const std::vector< double > &start, const std::vector< double > &end, const int &npoints, const int &nx, const int &ny, const int &nz, std::vector< std::vector< int > > &points, std::vector< std::vector< double > > &shifts)
Definition cal_ldos.cpp:377
void stm_mode_pw(const elecstate::ElecStatePW< std::complex< double > > *pelec, const psi::Psi< std::complex< double >, Device > &psi, const Device *ctx, const Parallel_Grid &pgrid, const UnitCell &ucell, const std::vector< double > &stm_bias, const int nspin, const int istep, const std::string &global_out_dir, const bool two_fermi, const int out_ldos_precision, std::ofstream &ofs_running)
Definition cal_ldos.cpp:161
Definition diag_lcao.h:14
Grid_Driver class for neighbor search interface.
Definition fp_energy.h:65
iclock::time_point start
Definition test_partition.cpp:22