JDFTx  1.2.0
Dump.h
1 /*-------------------------------------------------------------------
2 Copyright 2011 Ravishankar Sundararaman
3 Copyright 1996-2003 Sohrab Ismail-Beigi
4 
5 This file is part of JDFTx.
6 
7 JDFTx is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 JDFTx is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with JDFTx. If not, see <http://www.gnu.org/licenses/>.
19 -------------------------------------------------------------------*/
20 
21 #ifndef JDFTX_ELECTRONIC_DUMP_H
22 #define JDFTX_ELECTRONIC_DUMP_H
23 
24 #include <electronic/common.h>
25 #include <electronic/matrix.h>
26 #include <core/ScalarField.h>
27 #include <set>
28 #include <memory>
29 
31 enum DumpFrequency
32 { DumpFreq_End,
33  DumpFreq_Electronic,
34  DumpFreq_Fluid,
35  DumpFreq_Ionic,
36  DumpFreq_Lattice,
37  DumpFreq_Gummel,
38  DumpFreq_Dynamics,
39  DumpFreq_Delim //special value used as a delimiter during command processing
40 
41 };
42 
44 enum DumpVariable { DumpAll, DumpNone, DumpState, //All, none or only those required to restart calculation
45  DumpIonicPositions, DumpForces, DumpLattice, DumpIonicDensity, //Ionic positions, Forces, Lattice vectors, Nuclear charge density
46  DumpElecDensity, DumpElecDensityAccum, DumpCoreDensity, DumpKEdensity, DumpFluidDensity, // electronic valence, core and KE densities, fluid densities
47  DumpDvac, DumpDfluid, DumpDtot, //electrostatic potential of explicit system, fluid system, total
48  DumpVcavity, DumpVfluidTot, //cavity potential of fluid, net electron potential due to fluid (electrostatic+cavity)
49  DumpVlocps, DumpVscloc, DumpBandEigs, DumpEigStats, DumpFillings, DumpRhoAtom,
50  DumpEcomponents, DumpExcCompare,
51  DumpBoundCharge, DumpSolvationRadii, DumpQMC, DumpOcean, DumpRealSpaceWfns, DumpFluidDebug, DumpSlabEpsilon, DumpChargedDefect,
52  DumpDOS, DumpPolarizability, DumpElectronScattering, DumpSIC, DumpDipole, DumpStress, DumpExcitations,
53  DumpMomenta, DumpSymmetries, DumpKpoints, DumpGvectors, DumpOrbitalDep, DumpXCanalysis, DumpEresolvedDensity, DumpFermiDensity,
54  DumpDelim, //special value used as a delimiter during command processing
55 };
56 
57 
59 class Dump : public std::set<std::pair<DumpFrequency,DumpVariable> >
60 {
61 public:
62  Dump();
63  void setup(const Everything&);
64 
67  void operator()(DumpFrequency freq, int iter);
68 
70  string getFilename(string varName) const;
71 
73  bool checkInterval(DumpFrequency freq, int iter) const;
74 
75  std::shared_ptr<class DOS> dos;
76  std::shared_ptr<struct Polarizability> polarizability;
77  std::shared_ptr<struct ElectronScattering> electronScattering;
78  std::vector< std::pair<double,double> > densityErange;
79  std::vector<double> fermiDensityLevels;
80  std::shared_ptr<struct SlabEpsilon> slabEpsilon;
81  std::shared_ptr<struct ChargedDefect> chargedDefect;
83 private:
84  const Everything* e;
85  string format;
86  string stamp;
87  std::map<DumpFrequency,int> interval;
88  friend struct CommandDump;
89  friend struct CommandDumpName;
90  friend struct CommandDumpInterval;
91  void dumpQMC();
92  void dumpOcean();
93  void dumpRsol(ScalarField nbound, string fname);
94 };
95 
96 namespace Moments{void rn_pow_x(int i, vector3<> r, int dir, matrix3<> R, double moment, vector3<> r0, double* rx);}
97 
98 #endif // JDFTX_ELECTRONIC_DUMP_H
std::shared_ptr< struct SlabEpsilon > slabEpsilon
slab dielectric function calculator
Definition: Dump.h:80
bool potentialSubtraction
whether to subtract neutral-atom potentials in Dvac and Dtot output
Definition: Dump.h:82
std::shared_ptr< class DOS > dos
density-of-states calculator
Definition: Dump.h:75
std::shared_ptr< struct ChargedDefect > chargedDefect
charged defect correction calculator
Definition: Dump.h:81
Real and complex scalar fields in real and reciprocal space.
std::vector< std::pair< double, double > > densityErange
energy ranges for energy-resolved density output
Definition: Dump.h:78
bool checkInterval(DumpFrequency freq, int iter) const
Check whether to dump at given frequency and iteration:
std::shared_ptr< struct ElectronScattering > electronScattering
electron-electron scattering calculator
Definition: Dump.h:77
std::shared_ptr< struct Polarizability > polarizability
electronic polarizability calculator
Definition: Dump.h:76
Definition: Everything.h:41
std::shared_ptr< ScalarFieldData > ScalarField
A smart reference-counting pointer to ScalarFieldData.
Definition: ScalarField.h:41
std::vector< double > fermiDensityLevels
energies at which to evaluate fermi-dirac derivative
Definition: Dump.h:79
Definition: Dump.h:96
string getFilename(string varName) const
Get the dump filename corresponding to a particular variable name.
void operator()(DumpFrequency freq, int iter)
Stores the list of what to dump and when, and implements the functions to do so.
Definition: Dump.h:59