Loading...
Searching...
No Matches
q3::PlanewaveEffectivePotentialCalculator Class Reference

#include <init.hpp>

+ Inheritance diagram for q3::PlanewaveEffectivePotentialCalculator:

Public Member Functions

 PlanewaveEffectivePotentialCalculator (const PlanewaveBasis &planewave_basis, const Crystal &crystal_structure, const XCFunctional &exchange_correlation, const execution::PlanewaveExecutionPolicy &execution_policy)
 
virtual ~PlanewaveEffectivePotentialCalculator ()=default
 
EffectivePotentialResult compute (const std::vector< std::vector< Real > > &charge_density_real, int number_of_spin_components, const std::vector< Complex > &local_ionic_potential_g) const
 

Protected Member Functions

virtual void build_exchange_correlation_density (const std::vector< std::vector< Real > > &charge_density_real, int number_of_spin_components, std::vector< std::vector< Real > > &exchange_correlation_density, std::vector< std::vector< Complex > > &exchange_correlation_density_g) const
 

Protected Attributes

std::vector< Real > cached_local_ionic_potential_real_
 
const Crystal & crystal_structure_
 
const XCFunctional & exchange_correlation_
 
std::unique_ptr< ExchangeCorrelationPotentialCalculator > exchange_correlation_potential_calculator_
 V_xc evaluation strategy (local-density vs gradient-corrected), fixed at construction.
 
const execution::PlanewaveExecutionPolicy & execution_policy_
 
const PlanewaveBasis & planewave_basis_
 

Detailed Description

Definition at line 35 of file init.hpp.

Constructor & Destructor Documentation

◆ PlanewaveEffectivePotentialCalculator()

q3::PlanewaveEffectivePotentialCalculator::PlanewaveEffectivePotentialCalculator ( const PlanewaveBasis &  planewave_basis,
const Crystal &  crystal_structure,
const XCFunctional &  exchange_correlation,
const execution::PlanewaveExecutionPolicy &  execution_policy 
)
inline

Definition at line 37 of file init.hpp.

◆ ~PlanewaveEffectivePotentialCalculator()

virtual q3::PlanewaveEffectivePotentialCalculator::~PlanewaveEffectivePotentialCalculator ( )
virtualdefault

Member Function Documentation

◆ build_exchange_correlation_density()

virtual void q3::PlanewaveEffectivePotentialCalculator::build_exchange_correlation_density ( const std::vector< std::vector< Real > > &  charge_density_real,
int  number_of_spin_components,
std::vector< std::vector< Real > > &  exchange_correlation_density,
std::vector< std::vector< Complex > > &  exchange_correlation_density_g 
) const
inlineprotectedvirtual

Build the density seen by the XC functional. Base implementation copies the valence charge density directly. Subclasses override to include additional contributions (e.g., NLCC core charge).

Reimplemented in q3::NormConservingPlanewaveEffectivePotentialCalculator.

Definition at line 126 of file init.hpp.

References q3::PlanewaveBasis::fft_rho(), q3::FFTGrid::local_grid_points(), q3::PlanewaveBasis::number_of_g_vectors(), planewave_basis_, and q3::PlanewaveBasis::rho_r_to_g().

Referenced by compute().

◆ compute()

EffectivePotentialResult q3::PlanewaveEffectivePotentialCalculator::compute ( const std::vector< std::vector< Real > > &  charge_density_real,
int  number_of_spin_components,
const std::vector< Complex > &  local_ionic_potential_g 
) const
inline

Reduce XC energy and XC potential energy within this pool. Both are real-space slab integrals (over local_grid_points) and each rank in the band communicator holds only its slab of the grid. With 1-rank-per-pool this is a no-op; with multiple ranks per pool the partial sums must be combined.

Definition at line 52 of file init.hpp.

References build_exchange_correlation_density(), q3::EffectivePotentialResult::charge_density_g, q3::EffectivePotentialResult::exchange_correlation_energy, q3::EffectivePotentialResult::exchange_correlation_potential_energy, execution_policy_, q3::PlanewaveBasis::fft_rho(), q3::FFTGrid::local_grid_points(), planewave_basis_, q3::execution::PlanewaveExecutionPolicy::reduce_within_pool_scalar(), q3::PlanewaveBasis::rho_r_to_g(), and q3::FFTGrid::total_grid_points().

Referenced by q3::PlanewavePseudopotentialKohnShamSCFIterator::valence_exchange_correlation_potential_g_of().

Member Data Documentation

◆ cached_local_ionic_potential_real_

std::vector<Real> q3::PlanewaveEffectivePotentialCalculator::cached_local_ionic_potential_real_
mutableprotected

Definition at line 119 of file init.hpp.

◆ crystal_structure_

const Crystal& q3::PlanewaveEffectivePotentialCalculator::crystal_structure_
protected

Definition at line 113 of file init.hpp.

◆ exchange_correlation_

const XCFunctional& q3::PlanewaveEffectivePotentialCalculator::exchange_correlation_
protected

Definition at line 114 of file init.hpp.

◆ exchange_correlation_potential_calculator_

std::unique_ptr<ExchangeCorrelationPotentialCalculator> q3::PlanewaveEffectivePotentialCalculator::exchange_correlation_potential_calculator_
protected

V_xc evaluation strategy (local-density vs gradient-corrected), fixed at construction.

Definition at line 118 of file init.hpp.

◆ execution_policy_

const execution::PlanewaveExecutionPolicy& q3::PlanewaveEffectivePotentialCalculator::execution_policy_
protected

Definition at line 115 of file init.hpp.

Referenced by compute().

◆ planewave_basis_

const PlanewaveBasis& q3::PlanewaveEffectivePotentialCalculator::planewave_basis_
protected

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