This software uses 3rd generation non-dominated search based genetic algorithm to train Stillinger-Weber forcefield for thermal conducitivity simulations. For details related to using the software please follow the instructions below
-
The primary NSGA-III routines (in
nsga3.c
) and code for managing the GA workflow (inga.c
) are provided in thesrc
folder. Thesrc
folder also contains theMakefile
, which compiles the binariesga
andmoga
atsrc/..
-
var.in
contains values of input parameters required by NSGA3-MOGA program -
hyperplane.in
is a user-provided list of reference points in n-dimensional space to guide the NSGA-III algorithm. A uniformly-spaced list of reference points can be generated using the MATLAB fileReferencePointGenerator.m
in theUTIL
folder -
The
UTIL
folder should include all user-provided ground truth values (i.e. phonon dispersion curves and lattice constants in case of forcefields for thermal conductivity). This folder should also include the user-provided template for the Stillinger Weber forcefield. Please refer to the provided examples in theExample
example folder for the format of these files -
The
Example
folder contains the complete set of input files for an example problem of SW forcefield optimization to reproduce phonon dispersions (band0.dat
,band1.dat
,band2.dat
) computed at three different lattice constants (cell1
,cell2
,cell3
). -
cleanup.sh
is an optional helper script which carries out cleanup operation before performing any GA runs.
.
├── Example
│ ├── UTIL
│ │ ├── band0.dat
│ │ ├── band1.dat
│ │ ├── band2.dat
│ │ ├── cell1
│ │ ├── cell2
│ │ └── cell3
│ ├── forcefield
│ ├── hyperplane.in
│ └── var.in
├── LICENSE
├── Media
│ ├── Picture1.png
│ ├── Picture2.png
│ └── Picture3.png
├── README.html
├── README.md
├── UTIL
│ ├── ReferencePointGenerator.m
│ ├── band0.dat
│ ├── band1.dat
│ ├── band2.dat
│ ├── cell1
│ ├── cell2
│ ├── cell3
│ └── forcefield
├── cleanup.sh
├── hyperplane.in
├── src
│ ├── Makefile
│ ├── moga.c
│ └── nsga3.c
└── var.in
- Put reference band structure data in UTIL folder as done in this repo.
- Put cell data corresponding to different states as cell1, cell2, cell3
- Put the template forcefield which you wish to train
- Go into src/ directory:
cd src/
- Modify the following lines in moga.c:
int iteration_num = 500; // number of training iterations
int population_num = 300; // population size for ga.in training
to the total number of epochs and total population size required for the training
For example: If the total number of epochs is 300 and population size is 200 then modify as follows:
int iteration_num = 300; // number of training iterations
int population_num = 200; // population size for ga.in training
Once these modifications are done compile the code by running Makefile
make
The structure of var.in is as follows:
300 # Size of the population (same as population_num in moga.c)
14 # Total number of variables in the force field file that need modification
5 # Total number of objectives
0.8 # Cross-Over Probability
0.2 # Mutation Probability
1.0 # Degree of Mutation between [0-1]
10 # Total number of divisions (will be read from hyperplane.in file, any value here will be ignored)
2.2 5.5 2.8 1.3 0.4 0.24 30.0 10.7 27.0 50.70 15.00 1.60 4.50 74.0 # Lower bound of variables
2.4 5.9 3.0 2.0 0.7 0.38 45.2 16.1 40.7 76.20 23.00 2.41 6.80 85.0 # Upper bound of variables
Please modify each line with suitable values consistent with the comments corresponding each line
This can be done by running this code within matlab environment by calling the function
GenerateReferencePoints(M,p)
M = Total number of Objectives
p = Total number of divisions
This step generates hyperplane.in with appropriate number of reference points
For running the worflow make sure to clean up the workspace first by running
sh cleanup.sh ${PopulationNumber}
Then run the following command for tuning the force field parameters:
mpirun -n ${PopulationNumber} ./moga | tee log
This step runs moga workflow on ${PopulationNumber}
parallel threads, each performing its own calculation independently and writes the output to log
The files for this calculation are provided in the Example folder and follow the strategy as mentioned in the paper
Figure: (a) error in lattice constant, (b) error in elastic modulus and (c) error in phonon dispersion curves