1#ifndef PSEUDO_ELEMENT_HPP
2#define PSEUDO_ELEMENT_HPP
32namespace pseudopotential {
38 typedef std::map<std::string, properties> map_type;
41 element(
const std::string &symbol =
"none") : symbol_(trim(symbol)) {
42 symbol_[0] = std::toupper(symbol_[0]);
43 for (
unsigned ii = 1; ii < symbol_.size(); ii++)
44 symbol_[ii] = std::tolower(symbol_[ii]);
49 element(
int atomic_number) {
52 if (atomic_number == 1) {
58 if (it->second.z_ == atomic_number) {
59 symbol_ = trim(it->first);
65 bool valid()
const {
return map().find(symbol_) != map().end(); }
67 double charge()
const {
return -1.0 * atomic_number(); }
69 const std::string &symbol()
const {
return symbol_; }
71 int atomic_number()
const {
return map().at(symbol_).z_; }
73 double mass()
const {
return map().at(symbol_).mass_; }
75 double vdw_radius()
const {
return map().at(symbol_).vdw_radius_; }
84 static map_type &map() {
89 std::string filename = pseudopotential::share_directory::get() +
90 "/pseudopotentials/elements.dat";
92 std::ifstream
file(filename.c_str());
95 std::cerr <<
"Internal error: cannot open file '" << filename <<
"'."
108 if (symbol[0] ==
'#') {
109 getline(
file, symbol);
115 file >> prop.z_ >> prop.mass_ >> prop.vdw_radius_;
129 str.erase(0, str.find_first_not_of(chars));
135 str.erase(str.find_last_not_of(chars) + 1);
142 return ltrim(rtrim(str, chars), chars);
if write to the Free Software Franklin Fifth USA !If the compiler accepts long Fortran it is better to use that and build all the preprocessor definitions in one line In !this the debuggers will provide the right line numbers !If the compiler accepts line number then CARDINAL and ACARDINAL !will put them just a new line or a ampersand plus a new line !These macros should be used in macros that span several lines They should by !put immedialty before a line where a compilation error might occur and at the !end of the macro !Note that the cardinal and newline words are substituted by the program !preprocess pl by the ampersand and by a real new line just before compilation !The assertions are ignored if the code is compiled in not debug when !prints out the assertion the file
if write to the Free Software Franklin Fifth USA !If the compiler accepts long Fortran it is better to use that and build all the preprocessor definitions in one line In !this the debuggers will provide the right line numbers !If the compiler accepts line number then CARDINAL and ACARDINAL !will put them just a new line or a ampersand plus a new line !These macros should be used in macros that span several lines They should by !put immedialty before a line where a compilation error might occur and at the !end of the macro !Note that the cardinal and newline words are substituted by the program !preprocess pl by the ampersand and by a real new line just before compilation !The assertions are ignored if the code is compiled in not debug when !prints out the assertion string
type(oct_iterator_t), save iterator
integer, parameter, public mass
integer, parameter, public charge