|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Classes | |
| struct | RhoG3dCtx |
| Context bundling commonly-used data for rho_g3d fill helpers. More... | |
Functions | |
| std::vector< double > | compute_rhoatm (const Atom &atom, int mesh, std::ostream &ofs_warning) |
| Compute the radial atomic charge density rhoatm from pseudopotential. | |
| std::vector< double > | compute_rho_lgl (const Atom &atom, const ModulePW::PW_Basis *rhopw, const UnitCell &ucell, const std::vector< double > &rhoatm, int test_charge, double omega, std::ostream &ofs_warning) |
| Compute the 1D charge in G space from rhoatm. | |
| void | fill_rho_g3d_nspin1 (RhoG3dCtx &ctx) |
| Fill rho_g3d for nspin==1 case. | |
| void | fill_rho_g3d_nspin2 (RhoG3dCtx &ctx, int startmag_type, double start_mag, const Atom &atom) |
| Fill rho_g3d for nspin==2 case (both startmag_type 1 and 2). | |
| void | fill_rho_g3d_nspin4_type1 (RhoG3dCtx &ctx, double start_mag, const Atom &atom, bool domag, bool domag_z) |
| Fill rho_g3d for nspin==4, startmag_type==1 case. | |
| void | fill_rho_g3d_nspin4_type2 (RhoG3dCtx &ctx, const Atom &atom, bool domag, bool domag_z) |
| Fill rho_g3d for nspin==4, startmag_type==2 case. | |
| void | normalize_and_check (double **rho_in, const ModuleBase::ComplexMatrix &rho_g3d, const ModulePW::PW_Basis *rhopw, int spin_number_need, double omega, std::ostream &ofs_warning, double nelec) |
| double | inner_product_recip_rho (const std::complex< double > *rho1, const std::complex< double > *rho2, const ModulePW::PW_Basis &rhopw, const MixingConfig &cfg, const double omega, const double tpiba) |
| Coulomb-metric reciprocal inner product of the charge residual. | |
| template<typename T> | |
| std::function< void(T *, const T *, const T *)> | make_twobeta_mix (const int total, const int nunit, const double mixing_beta, const double mixing_beta_mag) |
| Create a two-beta mixing functor: mix the first nunit elements with mixing_beta and the rest (nunit..total) with mixing_beta_mag. Used for magnetic cases (nspin==2/4) where the charge channel and the magnetism channels use different betas. | |
| template<typename T> | |
| void | pack_rho_mag (T *out, const T *d0, const T *d1, const int n) |
| Pack charge and magnetism into interleaved layout: out[0..n] = d0 + d1 (charge channel) out[n..2n] = d0 - d1 (magnetism channel). | |
| template<typename T> | |
| void | unpack_rho_mag (T *d0, T *d1, const T *in, const int n) |
| Unpack interleaved layout back to charge and magnetism components: d0[i] = 0.5 * (in[i] + in[i+n]) d1[i] = 0.5 * (in[i] - in[i+n]). | |
| void | psymmg (std::complex< double > *rhog_part, const ModulePW::PW_Basis *rho_basis, ModuleSymmetry::Symmetry &symm) |
| Symmetrize one reciprocal-space density component. | |
| void | psymmg_soc (std::complex< double > *rhog_x, std::complex< double > *rhog_y, std::complex< double > *rhog_z, const ModulePW::PW_Basis *rho_basis, ModuleSymmetry::Symmetry &symm) |
| Symmetrize the three coupled reciprocal-space spin components for nspin=4. | |
| void | mix_tau_recip (Charge *chr, const int nspin, const bool double_grid, ModulePW::PW_Basis *rhopw, ModulePW::PW_Basis *rhodpw, Base_Mixing::Mixing *mixing, Base_Mixing::Mixing_Data &tau_mdata, Base_Mixing::Plain_Mixing *mixing_highf) |
| Mix kinetic energy density in reciprocal space. Handles the double-grid split/merge for the smooth and high-frequency parts, DIIS mixing of the smooth part, and plain mixing of the high-frequency part. | |
| std::vector< double > module_charge::detail::compute_rho_lgl | ( | const Atom & | atom, |
| const ModulePW::PW_Basis * | rhopw, | ||
| const UnitCell & | ucell, | ||
| const std::vector< double > & | rhoatm, | ||
| int | test_charge, | ||
| double | omega, | ||
| std::ostream & | ofs_warning ) |
Compute the 1D charge in G space from rhoatm.
| std::vector< double > module_charge::detail::compute_rhoatm | ( | const Atom & | atom, |
| int | mesh, | ||
| std::ostream & | ofs_warning ) |
Compute the radial atomic charge density rhoatm from pseudopotential.
| void module_charge::detail::fill_rho_g3d_nspin1 | ( | RhoG3dCtx & | ctx | ) |
Fill rho_g3d for nspin==1 case.
| void module_charge::detail::fill_rho_g3d_nspin2 | ( | RhoG3dCtx & | ctx, |
| int | startmag_type, | ||
| double | start_mag, | ||
| const Atom & | atom ) |
Fill rho_g3d for nspin==2 case (both startmag_type 1 and 2).
| void module_charge::detail::fill_rho_g3d_nspin4_type1 | ( | RhoG3dCtx & | ctx, |
| double | start_mag, | ||
| const Atom & | atom, | ||
| bool | domag, | ||
| bool | domag_z ) |
Fill rho_g3d for nspin==4, startmag_type==1 case.
| void module_charge::detail::fill_rho_g3d_nspin4_type2 | ( | RhoG3dCtx & | ctx, |
| const Atom & | atom, | ||
| bool | domag, | ||
| bool | domag_z ) |
Fill rho_g3d for nspin==4, startmag_type==2 case.
| double module_charge::detail::inner_product_recip_rho | ( | const std::complex< double > * | rho1, |
| const std::complex< double > * | rho2, | ||
| const ModulePW::PW_Basis & | rhopw, | ||
| const MixingConfig & | cfg, | ||
| const double | omega, | ||
| const double | tpiba ) |
Coulomb-metric reciprocal inner product of the charge residual.
| rho1 | first reciprocal-space vector |
| rho2 | second reciprocal-space vector |
| rhopw | plane-wave basis supplying npw/gg and the G=0 index |
| cfg | mixing config (spin channels, gamma-only and magnetism flags) |
| omega | cell volume |
| tpiba | 2*pi/lattice constant |
| std::function< void(T *, const T *, const T *)> module_charge::detail::make_twobeta_mix | ( | const int | total, |
| const int | nunit, | ||
| const double | mixing_beta, | ||
| const double | mixing_beta_mag ) |
Create a two-beta mixing functor: mix the first nunit elements with mixing_beta and the rest (nunit..total) with mixing_beta_mag. Used for magnetic cases (nspin==2/4) where the charge channel and the magnetism channels use different betas.
| T | element type, double (real space) or std::complex<double> (reciprocal) |
| total | total number of elements |
| nunit | number of elements in the charge channel |
| mixing_beta | beta for the charge channel |
| mixing_beta_mag | beta for the magnetism channel |
| void module_charge::detail::mix_tau_recip | ( | Charge * | chr, |
| const int | nspin, | ||
| const bool | double_grid, | ||
| ModulePW::PW_Basis * | rhopw, | ||
| ModulePW::PW_Basis * | rhodpw, | ||
| Base_Mixing::Mixing * | mixing, | ||
| Base_Mixing::Mixing_Data & | tau_mdata, | ||
| Base_Mixing::Plain_Mixing * | mixing_highf ) |
Mix kinetic energy density in reciprocal space. Handles the double-grid split/merge for the smooth and high-frequency parts, DIIS mixing of the smooth part, and plain mixing of the high-frequency part.
| chr | pointer to Charge object (must have kin_r/kin_r_save) |
| nspin | number of spins |
| double_grid | whether double grid is used |
| rhopw | smooth grid |
| rhodpw | dense grid (same as rhopw when double_grid is off) |
| mixing | DIIS mixing object |
| tau_mdata | mixing data for tau |
| mixing_highf | plain mixing for high-frequency part (may be null when double_grid is off) |
| void module_charge::detail::normalize_and_check | ( | double ** | rho_in, |
| const ModuleBase::ComplexMatrix & | rho_g3d, | ||
| const ModulePW::PW_Basis * | rhopw, | ||
| int | spin_number_need, | ||
| double | omega, | ||
| std::ostream & | ofs_warning, | ||
| double | nelec ) |
FFT rho_g3d to real space, check for negative/imaginary charge, and normalize to target electron number.
| void module_charge::detail::pack_rho_mag | ( | T * | out, |
| const T * | d0, | ||
| const T * | d1, | ||
| const int | n ) |
Pack charge and magnetism into interleaved layout: out[0..n] = d0 + d1 (charge channel) out[n..2n] = d0 - d1 (magnetism channel).
| T | double (real space) or std::complex<double> (reciprocal) |
| out | output buffer, size >= 2*n |
| d0 | first component (e.g. chr->rho[0] or chr->rhog[0]) |
| d1 | second component |
| n | number of elements per component |
| void module_charge::detail::psymmg | ( | std::complex< double > * | rhog_part, |
| const ModulePW::PW_Basis * | rho_basis, | ||
| ModuleSymmetry::Symmetry & | symm ) |
Symmetrize one reciprocal-space density component.
| void module_charge::detail::psymmg_soc | ( | std::complex< double > * | rhog_x, |
| std::complex< double > * | rhog_y, | ||
| std::complex< double > * | rhog_z, | ||
| const ModulePW::PW_Basis * | rho_basis, | ||
| ModuleSymmetry::Symmetry & | symm ) |
Symmetrize the three coupled reciprocal-space spin components for nspin=4.
| void module_charge::detail::unpack_rho_mag | ( | T * | d0, |
| T * | d1, | ||
| const T * | in, | ||
| const int | n ) |
Unpack interleaved layout back to charge and magnetism components: d0[i] = 0.5 * (in[i] + in[i+n]) d1[i] = 0.5 * (in[i] - in[i+n]).
| T | double (real space) or std::complex<double> (reciprocal) |
| d0 | output first component (e.g. chr->rho[0] or chr->rhog[0]) |
| d1 | output second component |
| in | input buffer, size >= 2*n |
| n | number of elements per component |