JDFTx  1.2.0
VanDerWaals.h
1 /*-------------------------------------------------------------------
2 Copyright 2012 Deniz Gunceler, Kendra Letchworth Weaver
3 
4 This file is part of JDFTx.
5 
6 JDFTx is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 JDFTx is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with JDFTx. If not, see <http://www.gnu.org/licenses/>.
18 -------------------------------------------------------------------*/
19 
20 #ifndef JDFTX_ELECTRONIC_VANDERWAALS_H
21 #define JDFTX_ELECTRONIC_VANDERWAALS_H
22 
23 #include <electronic/RadialFunction.h>
24 #include <electronic/common.h>
25 #include <core/ScalarFieldArray.h>
26 #include <core/Coulomb.h>
27 
29 {
30 public:
31  VanDerWaals(const Everything &everything);
32  ~VanDerWaals();
33 
34  const static int unitParticle = -1;
35 
38  double energyAndGrad(std::vector<Atom>& atoms, const double scaleFac) const;
39 
44  double energyAndGrad(const std::vector< std::vector< vector3<> > >& atpos, const ScalarFieldTildeArray& Ntilde, const std::vector<int>& atomicNumber,
45  const double scaleFac, ScalarFieldTildeArray* grad_Ntilde=0, IonicGradient* forces=0) const;
46 
49  double getScaleFactor(string exCorrName, double scaleOverride=0.) const;
50 
52  struct AtomParams
53  { double C6;
54  double R0;
56  AtomParams(double SI_C6=0., double SI_R0=0.);
57  };
58  AtomParams getParams(int atomicNumber, int sp) const;
59 
60 private:
61  const Everything* e;
62 
63  std::vector<AtomParams> atomParams;
64  std::map<string,double> scalingFactor;
65 
71  const RadialFunctionG& getRadialFunction(int Z1, int Z2, int sp1, int sp2) const;
72 
73  std::map<std::pair<int,int>,RadialFunctionG> radialFunctions;
74 };
75 
76 #endif // JDFTX_ELECTRONIC_VANDERWAALS_H
Definition: VanDerWaals.h:28
C6 and R0 parameters for the VDW interactions.
Definition: VanDerWaals.h:52
AtomParams(double SI_C6=0., double SI_R0=0.)
Construct given C6 in J-nm^6/mol and R0 in Angstrom.
double getScaleFactor(string exCorrName, double scaleOverride=0.) const
AtomParams getParams(int atomicNumber, int sp) const
retrieve vdW parameters for an atom
G-space radial function stored on a uniform grid (of |G|)
Definition: RadialFunction.h:28
Definition: Everything.h:41
double energyAndGrad(std::vector< Atom > &atoms, const double scaleFac) const
classes ScalarFieldArray, ScalarFieldTildeArray and just enough operators to enable CG w...
static const int unitParticle
special atomic number used by some fluids: point particle with C6=1 J-nm^6/mol and R0=0 ...
Definition: VanDerWaals.h:34
Object to hold all the forces.
Definition: IonicMinimizer.h:31
std::vector< ScalarFieldTilde > ScalarFieldTildeArray
dynamic size collection of reciprocal space scalar fields
Definition: ScalarFieldArray.h:33