occ
Loading...
Searching...
No Matches
occ::core::Element Class Reference

Utility class representing and holding data for a chemical element. More...

#include <element.h>

Public Member Functions

 Element ()=delete
 
 Element (const std::string &string, bool exact_match=false)
 Construct an Element instance from its chemical symbol or name.
 
 Element (int num)
 Construct an Element instance from its atomic number.
 
const std::string & symbol () const
 The Element symbol e.g.
 
const std::string & name () const
 The Element name e.g.
 
float mass () const
 The average isotopic mass of this Element e.g.
 
float covalent_radius () const
 The covalent radius of this Element.
 
float van_der_waals_radius () const
 The van der Waals radius of this Element.
 
int atomic_number () const
 The atomic number this Element.
 
bool operator< (const Element &rhs) const
 Overload of the < operator.
 
bool operator> (const Element &rhs) const
 Overload of the > operator.
 
bool operator== (const Element &rhs) const
 Overload of the == operator.
 
bool operator!= (const Element &rhs) const
 Overload of the != operator.
 
double polarizability (bool charged=false) const
 The free-atom atom polarizibility of this Element.
 

Detailed Description

Utility class representing and holding data for a chemical element.

Element is a simple class with getter methods for typical useful values of common data convenient for common operations in computational chemistry.

Defined for the periodic table from H-Lr, using average isotopic data.

Constructor & Destructor Documentation

◆ Element() [1/3]

occ::core::Element::Element ( )
delete

◆ Element() [2/3]

occ::core::Element::Element ( const std::string &  string,
bool  exact_match = false 
)

Construct an Element instance from its chemical symbol or name.

Parameters
stringa string object representing the chemical symbol, element name, or label to identify the relevant Element.
exact_matchwhether to only find exact matches for the given string.

The string parameter is trimmed of whitespace, then capitalized prior to attempted matching so it should be case insensitive.

If exact_match is false, then things like labels e.g. H1, HA will be able to match (based on a partial match) with the relevant element. This behaviour may be undesirable, hence the optional parameter.

◆ Element() [3/3]

occ::core::Element::Element ( int  num)

Construct an Element instance from its atomic number.

Parameters
numthe atomic number of the element, should be in range [1,103]
Warning
Does not checking that the provided number is in the range [1,103] providing a number outside this range will likely segfault.

Member Function Documentation

◆ atomic_number()

int occ::core::Element::atomic_number ( ) const
inline

The atomic number this Element.

Returns
an int representing the atomic number.

◆ covalent_radius()

float occ::core::Element::covalent_radius ( ) const
inline

The covalent radius of this Element.

Returns
a float representing the covalent radius in Angstroms.

◆ mass()

float occ::core::Element::mass ( ) const
inline

The average isotopic mass of this Element e.g.

1.00794f, 4.00262f

Returns
a float representing the average isotopic mass in atomic mass units.

◆ name()

const std::string & occ::core::Element::name ( ) const
inline

The Element name e.g.

"hydrogen", "helium", "lithium"

Returns
string representation of the element name, lower case.

◆ operator!=()

bool occ::core::Element::operator!= ( const Element rhs) const
inline

Overload of the != operator.

This operator compares two elements by their atomic number to determine if they are equal

Parameters
rhsanother Element for comparison
Returns
True if this Element has a different atomic number to rhs

◆ operator<()

bool occ::core::Element::operator< ( const Element rhs) const
inline

Overload of the < operator.

This operator compares two elements by their atomic number

Parameters
rhsanother Element for comparison
Returns
True if this Element has an atomic number lower than rhs

◆ operator==()

bool occ::core::Element::operator== ( const Element rhs) const
inline

Overload of the == operator.

This operator compares two elements by their atomic number to determine if they are equal

Parameters
rhsanother Element for comparison
Returns
True if this Element has the same atomic number as rhs

◆ operator>()

bool occ::core::Element::operator> ( const Element rhs) const
inline

Overload of the > operator.

This operator compares two elements by their atomic number

Parameters
rhsanother Element for comparison
Returns
True if this Element has an atomic number greater than rhs

◆ polarizability()

double occ::core::Element::polarizability ( bool  charged = false) const

The free-atom atom polarizibility of this Element.

Data taken from Thakkar

Returns
a double representing the atomic polariziblity of an isolated atom of this element in its neutral (ground) state.

◆ symbol()

const std::string & occ::core::Element::symbol ( ) const
inline

The Element symbol e.g.

"H", "He", "Li"

Returns
string representation of the element symbol, capitalized.

◆ van_der_waals_radius()

float occ::core::Element::van_der_waals_radius ( ) const
inline

The van der Waals radius of this Element.

Returns
a float representing the van der Waals radius in Angstroms.

The documentation for this class was generated from the following file: