Skip to content

Commit 3aa479e

Browse files
committed
fix compilation error
1 parent 548c326 commit 3aa479e

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

source/module_hamilt_general/module_vdw/dftd3_xc_name.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#ifndef DFTD3_XC_NAME_H
2+
#define DFTD3_XC_NAME_H
13
/**
24
* This file stores the mapping from XC names in LibXC format
35
* to conventional names in DFTD3.
@@ -346,7 +348,7 @@ namespace DFTD3 {
346348
return xcname;
347349
}
348350
}
349-
351+
#endif // DFTD3_XCNAME_H_
350352
/**
351353
import os
352354
import re

source/module_hamilt_general/module_vdw/dftd3_xc_param.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
*
2626
* Please always look the warnning message to check the fall-back.
2727
*/
28-
28+
#ifndef DFTD3_XC_PARAM_H_
29+
#define DFTD3_XC_PARAM_H_
2930
#include <map>
3031
#include <string>
3132
#include <vector>
@@ -403,6 +404,13 @@ namespace DFTD3 {
403404
return result;
404405
}
405406

407+
std::string _uppercase(const std::string& s)
408+
{
409+
std::string result = s;
410+
std::transform(s.begin(), s.end(), result.begin(), ::toupper);
411+
return result;
412+
}
413+
406414
/**
407415
* @brief Get DFT-D3 parameters. If if there are parameters defined,
408416
* then it will overwrite the search result. If all parameters are
@@ -452,9 +460,10 @@ namespace DFTD3 {
452460
}
453461
else
454462
{
455-
std::cout << " VDW: DFTD3 parameters are not provided, search based on XC " << std::endl;
456463
std::vector<double> param;
457464
const std::string xc = DFTD3::_xcname(xc_in);
465+
std::cout << " VDW: DFTD3 parameters are not provided, search based on XC ("
466+
<< _uppercase(xc) << ")" << std::endl;
458467
_search(xc, param_map.at(d3method), param);
459468
s6 = param[0];
460469
s8 = param[3];
@@ -463,7 +472,7 @@ namespace DFTD3 {
463472
}
464473
}
465474
}
466-
475+
#endif // DFTD3_XC_PARAM_H
467476
/*
468477
'''
469478
dftd3 parameters from

0 commit comments

Comments
 (0)