Skip to content

Commit

Permalink
Adapt TCutoff class
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinfriede committed Dec 12, 2022
1 parent a705cfd commit d208c88
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 51 deletions.
28 changes: 0 additions & 28 deletions include/dftd_cutoff.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,6 @@ class TCutoff {

explicit TCutoff();

/**
* @brief Set the cutoff for the two-body dispersion term.
*
* @param val New value for two-body dispersion cutoff.
*/
void set_disp2(double val);

/**
* @brief Set the cutoff for the three-body dispersion term.
*
* @param val New value for three-body dispersion cutoff.
*/
void set_disp3(double val);

/**
* @brief Set the cutoff for the DFT-D4 coordination number.
*
* @param val New value for DFT-D4 coordination number cutoff.
*/
void set_cn(double val);

/**
* @brief Set the cutoff for the EEQ coordination number.
*
* @param val New value for EEQ coordination number cutoff.
*/
void set_cn_eeq(double val);

/**
* @brief Set all cutoffs.
*
Expand Down
24 changes: 4 additions & 20 deletions src/dftd_cutoff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ TCutoff::TCutoff() {
};

void TCutoff::set_all(int new_cutoff) {
disp2 = (double)new_cutoff;
disp3 = (double)new_cutoff;
cn = (double)new_cutoff;
cn_eeq = (double)new_cutoff;
disp2 = static_cast<double>(new_cutoff);
disp3 = static_cast<double>(new_cutoff);
cn = static_cast<double>(new_cutoff);
cn_eeq = static_cast<double>(new_cutoff);
};
void TCutoff::set_all(double new_cutoff) {
disp2 = new_cutoff;
Expand All @@ -52,20 +52,4 @@ void TCutoff::set_all(double new_cutoff) {
cn_eeq = new_cutoff;
};

void TCutoff::set_disp2(double val) {
disp2 = val;
};

void TCutoff::set_disp3(double val) {
disp3 = val;
};

void TCutoff::set_cn(double val) {
cn = val;
};

void TCutoff::set_cn_eeq(double val) {
cn_eeq = val;
};

}; // namespace dftd
6 changes: 3 additions & 3 deletions test/test_param.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ int test_param() {
int info;
TCutoff cutoff;

cutoff.set_disp2(60.0);
cutoff.set_disp3(15.0);
cutoff.set_cn(30.0);
cutoff.disp2 = 60.0;
cutoff.disp3 = 15.0;
cutoff.cn = 30.0;
info = test_rational_damping(ref, cutoff);
if (!info == EXIT_SUCCESS) return info;

Expand Down

0 comments on commit d208c88

Please sign in to comment.