occ
Loading...
Searching...
No Matches
occ::core Namespace Reference

fundamental functionality for linear algebra, utilities, molecules and more More...

Namespaces

namespace  charges
 
namespace  diis
 
namespace  graph
 
namespace  linalg
 
namespace  numpy
 
namespace  opt
 
namespace  rotor
 

Classes

struct  Atom
 Class representing and holding data for an Atom in 3D space. More...
 
class  Combinations
 Class to generate all possible combinations of a integers. More...
 
struct  ConditioningOrthogonalizerResult
 
class  Dimer
 Storage class for relevant information of a dimer (pair) of Molecule objects. More...
 
class  ElasticTensor
 Class for computation of properties based on an elasticity tensor. More...
 
class  Element
 Utility class representing and holding data for a chemical element. More...
 
class  EnergyComponents
 Storage class for components of energy, separated by the dot character. More...
 
class  Fraction
 Class representing and holding data a rational number i.e. More...
 
struct  GenSqrtInvResult
 
class  Interpolator1D
 Class for interpolating one-dimensional functions. More...
 
struct  KalmanEstimator
 
class  MolecularPointGroup
 Storage class for a point group describing a Molecule. More...
 
class  Molecule
 Storage class for relevant information of a Molecule. More...
 
struct  Multipole
 Templated storage class for Multipole expansions. More...
 
class  PointCharge
 
class  ProgressTracker
 
struct  SymOp
 Structure/utility class for a point group symmetry operation. More...
 
struct  TerminalSize
 

Typedefs

template<typename NumericType >
using KDTree = nanoflann::KDTreeEigenMatrixAdaptor< Eigen::Matrix< NumericType, 3, Eigen::Dynamic >, 3, nanoflann::metric_L2, false >
 

Enumerations

enum  DomainMapping { Linear , SquareRoot , Log }
 An enum to specify the mapping of the domain of inputs for interpolation. More...
 
enum class  PointGroup {
  C1 , Ci , Cs , C2 ,
  C3 , C4 , C5 , C6 ,
  C8 , Coov , Dooh , C2v ,
  C3v , C4v , C5v , C6v ,
  C2h , C3h , C4h , C5h ,
  C6h , D2 , D3 , D4 ,
  D5 , D6 , D7 , D8 ,
  D2h , D3h , D4h , D5h ,
  D6h , D7h , D8h , D2d ,
  D3d , D4d , D5d , D6d ,
  D7d , D8d , S4 , S6 ,
  S8 , T , Td , Th ,
  O , Oh , I , Ih
}
 
enum class  MirrorType { None , H , D , V }
 

Functions

bool operator== (const Atom &atom1, const Atom &atom2)
 returns true if two Atoms have the same element and are at the exact same point in space
 
template<typename AtomIterator >
void rotate_atoms (AtomIterator &atoms, const Mat3 &rotation)
 Rotate a range of atoms about the origin.
 
template<typename AtomIterator >
void translate_atoms (AtomIterator &atoms, const Vec3 &translation)
 translate a range of atoms
 
void set_bond_tolerance (float t)
 
double get_bond_tolerance ()
 
ConditioningOrthogonalizerResult conditioning_orthogonalizer (Eigen::Ref< const Mat >, double)
 
std::string chemical_formula (const std::vector< Element > &elements)
 The chemical formula of a given std::vector of Elements e.g.
 
GenSqrtInvResult gensqrtinv (Eigen::Ref< const Mat >, bool symmetric=false, double max_condition_number=1e8)
 
Mat3 inertia_tensor (Eigen::Ref< const Vec > masses, Eigen::Ref< const Mat3N > positions)
 
template<typename T >
OCC_ALWAYS_INLINE T lerp (T v0, T v1, T t)
 
std::pair< Mat, Matmeshgrid (const Vec &, const Vec &)
 
void label_molecules_by_chemical_formula (std::vector< occ::core::Molecule > &molecules)
 
constexpr unsigned int num_unique_multipole_components (int L)
 The number of unique multipole components for a given angular momentum.
 
constexpr unsigned int num_multipole_components_tensor (int L)
 The number of tensor multipole components for a given angular momentum.
 
constexpr unsigned int total_num_multipole_components (int L)
 The total number of unique multipole components up to and including a given angular momentum.
 
std::vector< PointChargemake_point_charges (const std::vector< Atom > &atoms)
 
constexpr unsigned int num_multipole_components (unsigned int order)
 
template<unsigned int order = 0>
auto compute_multipoles (const std::vector< PointCharge > &charges, const Vec3 &origin=Vec3::Zero())
 
PointGroup dihedral_group (int, MirrorType)
 
PointGroup cyclic_group (int, MirrorType)
 
Mat quasirandom_kgf (size_t ndims, size_t count, size_t seed=0)
 Generate an D dimensional Korobov type quasi-random vector based on the generalized Fibonacci sequence.
 
void to_json (nlohmann::json &j, const Molecule &)
 
void from_json (const nlohmann::json &j, Molecule &)
 

Variables

double covalent_bond_tolerance = 0.4
 
constexpr size_t max_leaf = 10
 
constexpr std::array< const char *, 35 > multipole_component_names
 The names of multipole components in order.
 

Detailed Description

fundamental functionality for linear algebra, utilities, molecules and more

No dependencies on other modules in occ

Typedef Documentation

◆ KDTree

template<typename NumericType >
using occ::core::KDTree = typedef nanoflann::KDTreeEigenMatrixAdaptor< Eigen::Matrix<NumericType, 3, Eigen::Dynamic>, 3, nanoflann::metric_L2, false>

Enumeration Type Documentation

◆ DomainMapping

An enum to specify the mapping of the domain of inputs for interpolation.

Can help improve precision of linear interpolation while minimizing number of points.

Enumerator
Linear 

The typical f(x) mapping.

SquareRoot 

Make f a function of x^2 -> f(x*x) mapping.

Log 

Make f a function of e^x -> f(e^x) mapping.

◆ MirrorType

enum class occ::core::MirrorType
strong
Enumerator
None 

◆ PointGroup

enum class occ::core::PointGroup
strong
Enumerator
C1 

No rotational symmetry.

Ci 

Ci = S2 No rotational symmetry, but with inversion.

Cs 

Cs = C1h No rotational symmetry, but a mirror plane.

C2 

open book geometry, two-fold rotational symmetry

C3 

propeller, three-fold rotational symmetry

C4 

four-fold rotational symmetry

C5 

five-fold rotational symmetry

C6 

six-fold rotational symmetry

C8 

eight-fold rotational symmetry

Coov 

Linear, infinite rotational symmetry.

Dooh 

Linear, with an inversion center.

C2v 

angular, see-saw, T-shape, two-fold rotational symmetry with mirror plane parallel to axis of rotation

C3v 

trigonal pyramidal, three-fold rotational symmetry with mirror plane parallel to axis of rotation

C4v 

square pyramidal, four-fold rotational symmetry with mirror plane parallel to axis of rotation

C5v 

milking stool, five-fold rotational symmetry with mirror plane parallel to axis of rotation

C6v 

six-fold rotational symmetry with mirror plane parallel to axis of rotation

C2h 

two-fold rotational symmetry with mirror plane orthogonal to axis of rotation

C3h 

three-fold rotational symmetry with mirror plane orthogonal to axis of rotation

C4h 

four-fold rotational symmetry with mirror plane orthogonal to axis of rotation

C5h 

five-fold rotational symmetry with mirror plane orthogonal to axis of rotation

C6h 

six-fold rotational symmetry with mirror plane orthogonal to axis of rotation

D2 

twist, two-fold rotational symmetry with an inversion

D3 

three-fold rotational symmetry with an inversion

D4 

four-fold rotational symmetry with an inversion

D5 

five-fold rotational symmetry with an inversion

D6 

six-fold rotational symmetry with an inversion

D7 

seven-fold rotational symmetry with an inversion

D8 

eight-fold rotational symmetry with an inversion

D2h 

planar + inversion center, two-fold rotational symmetry with an and mirror plane orthogonal to axis of rotation

D3h 

trigonal planar, trigonal bipyramidal, three-fold rotational symmetry with an inversion and mirror plane orthogonal to axis of rotation

D4h 

square planar, four-fold rotational symmetry with an inversion and mirror plane orthogonal to axis of rotation

D5h 

pentagonal

D6h 

hexagonal

D7h 

heptagonal

D8h 

octagonal

D2d 

90 degree twist

D3d 

60 degree twist

D4d 

45 degree twist

D5d 

36 degree twist

D6d 

30 degree twist

D7d 
D8d 
S4 
S6 
S8 
Td 

tetrahedral

Th 

pyritohedron

Oh 

octahedral, cubic

Ih 

icosahedral, dodecahedral

Function Documentation

◆ chemical_formula()

std::string occ::core::chemical_formula ( const std::vector< Element > &  elements)

The chemical formula of a given std::vector of Elements e.g.

"H2O"

The result is in plain ASCII characters (i.e. no subscripts) and elements with a count of 1 the number suffix is omitted. i.e. H2O not H2O1

Parameters
elementsa std::vector of Elements used to calculate the chemical formula
Returns
a string representing the chemical formula

◆ compute_multipoles()

template<unsigned int order = 0>
auto occ::core::compute_multipoles ( const std::vector< PointCharge > &  charges,
const Vec3 origin = Vec3::Zero() 
)
inline

◆ conditioning_orthogonalizer()

ConditioningOrthogonalizerResult occ::core::conditioning_orthogonalizer ( Eigen::Ref< const Mat ,
double   
)

◆ cyclic_group()

PointGroup occ::core::cyclic_group ( int  ,
MirrorType   
)

◆ dihedral_group()

PointGroup occ::core::dihedral_group ( int  ,
MirrorType   
)

◆ from_json()

void occ::core::from_json ( const nlohmann::json &  j,
Molecule  
)

◆ gensqrtinv()

GenSqrtInvResult occ::core::gensqrtinv ( Eigen::Ref< const Mat ,
bool  symmetric = false,
double  max_condition_number = 1e8 
)

◆ get_bond_tolerance()

double occ::core::get_bond_tolerance ( )
inline

◆ inertia_tensor()

Mat3 occ::core::inertia_tensor ( Eigen::Ref< const Vec >  masses,
Eigen::Ref< const Mat3N >  positions 
)

◆ label_molecules_by_chemical_formula()

void occ::core::label_molecules_by_chemical_formula ( std::vector< occ::core::Molecule > &  molecules)

◆ lerp()

template<typename T >
OCC_ALWAYS_INLINE T occ::core::lerp ( T  v0,
T  v1,
T  t 
)

◆ make_point_charges()

std::vector< PointCharge > occ::core::make_point_charges ( const std::vector< Atom > &  atoms)
inline

◆ meshgrid()

std::pair< Mat, Mat > occ::core::meshgrid ( const Vec &  ,
const Vec &   
)

◆ num_multipole_components()

constexpr unsigned int occ::core::num_multipole_components ( unsigned int  order)
constexpr

◆ num_multipole_components_tensor()

constexpr unsigned int occ::core::num_multipole_components_tensor ( int  L)
inlineconstexpr

The number of tensor multipole components for a given angular momentum.

Parameters
Lthe angular momentum.
Returns
an unsigned int with the count of the number of components.

◆ num_unique_multipole_components()

constexpr unsigned int occ::core::num_unique_multipole_components ( int  L)
inlineconstexpr

The number of unique multipole components for a given angular momentum.

Parameters
Lthe angular momentum.
Returns
an unsigned int with the count of the number of components.

◆ operator==()

bool occ::core::operator== ( const Atom atom1,
const Atom atom2 
)
inline

returns true if two Atoms have the same element and are at the exact same point in space

◆ quasirandom_kgf()

Mat occ::core::quasirandom_kgf ( size_t  ndims,
size_t  count,
size_t  seed = 0 
)

Generate an D dimensional Korobov type quasi-random vector based on the generalized Fibonacci sequence.

Based on the R_1, R_2 sequences available here: https://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences/

Parameters:

Parameters
ndimsnumber of dimensions to sample
countthe number of points in space to generate
seedthe seed (offset) into the sequence, default = 0
Returns
a ndims dimensional sampling point

◆ rotate_atoms()

template<typename AtomIterator >
void occ::core::rotate_atoms ( AtomIterator &  atoms,
const Mat3 rotation 
)
inline

Rotate a range of atoms about the origin.

◆ set_bond_tolerance()

void occ::core::set_bond_tolerance ( float  t)
inline

◆ to_json()

void occ::core::to_json ( nlohmann::json &  j,
const Molecule  
)

◆ total_num_multipole_components()

constexpr unsigned int occ::core::total_num_multipole_components ( int  L)
inlineconstexpr

The total number of unique multipole components up to and including a given angular momentum.

Parameters
Lthe angular momentum.
Returns
an unsigned int with the count of the number of components.

◆ translate_atoms()

template<typename AtomIterator >
void occ::core::translate_atoms ( AtomIterator &  atoms,
const Vec3 translation 
)
inline

translate a range of atoms

Variable Documentation

◆ covalent_bond_tolerance

double occ::core::covalent_bond_tolerance = 0.4
inline

◆ max_leaf

constexpr size_t occ::core::max_leaf = 10
constexpr

◆ multipole_component_names

constexpr std::array<const char *, 35> occ::core::multipole_component_names
inlineconstexpr
Initial value:
{
"q", "Dx", "Dy", "Dz", "Qxx", "Qxy", "Qxz",
"Qyy", "Qyz", "Qzz", "Oxxx", "Oxxy", "Oxxz", "Oxyy",
"Oxyz", "Oxzz", "Oyyy", "Oyyz", "Oyzz", "Ozzz", "Hxxxx",
"Hxxxy", "Hxxxz", "Hxxyy", "Hxxyz", "Hxxzz", "Hxyyy", "Hxyyz",
"Hxyzz", "Hxzzz", "Hyyyy", "Hyyyz", "Hyyzz", "Hyzzz", "Hzzzz"}

The names of multipole components in order.