QMCPACK
AtomBase.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 ATOM_BASE_H
17 #define ATOM_BASE_H
18 
19 #include "RadialWF.h"
20 
21 #include <memory> // std::shared_ptr
22 
23 typedef enum
24 {
28 } AtomType;
29 
30 class Atom
31 {
32 protected:
33  std::shared_ptr<Grid> grid;
34 
35 public:
37  virtual AtomType Type() = 0;
38  virtual void UpdateVHXC() = 0;
39  virtual void CalcEnergies(double& kinetic, double& potential, double& hartree, double& HXC) = 0;
40  virtual void Solve() = 0;
41  virtual void Write(IOSectionClass& out) = 0;
42  virtual void Read(IOSectionClass& in) = 0;
43  virtual void SetGrid(std::shared_ptr<Grid>& newGrid) = 0;
44  inline Grid* GetGrid() { return grid.get(); }
45  inline double NumElecs();
46  virtual void SetBarePot(Potential* pot) = 0;
47 };
48 
49 inline double Atom::NumElecs()
50 {
51  double num = 0.0;
52  for (int i = 0; i < RadialWFs.size(); i++)
53  num += RadialWFs(i).Occupancy;
54  return num;
55 }
56 
57 
58 #endif
Grid * GetGrid()
Definition: AtomBase.h:44
Parent class for all grids.
Definition: Grid.h:43
Array< RadialWF, 1 > RadialWFs
Definition: AtomBase.h:36
virtual void CalcEnergies(double &kinetic, double &potential, double &hartree, double &HXC)=0
virtual void SetBarePot(Potential *pot)=0
double NumElecs()
Definition: AtomBase.h:49
virtual AtomType Type()=0
virtual void UpdateVHXC()=0
Definition: AtomBase.h:30
virtual void Solve()=0
size_t size() const
Definition: OhmmsArray.h:57
virtual void SetGrid(std::shared_ptr< Grid > &newGrid)=0
virtual void Read(IOSectionClass &in)=0
Wrapper class for IOTreeClass that gives a nearly identical interface as the OutputSectionClass.
Definition: IO.h:110
AtomType
Definition: AtomBase.h:23
std::shared_ptr< Grid > grid
Definition: AtomBase.h:33
virtual void Write(IOSectionClass &out)=0