ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
hsolver::CNSolverPW< T, Device > Class Template Reference

PW Crank-Nicolson numerical solves with fixed previous-step orbitals. More...

#include <cn_solver_pw.h>

Collaboration diagram for hsolver::CNSolverPW< T, Device >:

Classes

struct  KPointState
struct  SequenceState
struct  BatchLayout
struct  SolveDetails

Public Member Functions

 CNSolverPW (const ModulePW::PW_Basis_K &basis, const CNControls &cn_ctrl, int npol, const std::vector< int > &global_k, const diag_comm_info &comm, std::ostream &log)
 Configure propagation with explicit numerical controls and orbital layout.
void invalidate_basis ()
 Invalidate basis-dependent history and restart independent residual checks without releasing buffers. Call on every rank in the pool after changing the basis or its distribution, including G-vector ordering or k-point changes that preserve array sizes. Ordinary Hamiltonian updates and ionic motion at fixed basis do not require this notification.
void solve (HSOperator< T, Device > &op, const psi::Psi< T, Device > &previous, psi::Psi< T, Device > *current, const double dt, const ModuleBase::Vector3< double > &momentum_shift, const int istep, const int iter, const bool detailed_output)
 Propagate from the fixed previous step, retaining the current iterate as the initial guess.

Private Types

using Real = typename GetTypeReal<T>::type

Private Member Functions

void initialize ()
bool tracks_state () const
void prepare_sequence (int nk, int ld, int bands, double dt, int step, int iteration)
bool require_audit (int step, KPointState *state) const
SolveDetails solve_kpoint (const LinearOperator< T, Device > &op, const T *previous, T *current, const BatchLayout &batch, int step, int iteration, KPointState *state)
void retry_kinetic (const LinearOperator< T, Device > &op, T *current, const BatchLayout &batch, LinearSolveResult *result)
void update_state (KPointState *state, const SolveDetails &details, int step, const BatchLayout &batch, const T *current)
void report_solve (const SolveDetails &details, int ik, int step, int iteration) const
void prepare_buffers (const int nbands, const int nbasis)
void update_precond (const int ik, const int dim, const T coefficient, const ModuleBase::Vector3< double > &momentum_shift)

Private Attributes

const ModulePW::PW_Basis_K & basis_
const diag_comm_info comm_
CNControls cn_ctrl_
const int npol_
const std::vector< int > global_k_
ct::Tensor clean_
LinearAlgebra< T, Device > algebra_
std::ostream & log_
CNSubspace< T, Device > projection_
std::vector< KPointState > states_
SequenceState sequence_
std::unique_ptr< HSolverLinear< T, Device > > linear_solver_
ct::Tensor rhs_
ct::Tensor inverse_kinetic_
ct::Tensor response_workspace_
ct::Tensor correction_workspace_

Detailed Description

template<typename T, typename Device>
class hsolver::CNSolverPW< T, Device >

PW Crank-Nicolson numerical solves with fixed previous-step orbitals.

Member Typedef Documentation

◆ Real

template<typename T, typename Device>
using hsolver::CNSolverPW< T, Device >::Real = typename GetTypeReal<T>::type
private

Constructor & Destructor Documentation

◆ CNSolverPW()

template<typename T, typename Device>
hsolver::CNSolverPW< T, Device >::CNSolverPW ( const ModulePW::PW_Basis_K & basis,
const CNControls & cn_ctrl,
int npol,
const std::vector< int > & global_k,
const diag_comm_info & comm,
std::ostream & log )

Configure propagation with explicit numerical controls and orbital layout.

Here is the call graph for this function:

Member Function Documentation

◆ initialize()

template<typename T, typename Device>
void hsolver::CNSolverPW< T, Device >::initialize ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ invalidate_basis()

template<typename T, typename Device>
void hsolver::CNSolverPW< T, Device >::invalidate_basis ( )

Invalidate basis-dependent history and restart independent residual checks without releasing buffers. Call on every rank in the pool after changing the basis or its distribution, including G-vector ordering or k-point changes that preserve array sizes. Ordinary Hamiltonian updates and ionic motion at fixed basis do not require this notification.

◆ prepare_buffers()

template<typename T, typename Device>
void hsolver::CNSolverPW< T, Device >::prepare_buffers ( const int nbands,
const int nbasis )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepare_sequence()

template<typename T, typename Device>
void hsolver::CNSolverPW< T, Device >::prepare_sequence ( int nk,
int ld,
int bands,
double dt,
int step,
int iteration )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ report_solve()

template<typename T, typename Device>
void hsolver::CNSolverPW< T, Device >::report_solve ( const SolveDetails & details,
int ik,
int step,
int iteration ) const
private
Here is the caller graph for this function:

◆ require_audit()

template<typename T, typename Device>
bool hsolver::CNSolverPW< T, Device >::require_audit ( int step,
KPointState * state ) const
private
Here is the caller graph for this function:

◆ retry_kinetic()

template<typename T, typename Device>
void hsolver::CNSolverPW< T, Device >::retry_kinetic ( const LinearOperator< T, Device > & op,
T * current,
const BatchLayout & batch,
LinearSolveResult * result )
private
Here is the caller graph for this function:

◆ solve()

template<typename T, typename Device>
void hsolver::CNSolverPW< T, Device >::solve ( HSOperator< T, Device > & op,
const psi::Psi< T, Device > & previous,
psi::Psi< T, Device > * current,
const double dt,
const ModuleBase::Vector3< double > & momentum_shift,
const int istep,
const int iter,
const bool detailed_output )

Propagate from the fixed previous step, retaining the current iterate as the initial guess.

Parameters
dtElectronic time step in Hartree atomic units.
momentum_shiftPropagation vector potential in Hartree atomic units (inverse Bohr).
istepElectronic propagation step, increasing across electronic substeps within an MD step.
iterSCF iteration within this electronic step.
Here is the call graph for this function:

◆ solve_kpoint()

template<typename T, typename Device>
CNSolverPW< T, Device >::SolveDetails hsolver::CNSolverPW< T, Device >::solve_kpoint ( const LinearOperator< T, Device > & op,
const T * previous,
T * current,
const BatchLayout & batch,
int step,
int iteration,
KPointState * state )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tracks_state()

template<typename T, typename Device>
bool hsolver::CNSolverPW< T, Device >::tracks_state ( ) const
private
Here is the caller graph for this function:

◆ update_precond()

template<typename T, typename Device>
void hsolver::CNSolverPW< T, Device >::update_precond ( const int ik,
const int dim,
const T coefficient,
const ModuleBase::Vector3< double > & momentum_shift )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_state()

template<typename T, typename Device>
void hsolver::CNSolverPW< T, Device >::update_state ( KPointState * state,
const SolveDetails & details,
int step,
const BatchLayout & batch,
const T * current )
private
Here is the caller graph for this function:

Member Data Documentation

◆ algebra_

template<typename T, typename Device>
LinearAlgebra<T, Device> hsolver::CNSolverPW< T, Device >::algebra_
private

◆ basis_

template<typename T, typename Device>
const ModulePW::PW_Basis_K& hsolver::CNSolverPW< T, Device >::basis_
private

◆ clean_

template<typename T, typename Device>
ct::Tensor hsolver::CNSolverPW< T, Device >::clean_
private

◆ cn_ctrl_

template<typename T, typename Device>
CNControls hsolver::CNSolverPW< T, Device >::cn_ctrl_
private

◆ comm_

template<typename T, typename Device>
const diag_comm_info hsolver::CNSolverPW< T, Device >::comm_
private

◆ correction_workspace_

template<typename T, typename Device>
ct::Tensor hsolver::CNSolverPW< T, Device >::correction_workspace_
private

◆ global_k_

template<typename T, typename Device>
const std::vector<int> hsolver::CNSolverPW< T, Device >::global_k_
private

◆ inverse_kinetic_

template<typename T, typename Device>
ct::Tensor hsolver::CNSolverPW< T, Device >::inverse_kinetic_
private

◆ linear_solver_

template<typename T, typename Device>
std::unique_ptr<HSolverLinear<T, Device> > hsolver::CNSolverPW< T, Device >::linear_solver_
private

◆ log_

template<typename T, typename Device>
std::ostream& hsolver::CNSolverPW< T, Device >::log_
private

◆ npol_

template<typename T, typename Device>
const int hsolver::CNSolverPW< T, Device >::npol_
private

◆ projection_

template<typename T, typename Device>
CNSubspace<T, Device> hsolver::CNSolverPW< T, Device >::projection_
private

◆ response_workspace_

template<typename T, typename Device>
ct::Tensor hsolver::CNSolverPW< T, Device >::response_workspace_
private

◆ rhs_

template<typename T, typename Device>
ct::Tensor hsolver::CNSolverPW< T, Device >::rhs_
private

◆ sequence_

template<typename T, typename Device>
SequenceState hsolver::CNSolverPW< T, Device >::sequence_
private

◆ states_

template<typename T, typename Device>
std::vector<KPointState> hsolver::CNSolverPW< T, Device >::states_
private

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