JDFTx  1.0.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_Delim //special value used as a delimiter during command processing
39 };
40 
42 enum DumpVariable { DumpAll, DumpNone, DumpState, //All, none or only those required to restart calculation
43  DumpIonicPositions, DumpForces, DumpLattice, DumpIonicDensity, //Ionic positions, Forces, Lattice vectors, Nuclear charge density
44  DumpElecDensity, DumpCoreDensity, DumpKEdensity, DumpFluidDensity, // electronic valence, core and KE densities, fluid densities
45  DumpDvac, DumpDfluid, DumpDtot, //electrostatic potential of explicit system, fluid system, total
46  DumpVcavity, DumpVfluidTot, //cavity potential of fluid, net electron potential due to fluid (electrostatic+cavity)
47  DumpVlocps, DumpVscloc, DumpBandEigs, DumpEigStats, DumpFillings, DumpRhoAtom,
48  DumpEcomponents, DumpExcCompare,
49  DumpBoundCharge, DumpSolvationRadii, DumpQMC, DumpOcean, DumpRealSpaceWfns, DumpFluidDebug, DumpSlabEpsilon, DumpChargedDefect,
50  DumpOptVext, DumpDOS, DumpPolarizability, DumpElectronScattering, DumpSIC, DumpDipole, DumpStress, DumpExcitations,
51  DumpMomenta, DumpSymmetries, DumpKpoints, DumpGvectors, DumpOrbitalDep, DumpXCanalysis, DumpEresolvedDensity, DumpFermiDensity,
52  DumpDelim, //special value used as a delimiter during command processing
53 };
54 
55 
57 class Dump : public std::set<std::pair<DumpFrequency,DumpVariable> >
58 {
59 public:
60  void setup(const Everything&);
61 
64  void operator()(DumpFrequency freq, int iter);
65 
67  string getFilename(string varName) const;
68 
70  bool checkInterval(DumpFrequency freq, int iter) const;
71 
72  std::shared_ptr<class DOS> dos;
73  std::shared_ptr<struct Polarizability> polarizability;
74  std::shared_ptr<struct ElectronScattering> electronScattering;
75  std::vector< std::pair<double,double> > densityErange;
76  std::vector<double> fermiDensityLevels;
77  std::shared_ptr<struct SlabEpsilon> slabEpsilon;
78  std::shared_ptr<struct ChargedDefect> chargedDefect;
79 private:
80  const Everything* e;
81  string format;
82  string stamp;
83  std::map<DumpFrequency,int> interval;
84  friend struct CommandDump;
85  friend struct CommandDumpName;
86  friend struct CommandDumpInterval;
87  void dumpQMC();
88  void dumpOcean();
89  void dumpRsol(ScalarField nbound, string fname);
90 };
91 
92 namespace Moments{void rn_pow_x(int i, vector3<> r, int dir, matrix3<> R, double moment, vector3<> r0, double* rx);}
93 
94 #endif // JDFTX_ELECTRONIC_DUMP_H
std::shared_ptr< struct SlabEpsilon > slabEpsilon
slab dielectric function calculator
Definition: Dump.h:77
std::shared_ptr< class DOS > dos
density-of-states calculator
Definition: Dump.h:72
std::shared_ptr< struct ChargedDefect > chargedDefect
charged defect correction calculator
Definition: Dump.h:78
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:75
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:74
std::shared_ptr< struct Polarizability > polarizability
electronic polarizability calculator
Definition: Dump.h:73
Definition: Everything.h:41
std::shared_ptr< ScalarFieldData > ScalarField
A smart reference-counting pointer to ScalarFieldData.
Definition: ScalarField.h:40
std::vector< double > fermiDensityLevels
energies at which to evaluate fermi-dirac derivative
Definition: Dump.h:76
Definition: Dump.h:92
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:57