QMCPACK
DFTAtom.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Paul R. C. Kent, kentpr@ornl.gov, Oak Ridge National Laboratory
8 //
9 // File created by: Paul R. C. Kent, kentpr@ornl.gov, Oak Ridge National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 // http://pathintegrals.info //
14 /////////////////////////////////////////////////////////////
15 
16 #ifndef DFT_ATOM_H
17 #define DFT_ATOM_H
18 
19 #include "AtomBase.h"
20 
21 class DFTAtom : public Atom
22 {
23 private:
27  void UpdateChargeDensity();
28  void UpdateHartree();
29  void UpdateExCorr();
33 
34 public:
36  double NewMix;
37 
38  AtomType Type() override;
39  /// This function calculates the charge density, hartree and exchange
40  /// potentials and places them in pot.
41  void UpdateVHXC() override;
42  void CalcEnergies(double& kinetic, double& potential, double& hartree, double& XC) override
43  {
44  assert(0 && "unimplemented");
45  }
46  void Solve() override;
47  void SolveInit();
48  double SolveIter();
49  void Write(IOSectionClass& out) override;
50  void Read(IOSectionClass& in) override;
51  void SetGrid(std::shared_ptr<Grid>& newGrid) override;
52  void SetBarePot(Potential* pot) override;
53 
54  inline double rho(double r) { return ChargeDensity(r); }
55 
56  inline double Hartree1(double r, double sum);
57  inline double Hartree2(double r, double sum);
58 };
59 
60 inline double DFTAtom::Hartree1(double r, double sum)
61 {
62  double rho = ChargeDensity(r);
63  return (rho * r * r);
64 }
65 
66 inline double DFTAtom::Hartree2(double r, double sum)
67 {
68  double rho = ChargeDensity(r);
69  return (rho * r);
70 }
71 
72 #endif
Array< double, 1 > OldEnergies
Definition: DFTAtom.h:32
void CalcEnergies(double &kinetic, double &potential, double &hartree, double &XC) override
Definition: DFTAtom.h:42
Potential * BarePot
Definition: DFTAtom.h:31
double rho(double r)
Definition: DFTAtom.h:54
AtomType Type() override
CubicSplineCommon ChargeDensity
Definition: DFTAtom.h:24
void SetGrid(std::shared_ptr< Grid > &newGrid) override
The CubicSplineCommon class is a third-order spline representation of a function. ...
void Read(IOSectionClass &in) override
void UpdateHartree()
void SetBarePot(Potential *pot) override
ScreenedPot V
Definition: DFTAtom.h:35
CubicSplineCommon Hartree
Definition: DFTAtom.h:25
void UpdateVHXC() override
This function calculates the charge density, hartree and exchange potentials and places them in pot...
Array< double, 1 > temp
Definition: DFTAtom.h:30
void SolveInit()
CubicSplineCommon ExCorr
Definition: DFTAtom.h:26
void Write(IOSectionClass &out) override
Definition: AtomBase.h:30
double Hartree1(double r, double sum)
Definition: DFTAtom.h:60
double Hartree2(double r, double sum)
Definition: DFTAtom.h:66
Wrapper class for IOTreeClass that gives a nearly identical interface as the OutputSectionClass.
Definition: IO.h:110
double SolveIter()
AtomType
Definition: AtomBase.h:23
Array< double, 1 > temp2
Definition: DFTAtom.h:30
void Solve() override
double NewMix
Definition: DFTAtom.h:36
void UpdateExCorr()
void UpdateChargeDensity()