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
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
dealii::ConditionalOStream pcout
Definition molecularDynamicsClass.h:80
void DensityExtrapolation(dftfe::Int TimeStep)
DensityExtrapolation Identifies the folder containing the restart file, sets the path of coordinates ...
void writeRestartNHCfile(const std::vector< double > &v_e, const std::vector< double > &e, const std::vector< double > &Q, const dftfe::Int time)
NoseHoverExtendedLagrangian Writes the NHC parameters at each timeStep.
dftfe::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...
std::string d_restartFilesPath
Definition molecularDynamicsClass.h:82
double svr(std::vector< double > &v, double KE, double KEref)
dftfe::uInt d_restartFlag
Definition molecularDynamicsClass.h:85
dftfe::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...
void InitialiseFromRestartNHCFile(std::vector< double > &v_e, std::vector< double > &e, std::vector< double > &Q)
InitialiseFromRestartNHCFile: Reads the NHC parameters during restart.
dftfe::uInt d_numberGlobalCharges
Definition molecularDynamicsClass.h:86
const dftfe::Int d_verbosity
Definition molecularDynamicsClass.h:83
dftBase * d_dftPtr
Definition molecularDynamicsClass.h:73
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
dftfe::Int runMD()
runMD: Assign atom mass to charge. Create vectors for displacement, velocity, force....
const double kB
Definition molecularDynamicsClass.h:54
void set()
set() initalises all the private datamembers of mdclass object from the parameters declared by user.
distributedCPUVec< double > d_extrapDensity_tp1
Definition molecularDynamicsClass.h:98
void writeTotalDisplacementFile(const std::vector< dealii::Tensor< 1, 3, double > > &r, dftfe::Int time)
writeTotalDisplacementFile: Updates Displacement.chk and appends TotalDisplacement....
dftfe::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...
const dftfe::uInt d_this_mpi_process
Definition molecularDynamicsClass.h:77
dftfe::Int d_startingTimeStep
Definition molecularDynamicsClass.h:56
distributedCPUVec< double > d_extrapDensity_tmin2
Definition molecularDynamicsClass.h:97
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 ...
dftfe::uInt d_numberofSteps
Definition molecularDynamicsClass.h:89
const double haToeV
Definition molecularDynamicsClass.h:51
molecularDynamicsClass(const std::string parameter_file, const std::string restartFilesPath, const MPI_Comm &mpi_comm_parent, const bool restart, const dftfe::Int verbosity, const bool useDevice)
molecularDynamicsClass constructor: copy data from dftparameters to the memebrs of molecularDynamicsC...
dftfe::uInt d_TimeIndex
Definition molecularDynamicsClass.h:88
void DensitySplitExtrapolation(dftfe::Int TimeStep)
DensityExtrapolation calculates the t+dt density as a second order extrapolation of density from t,...
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, dftfe::Int time)
writeRestartFile: Writing files at each timestep to mdRestart
double d_MaxWallTime
Definition molecularDynamicsClass.h:94
dftfe::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
dftfe::Int d_ThermostatTimeConstant
Definition molecularDynamicsClass.h:91
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
const MPI_Comm d_mpiCommParent
Definition molecularDynamicsClass.h:76
dftfe::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....
Definition forceWfcContractions.h:32
Definition pseudoPotentialToDftfeConverter.cc:34
@ e
Definition ExcSSDFunctionalBaseClass.h:59
dealii::LinearAlgebra::distributed::Vector< elem_type, dealii::MemorySpace::Host > distributedCPUVec
Definition headers.h:92
std::uint32_t uInt
Definition TypeConfig.h:10
std::int32_t Int
Definition TypeConfig.h:11