20#ifndef molecularDynamicsClass_H_
21#define molecularDynamicsClass_H_
43 const std::string restartFilesPath,
44 const MPI_Comm & mpi_comm_parent,
47 const bool useDevice);
51 const double haToeV = 27.211386245988;
54 const double kB = 8.617333262e-05;
80 dealii::ConditionalOStream
pcout;
121 mdNVE(std::vector<double> & KineticEnergyVector,
122 std::vector<double> & InternalEnergyVector,
123 std::vector<double> & EntropicEnergyVector,
124 std::vector<double> & TotalEnergyVector,
125 std::vector<dealii::Tensor<1, 3, double>> &displacements,
126 std::vector<double> & velocity,
127 std::vector<double> &
force,
128 const std::vector<double> & atomMass);
151 std::vector<double> & KineticEnergyVector,
152 std::vector<double> & InternalEnergyVector,
153 std::vector<double> & EntropicEnergyVector,
154 std::vector<double> & TotalEnergyVector,
155 std::vector<dealii::Tensor<1, 3, double>> &displacements,
156 std::vector<double> & velocity,
157 std::vector<double> &
force,
158 const std::vector<double> & atomMass);
184 std::vector<double> & KineticEnergyVector,
185 std::vector<double> & InternalEnergyVector,
186 std::vector<double> & EntropicEnergyVector,
187 std::vector<double> & TotalEnergyVector,
188 std::vector<dealii::Tensor<1, 3, double>> &displacements,
189 std::vector<double> & velocity,
190 std::vector<double> &
force,
191 const std::vector<double> & atomMass);
213 std::vector<double> &InternalEnergyVector,
214 std::vector<double> &EntropicEnergyVector,
215 std::vector<double> &TotalEnergyVector,
216 std::vector<dealii::Tensor<1, 3, double>> &displacements,
217 std::vector<double> & velocity,
218 std::vector<double> &
force,
219 const std::vector<double> & atomMass);
240 const std::vector<double> &M,
261 std::vector<double> &v_e,
262 std::vector<double> &
e,
263 std::vector<double> Q,
280 svr(std::vector<double> &v,
double KE,
double KEref);
302 std::vector<dealii::Tensor<1, 3, double>> &r,
303 const std::vector<double> & atomMass,
304 std::vector<double> & forceOnAtoms);
323 const std::vector<double> & velocity,
324 const std::vector<double> &
force,
325 const std::vector<double> &KineticEnergyVector,
326 const std::vector<double> &InternalEnergyVector,
327 const std::vector<double> &TotalEnergyVector,
348 std::vector<double> &velocity,
349 std::vector<double> &
force,
350 std::vector<double> &KE,
351 std::vector<double> &IE,
352 std::vector<double> &TE);
368 const std::vector<double> &
e,
369 const std::vector<double> &Q,
386 std::vector<double> &
e,
387 std::vector<double> &Q);
402 const std::vector<dealii::Tensor<1, 3, double>> &r,
425 const std::vector<double> &thermoposition,
426 const std::vector<double> &thermomass,
439 std::string &domainVectorsFile,
abstract base class for dft
Definition dftBase.h:34
std::string d_ThermostatType
Definition molecularDynamicsClass.h:92
void DensitySplitExtrapolation(int TimeStep)
DensityExtrapolation calculates the t+dt density as a second order extrapolation of density from t,...
double velocityVerlet(std::vector< double > &v, std::vector< dealii::Tensor< 1, 3, double > > &r, const std::vector< double > &atomMass, std::vector< double > &forceOnAtoms)
velocityVerlet
std::vector< std::vector< double > > d_atomFractionalunwrapped
Definition molecularDynamicsClass.h:95
void writeTotalDisplacementFile(const std::vector< dealii::Tensor< 1, 3, double > > &r, int time)
writeTotalDisplacementFile: Updates Displacement.chk and appends TotalDisplacement....
dealii::ConditionalOStream pcout
Definition molecularDynamicsClass.h:80
const unsigned int d_this_mpi_process
Definition molecularDynamicsClass.h:77
std::string d_restartFilesPath
Definition molecularDynamicsClass.h:82
double svr(std::vector< double > &v, double KE, double KEref)
void DensityExtrapolation(int TimeStep)
DensityExtrapolation Identifies the folder containing the restart file, sets the path of coordinates ...
void InitialiseFromRestartNHCFile(std::vector< double > &v_e, std::vector< double > &e, std::vector< double > &Q)
InitialiseFromRestartNHCFile: Reads the NHC parameters during restart.
dftBase * d_dftPtr
Definition molecularDynamicsClass.h:73
int mdNVTnosehoverchainsThermostat(std::vector< double > &KineticEnergyVector, std::vector< double > &InternalEnergyVector, std::vector< double > &EntropicEnergyVector, std::vector< double > &TotalEnergyVector, std::vector< dealii::Tensor< 1, 3, double > > &displacements, std::vector< double > &velocity, std::vector< double > &force, const std::vector< double > &atomMass)
mdNVTnosehoverchainsThermostat Performs a Canonical Ensemble MD calculation. The inital temperature i...
distributedCPUVec< double > d_extrapDensity_tmin1
Definition molecularDynamicsClass.h:97
void InitialiseFromRestartFile(std::vector< dealii::Tensor< 1, 3, double > > &disp, std::vector< double > &velocity, std::vector< double > &force, std::vector< double > &KE, std::vector< double > &IE, std::vector< double > &TE)
InitialiseFromRestartFile : Initialise atomcordinates, velocity and force at restart.
double d_MDstartWallTime
Definition molecularDynamicsClass.h:93
int mdNVTsvrThermostat(std::vector< double > &KineticEnergyVector, std::vector< double > &InternalEnergyVector, std::vector< double > &EntropicEnergyVector, std::vector< double > &TotalEnergyVector, std::vector< dealii::Tensor< 1, 3, double > > &displacements, std::vector< double > &velocity, std::vector< double > &force, const std::vector< double > &atomMass)
mdNVTsvrThermostat Performs a Canonical Ensemble MD calculation. The inital temperature is set by run...
void writeRestartFile(const std::vector< dealii::Tensor< 1, 3, double > > &disp, const std::vector< double > &velocity, const std::vector< double > &force, const std::vector< double > &KineticEnergyVector, const std::vector< double > &InternalEnergyVector, const std::vector< double > &TotalEnergyVector, int time)
writeRestartFile: Writing files at each timestep to mdRestart
const double kB
Definition molecularDynamicsClass.h:54
void set()
set() initalises all the private datamembers of mdclass object from the parameters declared by user.
const int d_verbosity
Definition molecularDynamicsClass.h:83
distributedCPUVec< double > d_extrapDensity_tp1
Definition molecularDynamicsClass.h:98
int d_ThermostatTimeConstant
Definition molecularDynamicsClass.h:91
unsigned int d_restartFlag
Definition molecularDynamicsClass.h:85
distributedCPUVec< double > d_extrapDensity_tmin2
Definition molecularDynamicsClass.h:97
int mdNVTrescaleThermostat(std::vector< double > &KineticEnergyVector, std::vector< double > &InternalEnergyVector, std::vector< double > &EntropicEnergyVector, std::vector< double > &TotalEnergyVector, std::vector< dealii::Tensor< 1, 3, double > > &displacements, std::vector< double > &velocity, std::vector< double > &force, const std::vector< double > &atomMass)
mdNVTrescaleThermostat Performs a Constant Kinetic Energy Ensemble MD calculation....
distributedCPUVec< double > d_extrapDensity_t0
Definition molecularDynamicsClass.h:98
double NoseHoverExtendedLagrangian(const std::vector< double > &thermovelocity, const std::vector< double > &thermoposition, const std::vector< double > &thermomass, double PE, double KE, double T)
NoseHoverExtendedLagrangian: Computes the Nose-Hover Hamiltonian when using NHC thermostat.
std::vector< double > d_domainLength
Definition molecularDynamicsClass.h:96
const double AngTobohr
Definition molecularDynamicsClass.h:53
std::unique_ptr< dftfeWrapper > d_dftfeWrapper
Definition molecularDynamicsClass.h:72
double RescaleVelocities(std::vector< double > &v, const std::vector< double > &M, double Temperature)
RescaleVelocities controls the velocity at timestep t. The scaling of velocities depends on ratio of ...
unsigned int d_numberGlobalCharges
Definition molecularDynamicsClass.h:86
const double haToeV
Definition molecularDynamicsClass.h:51
unsigned int d_TimeIndex
Definition molecularDynamicsClass.h:88
void writeRestartNHCfile(const std::vector< double > &v_e, const std::vector< double > &e, const std::vector< double > &Q, const int time)
NoseHoverExtendedLagrangian Writes the NHC parameters at each timeStep.
double d_MaxWallTime
Definition molecularDynamicsClass.h:94
int mdNVE(std::vector< double > &KineticEnergyVector, std::vector< double > &InternalEnergyVector, std::vector< double > &EntropicEnergyVector, std::vector< double > &TotalEnergyVector, std::vector< dealii::Tensor< 1, 3, double > > &displacements, std::vector< double > &velocity, std::vector< double > &force, const std::vector< double > &atomMass)
mdNVE Performs a Ccanonical Ensemble MD calculation. The inital temperature is set by runMD()....
const double bohrToAng
Definition molecularDynamicsClass.h:52
molecularDynamicsClass(const std::string parameter_file, const std::string restartFilesPath, const MPI_Comm &mpi_comm_parent, const bool restart, const int verbosity, const bool useDevice)
molecularDynamicsClass constructor: copy data from dftparameters to the memebrs of molecularDynamicsC...
int d_startingTimeStep
Definition molecularDynamicsClass.h:56
int runMD()
runMD: Assign atom mass to charge. Create vectors for displacement, velocity, force....
unsigned int d_numberofSteps
Definition molecularDynamicsClass.h:89
void NoseHoverChains(std::vector< double > &v, std::vector< double > &v_e, std::vector< double > &e, std::vector< double > Q, double KE, double Temperature)
NoseHoverChains controls the velocity at timestep t. The temperature is contolled by 2 thermostats....
const double haPerBohrToeVPerAng
Definition molecularDynamicsClass.h:50
double d_TimeStep
Definition molecularDynamicsClass.h:87
double d_startingTemperature
Definition molecularDynamicsClass.h:90
int checkRestart(std::string &coordinatesFile, std::string &domainVectorsFile, bool &scfRestart)
checkRestart: Identifies the folder containing the restart file, sets the path of coordinates file an...
const MPI_Comm d_mpiCommParent
Definition molecularDynamicsClass.h:76
Definition forceWfcContractions.h:32
Definition pseudoPotentialToDftfeConverter.cc:34
@ e
Definition ExcSSDFunctionalBaseClass.h:52
dealii::LinearAlgebra::distributed::Vector< elem_type, dealii::MemorySpace::Host > distributedCPUVec
Definition headers.h:92