JDFTx  1.0.0
IonDynamics.h
1 /*-------------------------------------------------------------------
2 Copyright 2011 Ravishankar Sundararaman
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_IONDYNAMICS_H
21 #define JDFTX_ELECTRONIC_IONDYNAMICS_H
22 
23 #include <electronic/common.h>
24 #include <electronic/IonicMinimizer.h>
25 #include <core/vector3.h>
26 #include <core/matrix3.h>
27 #include <vector>
28 
30 { Everything& e;
31  double initialPotentialEnergy;
32  double kineticEnergy, potentialEnergy;
33  double pressure, totalMomentumNorm;
34  double totalMass; int numberOfAtoms;
35  vector3<> totalMomentum;
36 
37  IonicMinimizer imin; //Just to be able to call IonicMinimizer::step(). Doesn't minimize anything.
38 
39  IonDynamics(Everything& e) : e(e), totalMass(0.0), numberOfAtoms(0), imin(IonicMinimizer(e)){};
40  //Virtual functions from Minimizable:
41  void step(const IonicGradient&,const double&);
42  void velocitiesInit();
44  void computeMomentum();
45  void computePressure();
46  void computeKineticEnergy();
47  bool report(double t);
48 
49  void run();
50 
51 };
52 
53 #endif //JDFTX_ELECTRONIC_IONDYNAMICS_H
void computePressure()
Updates pressure.
void computeMomentum()
Calculate totalMomentum and totalMomentumNorm.
void computeKineticEnergy()
Updates kineticEnergy
Definition: IonDynamics.h:29
Definition: IonicMinimizer.h:52
Definition: Everything.h:41
double computeAcceleration(IonicGradient &)
Write acceleration into accel in cartesian coordinates and return relevant energy.
void run()
Run the simulation.
Object to hold all the forces.
Definition: IonicMinimizer.h:31