OpenMD 3.1
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 60 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 185 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 202 of file ElementsTable.cpp.
RealType OpenMD::ElementsTable::GetAllredRochowElectroNeg | ( | int | atomicnum | ) |
atomicnum | the atomic number of the element |
Definition at line 120 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 237 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 242 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 292 of file ElementsTable.cpp.
References GetAtomicNum().
RealType OpenMD::ElementsTable::GetCovalentRad | ( | int | atomicnum | ) |
atomicnum | the atomic number of the element |
Definition at line 219 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 138 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 111 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 129 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 102 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 87 of file ElementsTable.cpp.
std::vector< RealType > OpenMD::ElementsTable::GetRGB | ( | int | atomicnum | ) |
atomicnum | the atomic number of the element |
Definition at line 147 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 93 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 176 of file ElementsTable.cpp.
References GetVdwRad(), Init(), and init_.
Referenced by GetVdwRad().
void OpenMD::ElementsTable::Init | ( | ) |
Read in the data file.
Definition at line 296 of file ElementsTable.cpp.
References OpenMD::ifstrstream::close(), dir_, filename_, init_, OpenMD::ifstrstream::is_open(), OpenMD::ifstrstream::open(), and ParseLine().
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 66 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 Init(), 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 SetEnvironmentVariable().
|
protected |
|
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.