JDFTx  1.7.0
Coulomb Class Referenceabstract

Abstract base class for the (optionally truncated) Coulomb interaction. More...

#include <Coulomb.h>

Inheritance diagram for Coulomb:
CoulombCylindrical CoulombIsolated CoulombPeriodic CoulombSlab CoulombSpherical CoulombWire

Public Types

enum  PointChargeMode { PointChargeNone , PointChargeLeft , PointChargeRight }
 Special point-charge handling mode when using embedded truncation. More...
 

Public Member Functions

ScalarFieldTilde operator() (ScalarFieldTilde &&, PointChargeMode pointChargeMode=PointChargeNone) const
 
ScalarFieldTilde operator() (const ScalarFieldTilde &, PointChargeMode pointChargeMode=PointChargeNone) const
 Apply Coulomb kernel (parameters same as destructible input version above)
 
matrix3 latticeGradient (const ScalarFieldTilde &X, const ScalarFieldTilde &Y, PointChargeMode pointChargeMode=PointChargeNone) const
 Return the lattice gradient of dot(X, O(coulomb(Y))
 
double energyAndGrad (std::vector< Atom > &atoms, matrix3<> *E_RRT=0) const
 
ScalarField getEfieldPotential () const
 Generate the potential due to the Efield (if any) (Requires embedded truncation)
 
complexScalarFieldTilde operator() (complexScalarFieldTilde &&, vector3<> kDiff, double omega) const
 
complexScalarFieldTilde operator() (const complexScalarFieldTilde &, vector3<> kDiff, double omega) const
 
matrix3 latticeGradient (const complexScalarFieldTilde &X, vector3<> kDiff, double omega) const
 Return the lattice gradient of exchange integral dot(X, O(coulomb(X)) for given k-point difference and screening parameter.
 

Protected Member Functions

 Coulomb (const GridInfo &gInfoOrig, const CoulombParams &params)
 
void initExchangeEval ()
 
virtual ScalarFieldTilde apply (ScalarFieldTilde &&) const =0
 
virtual std::shared_ptr< EwaldcreateEwald (matrix3<> R, size_t nAtoms) const =0
 
virtual matrix3 getLatticeGradient (const ScalarFieldTilde &X, const ScalarFieldTilde &Y) const =0
 Return the lattice gradient of dot(X, O(coulomb(Y))
 

Protected Attributes

const CoulombParamsparams
 
const GridInfogInfo
 embedding grid, which is 2x larger in truncated directions if params.embed == true
 
std::shared_ptr< Ewaldewald
 
std::map< double, std::shared_ptr< struct ExchangeEval > > exchangeEval
 

Friends

struct ExchangeEval
 
struct FluidSolver
 
struct SlabEpsilon
 
struct ChargedDefect
 

Detailed Description

Abstract base class for the (optionally truncated) Coulomb interaction.

Member Enumeration Documentation

◆ PointChargeMode

Special point-charge handling mode when using embedded truncation.

Enumerator
PointChargeNone 

smooth charge distributions, no handling required

PointChargeLeft 

point charge distribution on left end of operator (use for pointCharge^ K smooth)

PointChargeRight 

point charge distribution on right end of operator (use for smooth^ K pointCharge, hermitian conjugate of PointChargeLeft)

Member Function Documentation

◆ apply()

virtual ScalarFieldTilde Coulomb::apply ( ScalarFieldTilde &&  ) const
protectedpure virtual

Apply the Coulomb operator (on optionally embedded grid) with appropriate truncation Embedding is handled in base class wrapper functions above

Implemented in CoulombCylindrical, CoulombWire, CoulombSlab, CoulombPeriodic, CoulombSpherical, and CoulombIsolated.

◆ createEwald()

virtual std::shared_ptr<Ewald> Coulomb::createEwald ( matrix3<>  R,
size_t  nAtoms 
) const
protectedpure virtual

Each implementation must create and return the corresponding Ewald evaluator for the supplied lattice vectors R which may correspond to a supercell of gInfo.R along the periodic directions (the truncated directions will be identical) The number of atoms may be used for choosing the optimum gaussian width sigma

Implemented in CoulombCylindrical, CoulombWire, CoulombSlab, CoulombPeriodic, CoulombSpherical, and CoulombIsolated.

◆ energyAndGrad()

double Coulomb::energyAndGrad ( std::vector< Atom > &  atoms,
matrix3<> *  E_RRT = 0 
) const

Create the appropriate Ewald class, if required, and call Ewald::energyAndGrad Includes interaction with Efield, if present (Requires embedded truncation) If E_RRT is non-null, accumulate contrbutions to the symmetric lattice derivative (stress * volume)

◆ initExchangeEval()

void Coulomb::initExchangeEval ( )
protected

Call to initialize exchangeEval if exact exchange is required NOTE: this must be called from the end of each derived class constructor

◆ operator()() [1/3]

complexScalarFieldTilde Coulomb::operator() ( complexScalarFieldTilde &&  ,
vector3<>  kDiff,
double  omega 
) const

Apply regularized coulomb kernel for exchange integral with k-point difference kDiff and optionally screened with range parameter omega (destructible input)

◆ operator()() [2/3]

complexScalarFieldTilde Coulomb::operator() ( const complexScalarFieldTilde ,
vector3<>  kDiff,
double  omega 
) const

Apply regularized coulomb kernel for exchange integral with k-point difference kDiff and optionally screened with range parameter omega (destructible input)

◆ operator()() [3/3]

ScalarFieldTilde Coulomb::operator() ( ScalarFieldTilde &&  ,
PointChargeMode  pointChargeMode = PointChargeNone 
) const

Apply Coulomb kernel (destructible input). Pass appropriate pointChargeMode when applying to nucelar densities for special handling of high-frequency components necessary in the non-translationally invariant scheme i.e. when params.embed==true


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