ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
chg_uspp.h
Go to the documentation of this file.
1#ifndef CHG_USPP_H
2#define CHG_USPP_H
3
4// Stateless double-grid split/merge helpers extracted from Charge_Mixing.
5//
6// "dgrid" = double grid, the dense/smooth grid pair used by ultrasoft (USPP)
7// and PAW calculations to capture the high-frequency tail of the
8// augmentation charge beyond the smooth (soft) plane-wave grid. The dense
9// grid (npw_dense) is the union of the smooth grid (npw_smooth) and the
10// high-frequency tail (npw_dense - npw_smooth).
11//
12// These functions do not read Charge_Mixing members or PARAM/GlobalV; all
13// inputs are passed explicitly. Memory is managed by the caller through
14// std::vector, so no new/delete pair is needed and no clean-up function
15// exists.
16
17#include <complex>
18#include <vector>
19
20namespace module_charge
21{
22
41void split_dgrid(const std::complex<double>* data_d,
42 std::vector<std::complex<double>>& data_s,
43 std::vector<std::complex<double>>& data_hf,
44 int nspin,
45 int npw_smooth,
46 int npw_dense);
47
64void merge_dgrid(std::complex<double>* data_d,
65 const std::vector<std::complex<double>>& data_s,
66 const std::vector<std::complex<double>>& data_hf,
67 int nspin,
68 int npw_smooth,
69 int npw_dense);
70
71} // namespace module_charge
72
73#endif // CHG_USPP_H
Charge-density symmetrization free functions.
Definition charge.h:18
void split_dgrid(const std::complex< double > *data_d, std::vector< std::complex< double > > &data_s, std::vector< std::complex< double > > &data_hf, int nspin, int npw_smooth, int npw_dense)
Split dense reciprocal-space data into smooth and high-frequency parts on the USPP double grid.
Definition chg_uspp.cpp:12
void merge_dgrid(std::complex< double > *data_d, const std::vector< std::complex< double > > &data_s, const std::vector< std::complex< double > > &data_hf, int nspin, int npw_smooth, int npw_dense)
Merge smooth and high-frequency parts back into dense reciprocal- space data. Inverse of split_dgrid.
Definition chg_uspp.cpp:71