OpenMD 3.0
Molecular Dynamics in the Open
|
Periodic Table of the Elements Using element data is a place holder when we lack information about a specific atom type. More...
#include <ElementsTable.hpp>
Public Member Functions | |
ElementsTable () | |
Constructor. | |
~ElementsTable () | |
Destructor. | |
void | Init () |
Read in the data file. | |
void | SetReadDirectory (char *dir) |
Set the directory before calling Init() | |
void | SetEnvironmentVariable (char *var) |
Set the environment variable to use before calling Init() | |
void | ParseLine (const char *line) |
Specified by particular table classes (parses an individual data line) | |
unsigned int | GetNumberOfElements () |
unsigned int | GetSize () |
int | GetAtomicNum (const char *str) |
int | GetAtomicNum (const char *str, int &iso) |
int | GetAtomicNum (std::string name, int &iso) |
const char * | GetSymbol (int atomicnum) |
RealType | GetVdwRad (int atomicnum) |
RealType | GetCovalentRad (int atomicnum) |
RealType | GetMass (int atomicnum) |
RealType | CorrectedBondRad (int atomicnum, int hyb=3) |
RealType | CorrectedVdwRad (int atomicnum, int hyb=3) |
int | GetMaxBonds (int atomicnum) |
RealType | GetElectroNeg (int atomicnum) |
RealType | GetAllredRochowElectroNeg (int atomicnum) |
RealType | GetIonization (int atomicnum) |
RealType | GetElectronAffinity (int atomicnum) |
std::vector< RealType > | GetRGB (int atomicnum) |
std::string | GetName (int atomicnum) |
Protected Attributes | |
bool | init_ |
whether the data been read already | |
std::string | filename_ |
file to search for | |
std::string | dir_ |
data directory for file if _envvar fails | |
std::string | subdir_ |
subdirectory (if using environment variable) | |
std::string | envvar_ |
environment variable to check first | |
std::vector< Element * > | elements_ |
const char * | dataptr_ |
default data table if file is unreadable | |
Periodic Table of the Elements Using element data is a place holder when we lack information about a specific atom type.
In particular, the Langevin algorithms must assume specific atomic radii to predict drag and random forces on those atoms. For force fields which do not specify Lennard-Jones radii, the element's van der Waals radius is used instead. The ElementsTable class (etab) is declared as external in ElementsTable.cpp. Source files that include the header file ElementsTable.hpp automatically have an extern definition to etab. The following code sample demonstrates the use of the ElementsTable class:
Stored information in the OBElementTable includes elemental:
Definition at line 72 of file ElementsTable.hpp.
OpenMD::ElementsTable::ElementsTable | ( | ) |
OpenMD::ElementsTable::~ElementsTable | ( | ) |
Destructor.
Definition at line 65 of file ElementsTable.cpp.
RealType OpenMD::ElementsTable::CorrectedBondRad | ( | int | atomicnum, |
int | hyb = 3 ) |
atomicnum | the atomic number of the element |
hyb | the hybridization of the element |
Definition at line 190 of file ElementsTable.cpp.
RealType OpenMD::ElementsTable::CorrectedVdwRad | ( | int | atomicnum, |
int | hyb = 3 ) |
atomicnum | the atomic number of the element |
hyb | the hybridization of the element |
Definition at line 207 of file ElementsTable.cpp.
RealType OpenMD::ElementsTable::GetAllredRochowElectroNeg | ( | int | atomicnum | ) |
atomicnum | the atomic number of the element |
Definition at line 125 of file ElementsTable.cpp.
References GetAllredRochowElectroNeg(), Init(), and init_.
Referenced by GetAllredRochowElectroNeg().
int OpenMD::ElementsTable::GetAtomicNum | ( | const char * | str | ) |
str | the element symbol |
Definition at line 242 of file ElementsTable.cpp.
References GetAtomicNum().
Referenced by GetAtomicNum(), and GetAtomicNum().
int OpenMD::ElementsTable::GetAtomicNum | ( | const char * | str, |
int & | iso ) |
str | the element symbol |
iso | the isotope index for Deuterium or Tritium |
Definition at line 247 of file ElementsTable.cpp.
int OpenMD::ElementsTable::GetAtomicNum | ( | std::string | name, |
int & | iso ) |
name | the element name |
iso | the isotope index for Deuterium or Tritium |
Definition at line 297 of file ElementsTable.cpp.
References GetAtomicNum().
RealType OpenMD::ElementsTable::GetCovalentRad | ( | int | atomicnum | ) |
atomicnum | the atomic number of the element |
Definition at line 224 of file ElementsTable.cpp.
References GetCovalentRad(), Init(), and init_.
Referenced by GetCovalentRad().
RealType OpenMD::ElementsTable::GetElectronAffinity | ( | int | atomicnum | ) |
atomicnum | the atomic number of the element |
Definition at line 143 of file ElementsTable.cpp.
References GetElectronAffinity(), Init(), and init_.
Referenced by GetElectronAffinity().
RealType OpenMD::ElementsTable::GetElectroNeg | ( | int | atomicnum | ) |
atomicnum | the atomic number of the element |
Definition at line 116 of file ElementsTable.cpp.
References GetElectroNeg(), Init(), and init_.
Referenced by GetElectroNeg().
RealType OpenMD::ElementsTable::GetIonization | ( | int | atomicnum | ) |
atomicnum | the atomic number of the element |
Definition at line 134 of file ElementsTable.cpp.
References GetIonization(), Init(), and init_.
Referenced by GetIonization().
RealType OpenMD::ElementsTable::GetMass | ( | int | atomicnum | ) |
int OpenMD::ElementsTable::GetMaxBonds | ( | int | atomicnum | ) |
atomicnum | the atomic number of the element |
Definition at line 107 of file ElementsTable.cpp.
References GetMaxBonds(), Init(), and init_.
Referenced by GetMaxBonds().
std::string OpenMD::ElementsTable::GetName | ( | int | atomicnum | ) |
unsigned int OpenMD::ElementsTable::GetNumberOfElements | ( | ) |
Definition at line 92 of file ElementsTable.cpp.
std::vector< RealType > OpenMD::ElementsTable::GetRGB | ( | int | atomicnum | ) |
atomicnum | the atomic number of the element |
Definition at line 152 of file ElementsTable.cpp.
|
inline |
Definition at line 100 of file ElementsTable.hpp.
const char * OpenMD::ElementsTable::GetSymbol | ( | int | atomicnum | ) |
atomicnum | the atomic number of the element |
Definition at line 98 of file ElementsTable.cpp.
References GetSymbol(), Init(), and init_.
Referenced by GetSymbol().
RealType OpenMD::ElementsTable::GetVdwRad | ( | int | atomicnum | ) |
atomicnum | the atomic number of the element |
Definition at line 181 of file ElementsTable.cpp.
References GetVdwRad(), Init(), and init_.
Referenced by GetVdwRad().
void OpenMD::ElementsTable::Init | ( | ) |
Read in the data file.
Definition at line 301 of file ElementsTable.cpp.
References OpenMD::ifstrstream::close(), envvar_, filename_, init_, OpenMD::ifstrstream::open(), ParseLine(), and subdir_.
Referenced by CorrectedBondRad(), CorrectedVdwRad(), GetAllredRochowElectroNeg(), GetAtomicNum(), GetCovalentRad(), GetElectronAffinity(), GetElectroNeg(), GetIonization(), GetMass(), GetMaxBonds(), GetName(), GetNumberOfElements(), GetRGB(), GetSymbol(), and GetVdwRad().
void OpenMD::ElementsTable::ParseLine | ( | const char * | line | ) |
Specified by particular table classes (parses an individual data line)
line | the data line to parse |
Definition at line 71 of file ElementsTable.cpp.
Referenced by Init().
|
inline |
Set the environment variable to use before calling Init()
Definition at line 90 of file ElementsTable.hpp.
References envvar_.
|
inline |
Set the directory before calling Init()
Definition at line 86 of file ElementsTable.hpp.
References dir_.
|
protected |
default data table if file is unreadable
Definition at line 200 of file ElementsTable.hpp.
|
protected |
data directory for file if _envvar fails
Definition at line 196 of file ElementsTable.hpp.
Referenced by ElementsTable(), and SetReadDirectory().
|
protected |
Definition at line 199 of file ElementsTable.hpp.
|
protected |
environment variable to check first
Definition at line 198 of file ElementsTable.hpp.
Referenced by ElementsTable(), Init(), and SetEnvironmentVariable().
|
protected |
file to search for
Definition at line 195 of file ElementsTable.hpp.
Referenced by ElementsTable(), and Init().
|
protected |
whether the data been read already
Definition at line 194 of file ElementsTable.hpp.
Referenced by CorrectedBondRad(), CorrectedVdwRad(), ElementsTable(), GetAllredRochowElectroNeg(), GetAtomicNum(), GetCovalentRad(), GetElectronAffinity(), GetElectroNeg(), GetIonization(), GetMass(), GetMaxBonds(), GetName(), GetNumberOfElements(), GetRGB(), GetSymbol(), GetVdwRad(), and Init().
|
protected |
subdirectory (if using environment variable)
Definition at line 197 of file ElementsTable.hpp.
Referenced by Init().