DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
|
#include <molecularDynamicsClass.h>
Public Member Functions | |
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 molecularDynamicsClass | |
int | runMD () |
runMD: Assign atom mass to charge. Create vectors for displacement, velocity, force. Create KE vector, TE vector, PE vector. Initialise velocities from Boltsmann distribution. Set Center of Mass velocities to be 0. Call the resepective ensemble based on input file | |
Public Attributes | |
const double | haPerBohrToeVPerAng = 27.211386245988 / 0.529177210903 |
const double | haToeV = 27.211386245988 |
const double | bohrToAng = 0.529177210903 |
const double | AngTobohr = 1.0 / bohrToAng |
const double | kB = 8.617333262e-05 |
int | d_startingTimeStep |
Private Member Functions | |
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(). Temperature is NOT_CONTROLLED. Controls the timeloop. | |
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 is set by runMD(). Thermostat type is NOSE_HOVER_CHAINS. Controls the timeloop. | |
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. The inital temperature is set by runMD(). Thermostat type is RESCALE. Controls the timeloop. At timestep which is multiple of Thermostat time constatn, the veloctites are rescaled *such that the temperature is set to inital temperature . | |
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 runMD(). Thermostat type is SVR. Controls the timeloop. | |
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 T at that timestep and inital Temperature. | |
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. Thermostat 1 contols the velocity of all Charges. Thermostat 2 controls thermostat 1. Employs Extended Lagrangian approach. | |
double | svr (std::vector< double > &v, double KE, double KEref) |
double | velocityVerlet (std::vector< double > &v, std::vector< dealii::Tensor< 1, 3, double > > &r, const std::vector< double > &atomMass, std::vector< double > &forceOnAtoms) |
velocityVerlet | |
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 | |
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. | |
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. | |
void | InitialiseFromRestartNHCFile (std::vector< double > &v_e, std::vector< double > &e, std::vector< double > &Q) |
InitialiseFromRestartNHCFile: Reads the NHC parameters during restart. | |
void | writeTotalDisplacementFile (const std::vector< dealii::Tensor< 1, 3, double > > &r, int time) |
writeTotalDisplacementFile: Updates Displacement.chk and appends TotalDisplacement.chk | |
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. | |
int | checkRestart (std::string &coordinatesFile, std::string &domainVectorsFile, bool &scfRestart) |
checkRestart: Identifies the folder containing the restart file, sets the path of coordinates file and restursn the starting timestep * | |
void | DensityExtrapolation (int TimeStep) |
DensityExtrapolation Identifies the folder containing the restart file, sets the path of coordinates file and restursn the starting timestep *. | |
void | DensitySplitExtrapolation (int TimeStep) |
DensityExtrapolation calculates the t+dt density as a second order extrapolation of density from t, t-dt and t-2dt. | |
void | set () |
set() initalises all the private datamembers of mdclass object from the parameters declared by user. | |
Private Attributes | |
std::unique_ptr< dftfeWrapper > | d_dftfeWrapper |
dftBase * | d_dftPtr |
const MPI_Comm | d_mpiCommParent |
const unsigned int | d_this_mpi_process |
dealii::ConditionalOStream | pcout |
std::string | d_restartFilesPath |
const int | d_verbosity |
unsigned int | d_restartFlag |
unsigned int | d_numberGlobalCharges |
double | d_TimeStep |
unsigned int | d_TimeIndex |
unsigned int | d_numberofSteps |
double | d_startingTemperature |
int | d_ThermostatTimeConstant |
std::string | d_ThermostatType |
double | d_MDstartWallTime |
double | d_MaxWallTime |
std::vector< std::vector< double > > | d_atomFractionalunwrapped |
std::vector< double > | d_domainLength |
distributedCPUVec< double > | d_extrapDensity_tmin2 |
distributedCPUVec< double > | d_extrapDensity_tmin1 |
distributedCPUVec< double > | d_extrapDensity_t0 |
distributedCPUVec< double > | d_extrapDensity_tp1 |
dftfe::molecularDynamicsClass::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 molecularDynamicsClass
[in] | dftBase | *_dftBasePtr pointer to base class of dftClass |
[in] | mpi_comm_parent | parent mpi communicator |
|
private |
checkRestart: Identifies the folder containing the restart file, sets the path of coordinates file and restursn the starting timestep *
|
private |
DensityExtrapolation Identifies the folder containing the restart file, sets the path of coordinates file and restursn the starting timestep *.
|
private |
DensityExtrapolation calculates the t+dt density as a second order extrapolation of density from t, t-dt and t-2dt.
|
private |
InitialiseFromRestartFile : Initialise atomcordinates, velocity and force at restart.
[out] | disp | Displacements of previous timestep from restart |
[out] | velocity | Velocity updated from restart |
[out] | force | Force updated from dft->Solve |
[out] | PE | Free energy of system at current Timestep |
[out] | KE | Kinetic ENergy of nuclei at current Timestep |
[out] | TE | temperature at current Timestep |
|
private |
InitialiseFromRestartNHCFile: Reads the NHC parameters during restart.
[out] | thermovelocity | Velocity of each, updated at each TimeStep |
[out] | thermoposition | Position of each thermostat , updated at each TimeStep |
[out] | thermomass | Stores the mass of each thermostat. |
|
private |
mdNVE Performs a Ccanonical Ensemble MD calculation. The inital temperature is set by runMD(). Temperature is NOT_CONTROLLED. Controls the timeloop.
[in] | atomMass | Stores the mass of each Charge. |
[out] | KineticEnergyVector | Stores KineticEnergy at each TimeStep |
[out] | InternalEnergyVector | Stores InternalEnergy at each TimeStep |
[out] | EntropicEnergyVector | Stores PotentialEnergy at each TimeStep |
[out] | TotalEnergyVector | Stores TotalEnergy at each TimeStep |
[out] | displacements | Stores the displacment of each Charge, updated at each TimeStep |
[out] | velocity | Stores the velocity of each Charge, updated at each TimeStep |
[out] | force | Stores the -ve of force on each charge, updated at each TimeStep |
|
private |
mdNVTnosehoverchainsThermostat Performs a Canonical Ensemble MD calculation. The inital temperature is set by runMD(). Thermostat type is NOSE_HOVER_CHAINS. Controls the timeloop.
[in] | atomMass | Stores the mass of each Charge. |
[out] | KineticEnergyVector | Stores KineticEnergy at each TimeStep |
[out] | InternalEnergyVector | Stores InternalEnergy at each TimeStep |
[out] | EntropicEnergyVector | Stores PotentialEnergy at each TimeStep |
[out] | TotalEnergyVector | Stores TotalEnergy at each TimeStep |
[out] | displacements | Stores the displacment of each Charge, updated at each TimeStep |
[out] | velocity | Stores the velocity of each Charge, updated at each TimeStep |
[out] | force | Stores the -ve of force on each charge, updated at each TimeStep |
|
private |
mdNVTrescaleThermostat Performs a Constant Kinetic Energy Ensemble MD calculation. The inital temperature is set by runMD(). Thermostat type is RESCALE. Controls the timeloop. At timestep which is multiple of Thermostat time constatn, the veloctites are rescaled *such that the temperature is set to inital temperature .
[in] | atomMass | Stores the mass of each Charge. |
[out] | KineticEnergyVector | Stores KineticEnergy at each TimeStep |
[out] | InternalEnergyVector | Stores InternalEnergy at each TimeStep |
[out] | EntropicEnergyVector | Stores PotentialEnergy at each TimeStep |
[out] | TotalEnergyVector | Stores TotalEnergy at each TimeStep |
[out] | displacements | Stores the displacment of each Charge, updated at each TimeStep |
[out] | velocity | Stores the velocity of each Charge, updated at each TimeStep |
[out] | force | Stores the -ve of force on each charge, updated at each TimeStep |
|
private |
mdNVTsvrThermostat Performs a Canonical Ensemble MD calculation. The inital temperature is set by runMD(). Thermostat type is SVR. Controls the timeloop.
[in] | massAtoms | Stores the mass of each Charge. * |
[out] | KineticEnergyVector | Stores KineticEnergy at each TimeStep |
[out] | InternalEnergyVector | Stores InternalEnergy at each TimeStep |
[out] | EntropicEnergyVector | Stores PotentialEnergy at each TimeStep |
[out] | TotalEnergyVector | Stores TotalEnergy at each TimeStep |
[out] | displacements | Stores the displacment of each Charge, updated at each TimeStep |
[out] | velocity | Stores the velocity of each Charge, updated at each TimeStep |
[out] | force | Stores the -ve of force on each charge, updated at each TimeStep |
|
private |
NoseHoverChains controls the velocity at timestep t. The temperature is contolled by 2 thermostats. Thermostat 1 contols the velocity of all Charges. Thermostat 2 controls thermostat 1. Employs Extended Lagrangian approach.
[in] | Q | stores mass of each Thermostat |
[in] | Temperature | temperature of previous timestep |
[out] | v | Stores the velocity of each Charge, updated at each TimeStep |
[out] | v_e | Stores the thermostat velocity |
[out] | e | Stores the position of each thermosat |
|
private |
NoseHoverExtendedLagrangian: Computes the Nose-Hover Hamiltonian when using NHC thermostat.
[in] | thermovelocity | Velocity of each, updated at each TimeStep |
[in] | thermoposition | Position of each thermostat , updated at each TimeStep |
[in] | thermomass | Stores the mass of each thermostat. |
[in] | PE | Free energy of system at current Timestep |
[in] | KE | Kinetic ENergy of nuclei at current Timestep |
[in] | Temperature | temperature at current Timestep |
|
private |
RescaleVelocities controls the velocity at timestep t. The scaling of velocities depends on ratio of T at that timestep and inital Temperature.
@param[in] M Stores the mass of each Charge. @param[in] Temperature temperature at current Timestep @param[out] v Stores the velocity of each Charge, updated at each
Timestep
@param[return] KE Kinetic Energy at current timestp in eV
int dftfe::molecularDynamicsClass::runMD | ( | ) |
runMD: Assign atom mass to charge. Create vectors for displacement, velocity, force. Create KE vector, TE vector, PE vector. Initialise velocities from Boltsmann distribution. Set Center of Mass velocities to be 0. Call the resepective ensemble based on input file
|
private |
set() initalises all the private datamembers of mdclass object from the parameters declared by user.
|
private |
[in] | KEref | Target value of Kinetic Enegy from Temperature |
[out] | v | Stores the velocity of each Charge, updated at each TimeStep |
[out] | KE | rescaled Kinetic Energy from svr thermostat |
|
private |
velocityVerlet
[in] | atomMass | Stores the mass of each Charge. |
[return] | KE Kinetic Energy at current timestp in eV | |
[out] | forceonAtoms | Updated -ve forces on each charge. |
[out] | r | Updated displacement |
[out] | v | Updated velocity of each atom |
|
private |
writeRestartFile: Writing files at each timestep to mdRestart
[in] | velocity | Velocity updated from restart |
[in] | force | Force data at each timeStep |
[in] | PE | Free energy of system at current Timestep |
[in] | KE | Kinetic ENergy of nuclei at current Timestep |
[in] | TE | temperature at current Timestep |
[in] | time | Current TimeStep |
|
private |
NoseHoverExtendedLagrangian Writes the NHC parameters at each timeStep.
[in] | thermovelocity | Velocity of each, updated at each TimeStep |
[in] | thermoposition | Position of each thermostat , updated at each TimeStep |
[in] | thermomass | Stores the mass of each thermostat. |
[in] | time | Current TimeStep |
|
private |
writeTotalDisplacementFile: Updates Displacement.chk and appends TotalDisplacement.chk
[in] | r | Displacemnt of each atom, updated at each TimeStep |
[in] | time | each TimeStep |
const double dftfe::molecularDynamicsClass::AngTobohr = 1.0 / bohrToAng |
const double dftfe::molecularDynamicsClass::bohrToAng = 0.529177210903 |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
int dftfe::molecularDynamicsClass::d_startingTimeStep |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
const double dftfe::molecularDynamicsClass::haPerBohrToeVPerAng = 27.211386245988 / 0.529177210903 |
const double dftfe::molecularDynamicsClass::haToeV = 27.211386245988 |
const double dftfe::molecularDynamicsClass::kB = 8.617333262e-05 |
|
private |