Skip to content

Commit

Permalink
Make it possible to simulate arbitrary LJ binary mixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo-rovigatti committed Oct 25, 2024
1 parent f481eb4 commit b191c3d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Interactions/LJInteraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ LJInteraction::LJInteraction() :
_epsilon[0] = _epsilon[1] = _epsilon[2] = 1.;
_n[0] = _n[1] = _n[2] = 6;
_N_A = _N_B = 0;
_rcut = 2.5;
}

LJInteraction::~LJInteraction() {
Expand All @@ -32,15 +33,15 @@ void LJInteraction::get_settings(input_file &inp) {

getInputBool(&inp, "LJ_kob_andersen", &_is_ka_mixture, 0);

double sigma;
if(getInputDouble(&inp, "LJ_sigma[2]", &sigma, 0) == KEY_FOUND) {
_sigma[2] = sigma;
getInputNumber(&inp, "LJ_epsilon[0]", _epsilon, 0);
getInputNumber(&inp, "LJ_epsilon[1]", _epsilon + 1, 0);
getInputNumber(&inp, "LJ_epsilon[2]", _epsilon + 2, 0);

if(getInputNumber(&inp, "LJ_sigma[2]", _sigma + 2, 0) == KEY_FOUND) {
_sigma[1] = 0.5 * (1. + _sigma[2]);
}

float rcut = 2.5f;
getInputFloat(&inp, "LJ_rcut", &rcut, 0);
_rcut = (number) rcut;
getInputNumber(&inp, "LJ_rcut", &_rcut, 0);
}

void LJInteraction::init() {
Expand Down

0 comments on commit b191c3d

Please sign in to comment.