DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
|
#include <nudgedElasticBandClass.h>
Public Member Functions | |
nudgedElasticBandClass (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, const dftfe::Int d_numberOfImages, const bool imageFreeze, double Kmax, double Kmin, const double pathThreshold, const dftfe::Int maximumNEBIteration, const dftfe::uInt _maxLineSearchIterCGPRP, const dftfe::uInt _lbfgsNumPastSteps, const std::string &_bfgsStepMethod, const double optimizermaxIonUpdateStep, const std::string &optimizationSolver, const std::string &coordinatesFileNEB, const std::string &domainVectorsFileNEB, const std::string &ionRelaxFlagsFile) | |
First, sets the nebRestart path. Second, creates Step0 folder with coordinaes and domainVectors file. Third, creates the array of pointers of dftClass for each image. If in restart mode, calls function to read coordinates and initialise parameters Sets solvermode: CGPT, LBFGS, BFGS. | |
dftfe::Int | findMEP () |
Calls optimizer(nonLinearClass) solve. Prints the Final NEB energies and forces. References: 1. https://pubs.aip.org/aip/jcp/article/113/22/9978/184858/Improved-tangent-estimate-in-the-nudged-elastic 2. https://pubs.aip.org/aip/jcp/article/128/13/134106/977389/Optimization-methods-for-finding-minimum-energy. | |
void | ReturnNormedVector (std::vector< double > &, dftfe::Int) |
Returns the Normed vetor satistfying ||v||_2 = 1. | |
void | LNorm (double &, std::vector< double >, dftfe::Int, dftfe::Int) |
Calculates the L-norm of a vector. | |
void | gradient (std::vector< double > &gradient) |
Identifies the images to freeze, calculates gradient. First prints the Image No., free energy and force error of each image Prints activation energy of current step. | |
dftfe::uInt | getNumberUnknowns () const |
Returns the total DoFs of the optimizer problem. | |
void | update (const std::vector< double > &solution, const bool computeForces=true, const bool useSingleAtomSolutionsInitialGuess=false) |
Updates the positions of atoms and the total step count. Calls dftPtr colve to compute eenergy and force for current step. | |
void | save () |
Saves the output files for restart. | |
void | init () |
initializes the data member d_relaxationFlags, nonlinearSolver, | |
void | value (std::vector< double > &functionValue) |
Not working. Finds the saddle point energy. | |
void | precondition (std::vector< double > &s, const std::vector< double > &gradient) |
not implemented | |
void | solution (std::vector< double > &solution) |
not implemented | |
std::vector< dftfe::uInt > | getUnknownCountFlag () const |
not implemented | |
![]() | |
nonlinearSolverProblem () | |
Constructor. | |
virtual | ~nonlinearSolverProblem ()=0 |
Destructor. | |
Public Attributes | |
double | d_kmax = 0.1 |
double | d_kmin = 0.1 |
dftfe::Int | d_NEBImageno |
Private Member Functions | |
const MPI_Comm & | getMPICommunicator () |
get MPI communicator. | |
void | CalculatePathTangent (dftfe::Int, std::vector< double > &) |
Calculate the tangent between each image. | |
void | CalculateForceparallel (dftfe::Int, std::vector< double > &, const std::vector< double > &) |
Calculates the force on atom along the tangent between images. | |
void | CalculateForceperpendicular (dftfe::Int, std::vector< double > &, const std::vector< double > &, const std::vector< double > &) |
Calculates force perpendicular to the tangent. | |
void | CalculateSpringForce (dftfe::Int, std::vector< double > &, std::vector< double >) |
Calculates the force due to the spring. | |
void | CalculateForceonImage (const std::vector< double > &, const std::vector< double > &, std::vector< double > &) |
Calculates F_NEB = G_per+ F_spring. | |
double | CalculatePathLength (bool flag) const |
Calculate path length: max diaplacement of atoms. | |
void | WriteRestartFiles (dftfe::Int step) |
Write Restart files. | |
void | CalculateSpringConstant (dftfe::Int, double &) |
Find spring constant based on k_max and k_min. | |
void | ImageError (dftfe::Int image, double &Force) |
Calculate F_per norm. | |
void | set () |
set() initalises all the private datamembers of nudgedElasticBandClass object from the parameters declared by user. | |
bool | isConverged () const |
check for convergence. | |
dftfe::Int | checkRestart (bool &periodic) |
Check the restart files. | |
dftfe::nudgedElasticBandClass::nudgedElasticBandClass | ( | 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, | ||
const dftfe::Int | d_numberOfImages, | ||
const bool | imageFreeze, | ||
double | Kmax, | ||
double | Kmin, | ||
const double | pathThreshold, | ||
const dftfe::Int | maximumNEBIteration, | ||
const dftfe::uInt | _maxLineSearchIterCGPRP, | ||
const dftfe::uInt | _lbfgsNumPastSteps, | ||
const std::string & | _bfgsStepMethod, | ||
const double | optimizermaxIonUpdateStep, | ||
const std::string & | optimizationSolver, | ||
const std::string & | coordinatesFileNEB, | ||
const std::string & | domainVectorsFileNEB, | ||
const std::string & | ionRelaxFlagsFile ) |
First, sets the nebRestart path. Second, creates Step0 folder with coordinaes and domainVectors file. Third, creates the array of pointers of dftClass for each image. If in restart mode, calls function to read coordinates and initialise parameters Sets solvermode: CGPT, LBFGS, BFGS.
|
private |
Calculates F_NEB = G_per+ F_spring.
|
private |
Calculates the force on atom along the tangent between images.
|
private |
Calculates force perpendicular to the tangent.
|
private |
Calculate path length: max diaplacement of atoms.
|
private |
Calculate the tangent between each image.
|
private |
Find spring constant based on k_max and k_min.
|
private |
Calculates the force due to the spring.
|
private |
Check the restart files.
dftfe::Int dftfe::nudgedElasticBandClass::findMEP | ( | ) |
Calls optimizer(nonLinearClass) solve. Prints the Final NEB energies and forces. References: 1. https://pubs.aip.org/aip/jcp/article/113/22/9978/184858/Improved-tangent-estimate-in-the-nudged-elastic 2. https://pubs.aip.org/aip/jcp/article/128/13/134106/977389/Optimization-methods-for-finding-minimum-energy.
|
privatevirtual |
get MPI communicator.
Implements dftfe::nonlinearSolverProblem.
|
virtual |
Returns the total DoFs of the optimizer problem.
Implements dftfe::nonlinearSolverProblem.
|
virtual |
not implemented
Implements dftfe::nonlinearSolverProblem.
|
virtual |
Identifies the images to freeze, calculates gradient. First prints the Image No., free energy and force error of each image Prints activation energy of current step.
Implements dftfe::nonlinearSolverProblem.
|
private |
Calculate F_per norm.
void dftfe::nudgedElasticBandClass::init | ( | ) |
initializes the data member d_relaxationFlags, nonlinearSolver,
|
privatevirtual |
check for convergence.
Implements dftfe::nonlinearSolverProblem.
void dftfe::nudgedElasticBandClass::LNorm | ( | double & | , |
std::vector< double > | , | ||
dftfe::Int | , | ||
dftfe::Int | ) |
Calculates the L-norm of a vector.
|
virtual |
not implemented
Implements dftfe::nonlinearSolverProblem.
void dftfe::nudgedElasticBandClass::ReturnNormedVector | ( | std::vector< double > & | , |
dftfe::Int | ) |
Returns the Normed vetor satistfying ||v||_2 = 1.
|
virtual |
Saves the output files for restart.
Implements dftfe::nonlinearSolverProblem.
|
private |
set() initalises all the private datamembers of nudgedElasticBandClass object from the parameters declared by user.
|
virtual |
not implemented
Implements dftfe::nonlinearSolverProblem.
|
virtual |
Updates the positions of atoms and the total step count. Calls dftPtr colve to compute eenergy and force for current step.
Implements dftfe::nonlinearSolverProblem.
|
virtual |
Not working. Finds the saddle point energy.
Implements dftfe::nonlinearSolverProblem.
|
private |
Write Restart files.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
double dftfe::nudgedElasticBandClass::d_kmax = 0.1 |
double dftfe::nudgedElasticBandClass::d_kmin = 0.1 |
|
private |
|
private |
|
private |
|
private |
dftfe::Int dftfe::nudgedElasticBandClass::d_NEBImageno |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
total number of calls to update()
|
private |
|
private |
|
private |
|
private |