ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Forces< FPTYPE, Device > Class Template Reference

#include <force_pw.h>

Collaboration diagram for Forces< FPTYPE, Device >:

Public Member Functions

 Forces (const int nat_in)
 ~Forces ()
void cal_force (const int nspin, const bool domag, const bool domag_z, const int gga_grad, const bool use_onsite_projection, UnitCell &ucell, ModuleBase::matrix &force, const vdw::VdwResult *vdw_result, const elecstate::ElecState &elec, const ModulePW::PW_Basis *const rho_basis, ModuleSymmetry::Symmetry *p_symm, Structure_Factor *p_sf, surchem &solvent, const Plus_U_Base *p_dftu, const pseudopot_cell_vl *locpp, const pseudopot_cell_vnl *nlpp=nullptr, K_Vectors *pkv=nullptr, ModulePW::PW_Basis_K *psi_basis=nullptr, const psi::Psi< std::complex< FPTYPE >, Device > *psi_in=nullptr)

Protected Member Functions

void cal_force_loc (const UnitCell &ucell, ModuleBase::matrix &forcelc, const ModulePW::PW_Basis *const rho_basis, const ModuleBase::matrix &vloc, const Charge *const chr)
void cal_force_ew (const UnitCell &ucell, ModuleBase::matrix &forceion, const ModulePW::PW_Basis *const rho_basis, const Structure_Factor *p_sf)
void cal_force_cc (ModuleBase::matrix &forcecc, const ModulePW::PW_Basis *const rho_basis, const Charge *const chr, const bool *numeric, UnitCell &ucell_in, const int nspin, const bool domag, const bool domag_z, const int gga_grad)
void cal_force_nl (ModuleBase::matrix &forcenl, const ModuleBase::matrix &wg, const ModuleBase::matrix &ekb, const K_Vectors *p_kv, const ModulePW::PW_Basis_K *psi_basis, const Structure_Factor *p_sf, const pseudopot_cell_vnl &nlpp_in, const UnitCell &ucell_in, const psi::Psi< std::complex< FPTYPE >, Device > *psi_in=nullptr)
 This routine computes the atomic force of non-local pseudopotential F^{NL}_i = \sum_{n,k}f_{nk}\sum_I \sum_{lm,l'm'}D_{l,l'}^{I} [ \sum_G \langle c_{nk}(\mathbf{G+K})|\beta_{lm}^I(\mathbf{G+K})\rangle * \sum_{G'}\langle \beta_{lm}^I(\mathbf{G+K})*(-j)^l(\mathbf{G+K})_i |c_{nk}(\mathbf{G+K})\rangle ] there would be three parts in the above equation: (1) sum over becp and dbecp with D_{l,l'}^{I} --— first line in the above equation (2) calculate becp = <psi | beta> --— second line in the above equation (3) calculate dbecp = <psi | \nabla beta> --— third line in the above equation.
void cal_force_onsite (ModuleBase::matrix &force_onsite, const ModuleBase::matrix &wg, const ModulePW::PW_Basis_K *wfc_basis, const UnitCell &ucell_in, const Plus_U_Base &dftu, const psi::Psi< std::complex< FPTYPE >, Device > *psi_in=nullptr)
 atomic force for DFT+U and DeltaSpin
void cal_force_scc (ModuleBase::matrix &forcescc, const ModulePW::PW_Basis *const rho_basis, const ModuleBase::matrix &v_current, const bool vnew_exist, const bool *numeric, const UnitCell &ucell_in)
void cal_force_us (ModuleBase::matrix &forcenl, const ModulePW::PW_Basis *const rho_basis, const pseudopot_cell_vnl &ppcell_in, const elecstate::ElecState &elec, const UnitCell &ucell)
void cal_ylm (int lmax, int npw, const FPTYPE *gk_in, FPTYPE *ylm)
void deriv_drhoc (const bool &numeric, const int mesh, const FPTYPE *r, const FPTYPE *rab, const FPTYPE *rhoc, FPTYPE *drhocg, const ModulePW::PW_Basis *const rho_basis, int type, const UnitCell &ucell_in)
void deriv_drhoc_scc (const bool &numeric, const int mesh, const FPTYPE *r, const FPTYPE *rab, const FPTYPE *rhoc, FPTYPE *drhocg, const ModulePW::PW_Basis *const rho_basis, const UnitCell &ucell_in)

Protected Attributes

int nat = 0
int npwx = 0
Device * ctx = {}
base_device::DEVICE_CPU * cpu_ctx = {}
base_device::AbacusDevice_t device = {}

Private Types

using gemm_op = ModuleBase::gemm_op<std::complex<FPTYPE>, Device>
using resmem_complex_op = base_device::memory::resize_memory_op<std::complex<FPTYPE>, Device>
using resmem_complex_h_op = base_device::memory::resize_memory_op<std::complex<FPTYPE>, base_device::DEVICE_CPU>
using delmem_complex_op = base_device::memory::delete_memory_op<std::complex<FPTYPE>, Device>
using delmem_complex_h_op = base_device::memory::delete_memory_op<std::complex<FPTYPE>, base_device::DEVICE_CPU>
using syncmem_complex_h2d_op
using syncmem_complex_d2h_op
using resmem_var_op = base_device::memory::resize_memory_op<FPTYPE, Device>
using delmem_var_op = base_device::memory::delete_memory_op<FPTYPE, Device>
using syncmem_var_h2d_op = base_device::memory::synchronize_memory_op<FPTYPE, Device, base_device::DEVICE_CPU>
using syncmem_var_d2h_op = base_device::memory::synchronize_memory_op<FPTYPE, base_device::DEVICE_CPU, Device>
using resmem_int_op = base_device::memory::resize_memory_op<int, Device>
using delmem_int_op = base_device::memory::delete_memory_op<int, Device>
using syncmem_int_h2d_op = base_device::memory::synchronize_memory_op<int, Device, base_device::DEVICE_CPU>

Friends

template<typename T>
class Force_Stress_LCAO
template<class T>
class hamilt::Veff
template<typename T>
class ForcePWTerms

Member Typedef Documentation

◆ delmem_complex_h_op

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
using Forces< FPTYPE, Device >::delmem_complex_h_op = base_device::memory::delete_memory_op<std::complex<FPTYPE>, base_device::DEVICE_CPU>
private

◆ delmem_complex_op

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
using Forces< FPTYPE, Device >::delmem_complex_op = base_device::memory::delete_memory_op<std::complex<FPTYPE>, Device>
private

◆ delmem_int_op

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
using Forces< FPTYPE, Device >::delmem_int_op = base_device::memory::delete_memory_op<int, Device>
private

◆ delmem_var_op

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
using Forces< FPTYPE, Device >::delmem_var_op = base_device::memory::delete_memory_op<FPTYPE, Device>
private

◆ gemm_op

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
using Forces< FPTYPE, Device >::gemm_op = ModuleBase::gemm_op<std::complex<FPTYPE>, Device>
private

◆ resmem_complex_h_op

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
using Forces< FPTYPE, Device >::resmem_complex_h_op = base_device::memory::resize_memory_op<std::complex<FPTYPE>, base_device::DEVICE_CPU>
private

◆ resmem_complex_op

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
using Forces< FPTYPE, Device >::resmem_complex_op = base_device::memory::resize_memory_op<std::complex<FPTYPE>, Device>
private

◆ resmem_int_op

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
using Forces< FPTYPE, Device >::resmem_int_op = base_device::memory::resize_memory_op<int, Device>
private

◆ resmem_var_op

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
using Forces< FPTYPE, Device >::resmem_var_op = base_device::memory::resize_memory_op<FPTYPE, Device>
private

◆ syncmem_complex_d2h_op

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
using Forces< FPTYPE, Device >::syncmem_complex_d2h_op
private
Initial value:

◆ syncmem_complex_h2d_op

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
using Forces< FPTYPE, Device >::syncmem_complex_h2d_op
private
Initial value:

◆ syncmem_int_h2d_op

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
using Forces< FPTYPE, Device >::syncmem_int_h2d_op = base_device::memory::synchronize_memory_op<int, Device, base_device::DEVICE_CPU>
private

◆ syncmem_var_d2h_op

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
using Forces< FPTYPE, Device >::syncmem_var_d2h_op = base_device::memory::synchronize_memory_op<FPTYPE, base_device::DEVICE_CPU, Device>
private

◆ syncmem_var_h2d_op

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
using Forces< FPTYPE, Device >::syncmem_var_h2d_op = base_device::memory::synchronize_memory_op<FPTYPE, Device, base_device::DEVICE_CPU>
private

Constructor & Destructor Documentation

◆ Forces()

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
Forces< FPTYPE, Device >::Forces ( const int nat_in)
inline

◆ ~Forces()

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
Forces< FPTYPE, Device >::~Forces ( )
inline

Member Function Documentation

◆ cal_force()

template<typename FPTYPE, typename Device>
void Forces< FPTYPE, Device >::cal_force ( const int nspin,
const bool domag,
const bool domag_z,
const int gga_grad,
const bool use_onsite_projection,
UnitCell & ucell,
ModuleBase::matrix & force,
const vdw::VdwResult * vdw_result,
const elecstate::ElecState & elec,
const ModulePW::PW_Basis *const rho_basis,
ModuleSymmetry::Symmetry * p_symm,
Structure_Factor * p_sf,
surchem & solvent,
const Plus_U_Base * p_dftu,
const pseudopot_cell_vl * locpp,
const pseudopot_cell_vnl * nlpp = nullptr,
K_Vectors * pkv = nullptr,
ModulePW::PW_Basis_K * psi_basis = nullptr,
const psi::Psi< std::complex< FPTYPE >, Device > * psi_in = nullptr )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_force_cc()

template<typename FPTYPE, typename Device>
void Forces< FPTYPE, Device >::cal_force_cc ( ModuleBase::matrix & forcecc,
const ModulePW::PW_Basis *const rho_basis,
const Charge *const chr,
const bool * numeric,
UnitCell & ucell_in,
const int nspin,
const bool domag,
const bool domag_z,
const int gga_grad )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_force_ew()

template<typename FPTYPE, typename Device>
void Forces< FPTYPE, Device >::cal_force_ew ( const UnitCell & ucell,
ModuleBase::matrix & forceion,
const ModulePW::PW_Basis *const rho_basis,
const Structure_Factor * p_sf )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_force_loc()

template<typename FPTYPE, typename Device>
void Forces< FPTYPE, Device >::cal_force_loc ( const UnitCell & ucell,
ModuleBase::matrix & forcelc,
const ModulePW::PW_Basis *const rho_basis,
const ModuleBase::matrix & vloc,
const Charge *const chr )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_force_nl()

template<typename FPTYPE, typename Device>
void Forces< FPTYPE, Device >::cal_force_nl ( ModuleBase::matrix & forcenl,
const ModuleBase::matrix & wg,
const ModuleBase::matrix & ekb,
const K_Vectors * p_kv,
const ModulePW::PW_Basis_K * psi_basis,
const Structure_Factor * p_sf,
const pseudopot_cell_vnl & nlpp_in,
const UnitCell & ucell_in,
const psi::Psi< std::complex< FPTYPE >, Device > * psi_in = nullptr )
protected

This routine computes the atomic force of non-local pseudopotential F^{NL}_i = \sum_{n,k}f_{nk}\sum_I \sum_{lm,l'm'}D_{l,l'}^{I} [ \sum_G \langle c_{nk}(\mathbf{G+K})|\beta_{lm}^I(\mathbf{G+K})\rangle * \sum_{G'}\langle \beta_{lm}^I(\mathbf{G+K})*(-j)^l(\mathbf{G+K})_i |c_{nk}(\mathbf{G+K})\rangle ] there would be three parts in the above equation: (1) sum over becp and dbecp with D_{l,l'}^{I} --— first line in the above equation (2) calculate becp = <psi | beta> --— second line in the above equation (3) calculate dbecp = <psi | \nabla beta> --— third line in the above equation.

Here is the call graph for this function:

◆ cal_force_onsite()

template<typename FPTYPE, typename Device>
void Forces< FPTYPE, Device >::cal_force_onsite ( ModuleBase::matrix & force_onsite,
const ModuleBase::matrix & wg,
const ModulePW::PW_Basis_K * wfc_basis,
const UnitCell & ucell_in,
const Plus_U_Base & dftu,
const psi::Psi< std::complex< FPTYPE >, Device > * psi_in = nullptr )
protected

atomic force for DFT+U and DeltaSpin

Parameters
force_onsite,theoutput atomic force
wg,theweight of k points
wfc_basis,theplane wave basis
ucell_in,theunit cell
psi_in,thewave function
Here is the call graph for this function:

◆ cal_force_scc()

template<typename FPTYPE, typename Device>
void Forces< FPTYPE, Device >::cal_force_scc ( ModuleBase::matrix & forcescc,
const ModulePW::PW_Basis *const rho_basis,
const ModuleBase::matrix & v_current,
const bool vnew_exist,
const bool * numeric,
const UnitCell & ucell_in )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_force_us()

template<typename FPTYPE, typename Device>
void Forces< FPTYPE, Device >::cal_force_us ( ModuleBase::matrix & forcenl,
const ModulePW::PW_Basis *const rho_basis,
const pseudopot_cell_vnl & ppcell_in,
const elecstate::ElecState & elec,
const UnitCell & ucell )
protected
Here is the call graph for this function:

◆ cal_ylm()

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
void Forces< FPTYPE, Device >::cal_ylm ( int lmax,
int npw,
const FPTYPE * gk_in,
FPTYPE * ylm )
protected

◆ deriv_drhoc()

template<typename FPTYPE, typename Device>
void Forces< FPTYPE, Device >::deriv_drhoc ( const bool & numeric,
const int mesh,
const FPTYPE * r,
const FPTYPE * rab,
const FPTYPE * rhoc,
FPTYPE * drhocg,
const ModulePW::PW_Basis *const rho_basis,
int type,
const UnitCell & ucell_in )
protected
Here is the call graph for this function:

◆ deriv_drhoc_scc()

template<typename FPTYPE, typename Device>
void Forces< FPTYPE, Device >::deriv_drhoc_scc ( const bool & numeric,
const int mesh,
const FPTYPE * r,
const FPTYPE * rab,
const FPTYPE * rhoc,
FPTYPE * drhocg,
const ModulePW::PW_Basis *const rho_basis,
const UnitCell & ucell_in )
protected

the modulus of g for a given shell the fourier transform auxiliary memory for integration

counter on radial mesh points counter on g shells lower limit for loop on ngl

G=0 term

G <> 0 term ]

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Force_Stress_LCAO

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
template<typename T>
friend class Force_Stress_LCAO
friend

◆ ForcePWTerms

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
template<typename T>
friend class ForcePWTerms
friend

◆ hamilt::Veff

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
template<class T>
friend class hamilt::Veff
friend

Member Data Documentation

◆ cpu_ctx

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
base_device::DEVICE_CPU* Forces< FPTYPE, Device >::cpu_ctx = {}
protected

◆ ctx

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
Device* Forces< FPTYPE, Device >::ctx = {}
protected

◆ device

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
base_device::AbacusDevice_t Forces< FPTYPE, Device >::device = {}
protected

◆ nat

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
int Forces< FPTYPE, Device >::nat = 0
protected

◆ npwx

template<typename FPTYPE, typename Device = base_device::DEVICE_CPU>
int Forces< FPTYPE, Device >::npwx = 0
protected

The documentation for this class was generated from the following files: