oILAB
Loading...
Searching...
No Matches
LandauWangTP.h
Go to the documentation of this file.
1//
2// Created by Nikhil Chandra Admal on 8/14/24.
3//
4
5#ifndef OILAB_LANDAUWANGTP_H
6#define OILAB_LANDAUWANGTP_H
8#include<vector>
9#include<Eigen/Eigen>
10#include <fstream>
11
12namespace gbLAB {
13
14// LandauWangTP is an EvolutionAlgorithm with an evolving transition probability
15// include a switch which indicates whether the transition probability is allowed to evolve
16 template<typename StateType, typename SystemType>
17 class LandauWangTP : public EvolutionAlgorithm<StateType, SystemType, LandauWangTP<StateType,SystemType>> {
18 private:
20 double f;
23 const std::tuple<double,double,int> energyLimits, densityLimits;
25 Eigen::MatrixXi histogram;
26 std::map<StateType, std::pair<double,double>> stateDensityEnergyMap;
27 std::ofstream spectrumFile;
28 std::string lmpLocation;
29 std::string potentialName;
30
31
32 bool histogramIsFlat(const double& c) const;
33
34 static std::tuple<int,int,bool> spectrumIndex(const double& energy,
35 const double& density,
36 const std::tuple<double,double,int>& energyLimits,
37 const std::tuple<double,double,int>& densityLimits);
38 static Eigen::Matrix<bool,Eigen::Dynamic,Eigen::Dynamic> getMask(const int& numberOfEnergyStates,
39 const int& numberOfDensityStates);
40 static std::map<StateType,std::pair<double,double>> getStateDensityEnergyMap();
41 static Eigen::MatrixXd getTheta(const Eigen::Matrix<bool,Eigen::Dynamic,Eigen::Dynamic>& mask, double& f);
42
43 public:
44 Eigen::Matrix<bool,Eigen::Dynamic,Eigen::Dynamic> mask;
45 Eigen::MatrixXd theta;
46
47
48 explicit LandauWangTP(const std::tuple<double,double,int>& energyLimits,
49 const std::string& lmpLocation,
50 const std::string& potentialName);
51
52 LandauWangTP(const std::tuple<double,double,int>& energyLimits,
53 const std::tuple<double,double,int>& densityLimits,
54 const std::string& lmpLocation,
55 const std::string& potentialName);
56
57 double probability(const std::pair<StateType,SystemType>& proposedState,
58 const std::pair<StateType,SystemType>& currentState);
59
60 void writeTheta(const std::string& filename) const;
61
62
63 };
64}
65
67#endif //OILAB_LANDAUWANGTP_H
std::pair< double, double > energy(const std::string &lammpsLocation, const std::string &oilabConfigFile, const std::string &potentialFile)
Definition Lammps.h:239
static Eigen::MatrixXd getTheta(const Eigen::Matrix< bool, Eigen::Dynamic, Eigen::Dynamic > &mask, double &f)
const int numberOfEnergyStates
Eigen::MatrixXi histogram
const int numberOfDensityStates
bool histogramIsFlat(const double &c) const
static std::tuple< int, int, bool > spectrumIndex(const double &energy, const double &density, const std::tuple< double, double, int > &energyLimits, const std::tuple< double, double, int > &densityLimits)
Eigen::MatrixXd theta
void writeTheta(const std::string &filename) const
double probability(const std::pair< StateType, SystemType > &proposedState, const std::pair< StateType, SystemType > &currentState)
const std::tuple< double, double, int > energyLimits
const std::tuple< double, double, int > densityLimits
static std::map< StateType, std::pair< double, double > > getStateDensityEnergyMap()
std::map< StateType, std::pair< double, double > > stateDensityEnergyMap
std::ofstream spectrumFile
Eigen::Matrix< bool, Eigen::Dynamic, Eigen::Dynamic > mask
static Eigen::Matrix< bool, Eigen::Dynamic, Eigen::Dynamic > getMask(const int &numberOfEnergyStates, const int &numberOfDensityStates)
std::string potentialName
std::string lmpLocation