ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
gint_rho.h
Go to the documentation of this file.
1#ifndef ABACUS_SOURCE_HAMILT_MODULE_GINT_GINT_RHO_H
2#define ABACUS_SOURCE_HAMILT_MODULE_GINT_GINT_RHO_H
3
4#include "gint.h"
5#include "gint_info.h"
7#include <memory>
8#include <vector>
9
10namespace ModuleGint
11{
12
13class Gint_rho : public Gint
14{
15 public:
17 const std::vector<HContainer<double> *> &dm_vec,
18 const int nspin,
19 double **rho,
20 bool is_dm_symm = true)
21 : dm_vec_(dm_vec), nspin_(nspin), is_dm_symm_(is_dm_symm), rho_(rho)
22 {
23 }
24
25 void cal_gint();
26
27 private:
28 template <typename Real>
29 void cal_gint_impl_();
30
31 template <typename Real>
32 std::vector<HContainer<Real>> init_dm_gint_() const;
33
34 // rho is always accumulated in double (see phi_dot_phi). When Real=float,
35 // only phi and phi_dm are fp32; the per-meshgrid reduction is fp64.
36 template <typename Real>
37 void cal_rho_(const std::vector<HContainer<Real>> &dm_gint_vec, const std::vector<double *> &rho_data) const;
38
39 // input
40 const std::vector<HContainer<double> *> dm_vec_;
41 const int nspin_;
42
43 // if true, it means the DMR matrix is symmetric,
44 // which leads to faster computations compared to the asymmetric case.
45 const bool is_dm_symm_;
46
47 // output
48 double **rho_ = nullptr;
49};
50
51} // namespace ModuleGint
52
53#endif // ABACUS_SOURCE_HAMILT_MODULE_GINT_GINT_RHO_H
const std::vector< HContainer< double > * > dm_vec_
Definition gint_rho.h:40
Gint_rho(const std::vector< HContainer< double > * > &dm_vec, const int nspin, double **rho, bool is_dm_symm=true)
Definition gint_rho.h:16
void cal_gint()
Definition gint_rho.cpp:9
std::vector< HContainer< Real > > init_dm_gint_() const
Definition gint_rho.cpp:41
void cal_gint_impl_()
Definition gint_rho.cpp:27
void cal_rho_(const std::vector< HContainer< Real > > &dm_gint_vec, const std::vector< double * > &rho_data) const
Definition gint_rho.cpp:52
const bool is_dm_symm_
Definition gint_rho.h:45
double ** rho_
Definition gint_rho.h:48
const int nspin_
Definition gint_rho.h:41
Definition batch_biggrid.cpp:4
hamilt::HContainer< T > HContainer
Definition gint_type.h:15