To utilize the PES in an MD code, follow these steps:
- Compile UnitConversion.f90, sysvariables.f90, potvariablesEG.f90, getEnForceEG.f90, initEG.f90 routines in this particular order.
- Next, initialize the modules. Do this by invoking the initEG() subroutine.
- Integrate the modules into the subroutine responsible for calculating Forces and Energies. To achieve this, include the line use EGforceEMod before specifying the variables.
- To compute the force, use the getForce(X, F, V) subroutine. Where X represents the input Cartesian geometry in Angstrom (a 1x3N array), F denotes the force array with a dimension of 1x3N, and V (a scalar) stands for the potential. N is the total number of atoms (N=10 for EG).
- If your objective is to compute only the energy, utilize the getPot(X, V, Vrs) subroutine. Here, X and V are as in step 3. Additionally, Vrs denotes the potential at the reaction surface.
The input geometries should follow the atom number convention as found in the eg_ref.zmat file.
PotFitParams2FE contains all the fitted parameter files. By default, it must be in the same directory where the code is executed. This can be changed manually by editing the potvariables.f90 file.
All input geometries must be in Angstrom. Output energies and forces are in
Let's try computing energies and forces for already-known geometries to see how it works. Goal: Read cartesian geometries from an input file and write the corresponding energies and forces to an outputfile Input and output file names should be specified in input.param file.
First and second line of input.param contains the input file and output file names, respectively.
Before running the code, compile it using the provided compile.sh script. The code is compatible with any Fortran compiler, and the default compiler used is gfortran. Ensure the PotFitParamsEG folder containing the fitted parameter files is in the working directory.
Run the compiled executable getfe.exe. The code will process the geometries, calculate energies and forces, and output the results to the output file. Each line in the output file will contain the energy followed by the forces for the corresponding geometry from the input file.
The input file contains the Cartesian coordinates of each geometry written in a single line.
The output energies will be in units of
Energy, Fx, Fy, Fz of atom 1, Fx, Fy, Fz of atom 2 ....
Feel free to reach out if you have any questions or need further assistance.