JDFTx  1.2.0
Molecule.h
1 /*-------------------------------------------------------------------
2 Copyright 2011 Ravishankar Sundararaman, 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_FLUID_MOLECULE_H
21 #define JDFTX_FLUID_MOLECULE_H
22 
23 #include <electronic/RadialFunction.h>
24 #include <core/vector3.h>
25 #include <core/string.h>
26 #include <core/ScalarField.h>
27 #include <vector>
28 #include <map>
29 
31 struct Molecule
32 {
33  string name;
34 
35  struct Site
36  { string name;
37  double Rhs;
39  double Znuc, sigmaNuc;
40  double Zelec, aElec;
41  double Zsite;
42  double deltaS;
43  double sigmaElec, rcElec;
44  string elecFilename, elecFilenameG;
45  double alpha, aPol;
46 
47  std::vector< vector3<> > positions;
48 
49  Site(string name, int atomicNumber=0);
50  ~Site();
51  void setup(const GridInfo& gInfo);
52  explicit operator bool() const { return initialized; }
53 
54  RadialFunctionG w0, w1, w2, w3, w1v, w2m;
55  RadialFunctionG elecKernel, chargeKernel, polKernel;
56  private:
57  bool initialized;
58  void free();
59  };
60  std::vector< std::shared_ptr<Site> > sites;
62 
63  Molecule(string name=string());
64  ~Molecule();
65  void setup(const GridInfo& gInfo, double Rmf);
66  explicit operator bool() const { return initialized; }
67 
68  bool isMonoatomic() const;
69  double getCharge() const;
70  double checkCharge();
71  vector3<> getDipole() const;
72  double getVhs() const;
73  double getAlphaTot() const;
74 
75  std::map<double,int> getBonds() const;
76 
77  void setModelMonoatomic(string name, double Q, double Rhs);
78 private:
79  bool initialized;
80 };
81 
82 #endif // JDFTX_FLUID_MOLECULE_H
double checkCharge()
check total charge on molecule and modify kernels if small non-neutral charge
int atomicNumber
necessary for vdW parameters
Definition: Molecule.h:38
double deltaS
G=0 correction potential due to electron-fluid and fluid-fluid charge kernel mismatch.
Definition: Molecule.h:42
Simulation grid descriptor.
Definition: GridInfo.h:45
STL strings and streams with case insensitive comparison.
void setModelMonoatomic(string name, double Q, double Rhs)
set to a simple monoatomic model (useful for debugging, not for actual solvation) ...
double Zsite
site charge in electrons
Definition: Molecule.h:41
bool isMonoatomic() const
whether it is a monoatomic molecule
Definition: Molecule.h:35
string name
site name
Definition: Molecule.h:36
Multi-site molecule model.
Definition: Molecule.h:31
double aPol
isotropic polarizability and corresponding cuspless-exponential width
Definition: Molecule.h:45
double Rhs
hard sphere radius
Definition: Molecule.h:37
string name
Molecule name.
Definition: Molecule.h:33
double sigmaNuc
magnitude of the nuclear charge (positive) and corresponding gaussian width
Definition: Molecule.h:39
Real and complex scalar fields in real and reciprocal space.
RadialFunctionG polKernel
Electron density, net charge density and polarizability kernels for the sites.
Definition: Molecule.h:55
vector3 getDipole() const
total dipole moment on molecule
double getAlphaTot() const
total polarizability
std::vector< vector3<> > positions
Positions w.r.t molecular origin in the reference orientation.
Definition: Molecule.h:47
RadialFunctionG mfKernel
Mean field interaction kernel (with minimum Coulomb self energy while preserving intermolecular inter...
Definition: Molecule.h:61
RadialFunctionG w2m
Hard sphere weight functions.
Definition: Molecule.h:54
double rcElec
width and location of peak in electron charge distribution
Definition: Molecule.h:43
G-space radial function stored on a uniform grid (of |G|)
Definition: RadialFunction.h:28
std::map< double, int > getBonds() const
get the harmonic sum of radii for spheres in contact, with the multiplicities for each such pair ...
double aElec
magnitude of electron charge (positive) and corresponding cuspless-exponential width ...
Definition: Molecule.h:40
double getCharge() const
total charge on molecule
double getVhs() const
total exclusion volume
void setup(const GridInfo &gInfo)
initialize the radial functions from the properties specified above
string elecFilenameG
include electron charge density from real- or G- space radial ASCII file
Definition: Molecule.h:44