Skip to content

Commit 92ae576

Browse files
committed
change to static functions
1 parent c302eac commit 92ae576

File tree

4 files changed

+30
-30
lines changed

4 files changed

+30
-30
lines changed

source/module_hamilt_general/module_vdw/vdwd3_autoset_xcname.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ void _xcname_libxc(const std::string& xcpattern, std::string& xname)
382382
}
383383
}
384384

385-
std::string vdw::Vdwd3Parameters::dftd3_xc_name(const std::string& xcpattern) const
385+
std::string vdw::Vdwd3Parameters::_vdwd3_xcname(const std::string& xcpattern)
386386
{
387387
std::string xcname = xcpattern;
388388
const std::regex pattern("(LDA|GGA|MGGA|HYB|HYB_LDA|HYB_GGA|HYB_MGGA)_(X|C|XC|K)_(.*)");

source/module_hamilt_general/module_vdw/vdwd3_autoset_xcparam.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -473,17 +473,17 @@ std::string _uppercase(const std::string& s)
473473
* @param a1 [out] a1 parameter
474474
* @param a2 [out] a2 parameter
475475
*/
476-
void vdw::Vdwd3Parameters::dftd3_params(const std::string& xc_in,
477-
const std::string& d3method,
478-
const std::string& s6_in,
479-
const std::string& s8_in,
480-
const std::string& a1_in,
481-
const std::string& a2_in,
482-
double& s6,
483-
double& s8,
484-
double& a1,
485-
double& a2,
486-
std::ofstream* plog) const
476+
void vdw::Vdwd3Parameters::_vdwd3_autoset_xcparam(const std::string& xc_in,
477+
const std::string& d3method,
478+
const std::string& s6_in,
479+
const std::string& s8_in,
480+
const std::string& a1_in,
481+
const std::string& a2_in,
482+
double& s6,
483+
double& s8,
484+
double& a1,
485+
double& a2,
486+
std::ofstream* plog)
487487
{
488488
const std::map<std::string, std::string> param_map = {
489489
{"d3_bj", "bj"}, {"d3_0", "zero"}, {"d3_bjm", "bjm"}, {"d3_0m", "zerom"},
@@ -501,7 +501,7 @@ void vdw::Vdwd3Parameters::dftd3_params(const std::string& xc_in,
501501
else
502502
{
503503
std::vector<double> param;
504-
const std::string xc = dftd3_xc_name(xc_in);
504+
const std::string xc = _vdwd3_xcname(xc_in);
505505
_search(xc, param_map.at(d3method), param);
506506
s6 = (s6_in == "default") ? param[0] : std::stod(s6_in);
507507
s8 = (s8_in == "default") ? param[3] : std::stod(s8_in);

source/module_hamilt_general/module_vdw/vdwd3_parameters.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ void Vdwd3Parameters::initial_parameters(const Input_para &input, std::ofstream*
2323
5,
2424
std::vector<std::vector<double>>(max_elem_, std::vector<double>(max_elem_, 0.0)))));
2525

26-
dftd3_params(input.dft_functional, input.vdw_method,
27-
input.vdw_s6, input.vdw_s8, input.vdw_a1, input.vdw_a2,
28-
s6_, s18_, rs6_, rs18_, /* rs6: a1, rs18: a2 */
29-
plog);
26+
_vdwd3_autoset_xcparam(input.dft_functional, input.vdw_method,
27+
input.vdw_s6, input.vdw_s8, input.vdw_a1, input.vdw_a2,
28+
s6_, s18_, rs6_, rs18_, /* rs6: a1, rs18: a2 */
29+
plog);
3030
abc_ = input.vdw_abc;
3131
version_ = input.vdw_method;
3232
model_ = input.vdw_cutoff_type;

source/module_hamilt_general/module_vdw/vdwd3_parameters.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,19 @@ class Vdwd3Parameters : public VdwParameters
7474
std::vector<double> rcov_;
7575
std::vector<std::vector<double>> r0ab_;
7676

77-
void dftd3_params(const std::string& xc_in,
78-
const std::string& d3method,
79-
const std::string& s6_in,
80-
const std::string& s8_in,
81-
const std::string& a1_in,
82-
const std::string& a2_in,
83-
double& s6,
84-
double& s8,
85-
double& a1,
86-
double& a2,
87-
std::ofstream* plog = nullptr) const;
88-
89-
std::string dftd3_xc_name(const std::string& xcpattern) const;
77+
static void _vdwd3_autoset_xcparam(const std::string& xc_in,
78+
const std::string& d3method,
79+
const std::string& s6_in,
80+
const std::string& s8_in,
81+
const std::string& a1_in,
82+
const std::string& a2_in,
83+
double& s6,
84+
double& s8,
85+
double& a1,
86+
double& a2,
87+
std::ofstream* plog = nullptr);
88+
89+
static std::string _vdwd3_xcname(const std::string& xcpattern);
9090

9191
void init_C6();
9292
void init_r2r4();

0 commit comments

Comments
 (0)