Loading...
Searching...
No Matches
gpr::geometry Namespace Reference

Classes

class  AffineCoordinateChart
class  CoordinateChart
struct  CutoffPair
class  ElementPairContactFloor
class  InternalCoordinateChart
class  InternalCoordinateRetractionFailed
class  InternalCoordinateSet
class  PairBox
struct  PrimitiveInternal
struct  ReactiveAtomTypes
class  UndefinedInternalCoordinate

Enumerations

enum class  RetractionStatus { Retracted , AngleDomain , Failed }
enum class  PrimitiveKind { Bond , Angle , Dihedral , LinearBend }
enum class  BondGraphKind { Gabriel , RelativeNeighborhood }

Functions

std::vector< CutoffPair > cutoffNeighbors (const double *positions, std::size_t count, const std::array< double, 9 > &cell, const std::array< bool, 3 > &periodic, double cutoff)
bool angleIsCollinear (double sin2)
std::vector< PrimitiveInternal > resolveCollinearAngles (const std::vector< PrimitiveInternal > &primitives, const Eigen::VectorXd &positions, const std::array< double, 9 > &cell)
std::vector< PrimitiveInternal > primitiveTopologyFromBondGraph (int n_atoms, const std::vector< std::pair< int, int > > &bonds)
std::vector< PrimitiveInternal > resolveCollinearAngles (const std::vector< PrimitiveInternal > &primitives, const std::vector< Eigen::VectorXd > &geometries, const std::array< double, 9 > &cell)
std::vector< std::pair< int, int > > gabrielBondGraph (int n_atoms, const Eigen::VectorXd &positions, const std::vector< char > &moving_atoms, const std::array< double, 9 > &cell)
std::vector< std::pair< int, int > > relativeNeighborhoodBondGraph (int n_atoms, const Eigen::VectorXd &positions, const std::vector< char > &moving_atoms, const std::array< double, 9 > &cell)
std::vector< std::pair< int, int > > bondGraph (int n_atoms, const Eigen::VectorXd &positions, const std::vector< char > &moving_atoms, BondGraphKind kind, const std::array< double, 9 > &cell)
std::vector< std::pair< int, int > > unionBondGraph (int n_atoms, const std::vector< Eigen::VectorXd > &geometries, const std::vector< char > &moving_atoms, BondGraphKind kind, const std::array< double, 9 > &cell)
std::vector< PrimitiveInternal > primitiveTopologyFromGeometry (int n_atoms, const Eigen::VectorXd &positions, const std::vector< char > &moving_atoms, BondGraphKind kind, const std::array< double, 9 > &cell)
int countBonds (const std::vector< PrimitiveInternal > &primitives)
int countAngles (const std::vector< PrimitiveInternal > &primitives)
int countDihedrals (const std::vector< PrimitiveInternal > &primitives)
Eigen::VectorXd sellaInternalTrust (const InternalCoordinateSet &coordinates)
Eigen::VectorXd scaleCartesianStepToInternalTrust (const InternalCoordinateSet &coordinates, const Eigen::VectorXd &positions, const Eigen::VectorXd &cartesian_step, const Eigen::VectorXd &internal_trust_per_primitive)
Eigen::VectorXd retractRestrictedStep (const InternalCoordinateSet &coordinates, const Eigen::VectorXd &positions, const Eigen::VectorXd &cartesian_step, const Eigen::VectorXd &internal_trust_per_primitive)
Eigen::MatrixXd constraintFreeBasis (const Eigen::MatrixXd &constraint_jacobian)
bool cellIsZero (const double cell[9]) noexcept
 Isolated molecule: every entry of the ASE-style 3x3 cell is zero.
bool cellIsZero (const std::array< double, 9 > &cell) noexcept
bool cellIsVacuumBox (const double cell[9]) noexcept
bool cellIsVacuumBox (const std::array< double, 9 > &cell) noexcept
bool cellIsMicLattice (const double cell[9]) noexcept
 Nonzero ASE 3x3 that is not the 25 A vacuum convention.
bool cellIsMicLattice (const std::array< double, 9 > &cell) noexcept
bool copyMicLattice (double dest[9], const double src[9]) noexcept
 Copy src onto dest only when src is a MIC lattice.
std::array< double, 9 > micLattice (const double cell[9]) noexcept
std::array< double, 9 > micLattice (const std::array< double, 9 > &cell) noexcept
std::array< bool, 3 > cellPeriodicAxes (const double cell[9]) noexcept
double uniqueImageRadius (const double cell[9]) noexcept
double uniqueImageRadius (const std::array< double, 9 > &cell) noexcept
void zeroOpenAxes (double cell[9], const std::array< bool, 3 > &periodic) noexcept
Eigen::VectorXd flatMinimumImageDisplacement (const PairBox *box, const Eigen::VectorXd &from, const Eigen::VectorXd &to)
double minimumPairDistance (const Eigen::VectorXd &positions, const std::array< double, 9 > &cell, Eigen::Index moving_count=-1)
double minimumContactDistance (const Eigen::VectorXd &positions, const std::array< double, 9 > &cell, double cutoff, Eigen::Index moving_count=-1)
template<class Distance>
Eigen::VectorXd limitPairDistanceStep (const Eigen::VectorXd &positions, const Eigen::VectorXd &proposed, double floor, Distance &&distance)
double covalentRadius (int atomic_number)
std::vector< std::pair< int, int > > covalentBondGraph (const Eigen::VectorXd &positions, const std::vector< int > &atomic_numbers, const std::array< double, 9 > &cell)
ReactiveAtomTypes assignReactiveAtomTypes (const Eigen::VectorXd &reactant, const Eigen::VectorXd &product, const std::vector< int > &atomic_numbers, const std::vector< Index_t > &types, const std::unordered_map< std::string, Index_t > &atomtypes, const std::array< double, 9 > &cell)

Variables

constexpr std::array< double, 97 > kCorderoRadiusPm

Enumeration Type Documentation

◆ BondGraphKind

enum class gpr::geometry::BondGraphKind
strong
Enumerator
Gabriel 
RelativeNeighborhood 

Definition at line 98 of file InternalCoordinates.h.

◆ PrimitiveKind

enum class gpr::geometry::PrimitiveKind
strong
Enumerator
Bond 
Angle 
Dihedral 
LinearBend 

Linear bend n . (u_hat + v_hat) for a collinear triple a-b-c with u = a - b, v = c - b and a fixed unit reference n orthogonal to the axis. The valence angle has a cone singularity at collinearity; the two linear bends with orthogonal references are the smooth chart of the same bending manifold.

Definition at line 51 of file InternalCoordinates.h.

◆ RetractionStatus

Enumerator
Retracted 

An accepted Gauss-Newton step whose residual improved, a constraint residual already within tolerance, or least-squares stationarity of a usable Jacobian. A step that is only below coordinate roundoff is not a retraction.

AngleDomain 

A valence-angle target lies outside [0, pi]. The Cartesian trial is retained and the residual is infinite: the target has no inverse.

Failed 

No internal-coordinate step was produced. An undefined primitive gradient, including a valence angle on its collinear cone, is a failure rather than a retracted geometry.

Definition at line 36 of file InternalCoordinates.h.

Function Documentation

◆ angleIsCollinear()

bool gpr::geometry::angleIsCollinear ( double sin2)
nodiscard

Treat a bending plane as unresolved when sin^2(theta) <= machine epsilon, consistent with the 1/sqrt(epsilon) conditioning limit for chart inverses.

Definition at line 483 of file InternalCoordinates.cpp.

484{
485 // The normalized bending-plane normal carries 1/sin(theta): the plane
486 // is a usable chart direction only while that amplification stays inside
487 // the conditioning bound the chart itself applies to its B-matrix,
488 // kappa_max = 1/sqrt(eps) (the singular-value cutoff of the chart SVD).
489 // 1/sin(theta) <= 1/sqrt(eps) <=> sin^2(theta) >= eps. Below that the
490 // angle is treated as collinear and its smooth replacement (the linear
491 // bend pair) or the limit gradient takes over.
492 constexpr double eps = std::numeric_limits<double>::epsilon();
493 return !(sin2 > eps);
494}

◆ assignReactiveAtomTypes()

ReactiveAtomTypes gpr::geometry::assignReactiveAtomTypes ( const Eigen::VectorXd & reactant,
const Eigen::VectorXd & product,
const std::vector< int > & atomic_numbers,
const std::vector< Index_t > & types,
const std::unordered_map< std::string, Index_t > & atomtypes,
const std::array< double, 9 > & cell = {} )
nodiscard

Split each element's atom type into a spectator and a reactive type.

The Sexpat kernel fits one length scale per pair of atom types, so with types by element alone the transferring hydrogen shares its C-H length scale with every spectator C-H bond, whose inverse distance barely moves along the path; the fit lands between the two and the misfit surfaces as learned noise far above the oracle's own spread. An atom is reactive when its covalent bond set differs between reactant and product; every such atom of element Z receives the type "Z<Z>*", so the reactive pairs are fitted on their own. Requires matching atom counts and elements.

Definition at line 52 of file ReactiveAtomTypes.cpp.

57{
58 const int n = static_cast<int>(atomic_numbers.size());
59 if (types.size() != atomic_numbers.size() ||
60 reactant.size() != 3 * static_cast<Eigen::Index>(n) ||
61 product.size() != reactant.size()) {
62 throw std::invalid_argument(
63 "reactive atom types: reactant, product and types must describe "
64 "the same atoms");
65 }
66 ReactiveAtomTypes out;
67 out.types = types;
68 out.atomtypes = atomtypes;
69 std::vector<std::set<int>> react_nb(static_cast<std::size_t>(n)),
70 prod_nb(static_cast<std::size_t>(n));
71 for (const auto& [a, b]:
72 covalentBondGraph(reactant, atomic_numbers, cell)) {
73 react_nb[static_cast<std::size_t>(a)].insert(b);
74 react_nb[static_cast<std::size_t>(b)].insert(a);
75 }
76 for (const auto& [a, b]: covalentBondGraph(product, atomic_numbers, cell)) {
77 prod_nb[static_cast<std::size_t>(a)].insert(b);
78 prod_nb[static_cast<std::size_t>(b)].insert(a);
79 }
80 for (int a = 0; a < n; ++a) {
81 if (react_nb[static_cast<std::size_t>(a)] ==
82 prod_nb[static_cast<std::size_t>(a)])
83 continue;
84 out.reactive_atoms.push_back(a);
85 const std::string name =
86 "Z" + std::to_string(atomic_numbers[static_cast<std::size_t>(a)]) +
87 "*";
88 auto it = out.atomtypes.find(name);
89 if (it == out.atomtypes.end()) {
90 Index_t next = 0;
91 for (const auto& kv: out.atomtypes)
92 next = std::max<Index_t>(next, kv.second + 1);
93 it = out.atomtypes.emplace(name, next).first;
94 }
95 out.types[static_cast<std::size_t>(a)] = it->second;
96 }
97 return out;
98}
eon_relax_band_t eon_relax_surface_fn void eon_relax_outcome_t * out
std::vector< std::pair< int, int > > covalentBondGraph(const Eigen::VectorXd &positions, const std::vector< int > &atomic_numbers, const std::array< double, 9 > &cell)
uint32_t Index_t
Definition Macros.h:17

◆ bondGraph()

std::vector< std::pair< int, int > > gpr::geometry::bondGraph ( int n_atoms,
const Eigen::VectorXd & positions,
const std::vector< char > & moving_atoms = {},
BondGraphKind kind = BondGraphKind::Gabriel,
const std::array< double, 9 > & cell = {} )
nodiscard

All distances, the Gabriel diametric ball and the lune test use the minimum-image convention of ~cell~ (minimage); an all-zero cell is vacuum.

Definition at line 808 of file InternalCoordinates.cpp.

812{
813 return pairwiseBondGraph(n_atoms, positions, moving_atoms, cell, kind);
814}

◆ cellIsMicLattice() [1/2]

bool gpr::geometry::cellIsMicLattice ( const double cell[9])
inlinenodiscardnoexcept

Nonzero ASE 3x3 that is not the 25 A vacuum convention.

Definition at line 56 of file MinImage.h.

57{
58 return !cellIsZero(cell) && !cellIsVacuumBox(cell);
59}
bool cellIsVacuumBox(const double cell[9]) noexcept
Definition MinImage.h:39
bool cellIsZero(const double cell[9]) noexcept
Isolated molecule: every entry of the ASE-style 3x3 cell is zero.
Definition MinImage.h:22

◆ cellIsMicLattice() [2/2]

bool gpr::geometry::cellIsMicLattice ( const std::array< double, 9 > & cell)
inlinenodiscardnoexcept

Definition at line 61 of file MinImage.h.

63{
64 return cellIsMicLattice(cell.data());
65}
bool cellIsMicLattice(const double cell[9]) noexcept
Nonzero ASE 3x3 that is not the 25 A vacuum convention.
Definition MinImage.h:56

◆ cellIsVacuumBox() [1/2]

bool gpr::geometry::cellIsVacuumBox ( const double cell[9])
inlinenodiscardnoexcept

Baker / Hermes 25 A cubic vacuum box. Oracle and CON convention (omitted-cell fallback, Baker endpoints), not a periodic lattice. Off-diagonal entries may be cos(90 deg) leftovers from expanding CON lengths and angles.

Definition at line 39 of file MinImage.h.

40{
41 constexpr double L = 25.0;
42 constexpr double tol = 1.0e-12;
43 if (cell[0] != L || cell[4] != L || cell[8] != L) return false;
44 return std::abs(cell[1]) <= tol && std::abs(cell[2]) <= tol &&
45 std::abs(cell[3]) <= tol && std::abs(cell[5]) <= tol &&
46 std::abs(cell[6]) <= tol && std::abs(cell[7]) <= tol;
47}

◆ cellIsVacuumBox() [2/2]

bool gpr::geometry::cellIsVacuumBox ( const std::array< double, 9 > & cell)
inlinenodiscardnoexcept

Definition at line 49 of file MinImage.h.

51{
52 return cellIsVacuumBox(cell.data());
53}

◆ cellIsZero() [1/2]

bool gpr::geometry::cellIsZero ( const double cell[9])
inlinenodiscardnoexcept

Isolated molecule: every entry of the ASE-style 3x3 cell is zero.

Definition at line 22 of file MinImage.h.

23{
24 for (int i = 0; i < 9; ++i) {
25 if (cell[i] != 0.0) return false;
26 }
27 return true;
28}

◆ cellIsZero() [2/2]

bool gpr::geometry::cellIsZero ( const std::array< double, 9 > & cell)
inlinenodiscardnoexcept

Definition at line 30 of file MinImage.h.

31{
32 return cellIsZero(cell.data());
33}

◆ cellPeriodicAxes()

std::array< bool, 3 > gpr::geometry::cellPeriodicAxes ( const double cell[9])
inlinenodiscardnoexcept

Axes of an ASE row-major cell that are periodic: the rows that are not zero. A periodic lattice has no zero row, so a zero row marks an open axis: a slab periodic in x and y carries a zero third row.

Definition at line 93 of file MinImage.h.

95{
96 std::array<bool, 3> periodic{};
97 for (int row = 0; row < 3; ++row)
98 periodic[row] = cell[3 * row] != 0.0 || cell[3 * row + 1] != 0.0 ||
99 cell[3 * row + 2] != 0.0;
100 return periodic;
101}

◆ constraintFreeBasis()

Eigen::MatrixXd gpr::geometry::constraintFreeBasis ( const Eigen::MatrixXd & constraint_jacobian)
nodiscard

Definition at line 2046 of file InternalCoordinates.cpp.

2047{
2048 if (constraint_jacobian.cols() == 0) return Eigen::MatrixXd();
2049 if (constraint_jacobian.rows() == 0) {
2050 return Eigen::MatrixXd::Identity(constraint_jacobian.cols(),
2051 constraint_jacobian.cols());
2052 }
2053 Eigen::JacobiSVD<Eigen::MatrixXd> svd(constraint_jacobian,
2054 Eigen::ComputeFullV);
2055 const Eigen::VectorXd singular = svd.singularValues();
2056 int rank = 0;
2057 if (singular.size() > 0) {
2058 const double sigma_max = singular.cwiseAbs().maxCoeff();
2059 const double cutoff =
2060 std::numeric_limits<double>::epsilon() *
2061 static_cast<double>(std::max(constraint_jacobian.rows(),
2062 constraint_jacobian.cols())) *
2063 sigma_max;
2064 for (Eigen::Index i = 0; i < singular.size(); ++i) {
2065 if (singular(i) > cutoff) ++rank;
2066 }
2067 }
2068 return svd.matrixV().rightCols(
2069 static_cast<Eigen::Index>(constraint_jacobian.cols() - rank));
2070}

◆ copyMicLattice()

bool gpr::geometry::copyMicLattice ( double dest[9],
const double src[9] )
inlinenoexcept

Copy src onto dest only when src is a MIC lattice.

Definition at line 68 of file MinImage.h.

69{
70 if (!cellIsMicLattice(src)) return false;
71 for (int i = 0; i < 9; ++i)
72 dest[i] = src[i];
73 return true;
74}

◆ countAngles()

int gpr::geometry::countAngles ( const std::vector< PrimitiveInternal > & primitives)
nodiscard

Definition at line 849 of file InternalCoordinates.cpp.

850{
851 return static_cast<int>(std::count_if(
852 primitives.begin(), primitives.end(), [](const PrimitiveInternal& p) {
853 return p.kind == PrimitiveKind::Angle;
854 }));
855}

◆ countBonds()

int gpr::geometry::countBonds ( const std::vector< PrimitiveInternal > & primitives)
nodiscard

Definition at line 841 of file InternalCoordinates.cpp.

842{
843 return static_cast<int>(std::count_if(
844 primitives.begin(), primitives.end(), [](const PrimitiveInternal& p) {
845 return p.kind == PrimitiveKind::Bond;
846 }));
847}

◆ countDihedrals()

int gpr::geometry::countDihedrals ( const std::vector< PrimitiveInternal > & primitives)
nodiscard

Definition at line 857 of file InternalCoordinates.cpp.

858{
859 return static_cast<int>(std::count_if(
860 primitives.begin(), primitives.end(), [](const PrimitiveInternal& p) {
861 return p.kind == PrimitiveKind::Dihedral;
862 }));
863}

◆ covalentBondGraph()

std::vector< std::pair< int, int > > gpr::geometry::covalentBondGraph ( const Eigen::VectorXd & positions,
const std::vector< int > & atomic_numbers,
const std::array< double, 9 > & cell = {} )
nodiscard

Chemical bond graph: pair (a, b) is bonded when its minimum-image distance is below 1.25 (R_a + R_b) with R the covalent radii, the conventional bond-perception tolerance. An all-zero cell is vacuum.

Definition at line 26 of file ReactiveAtomTypes.cpp.

29{
30 const int n = static_cast<int>(atomic_numbers.size());
31 if (positions.size() != 3 * static_cast<Eigen::Index>(n)) {
32 throw std::invalid_argument(
33 "covalent bond graph: positions do not match the atom count");
34 }
35 const PairBox box(cell);
36 std::vector<std::pair<int, int>> bonds;
37 for (int a = 0; a < n; ++a) {
38 const double ra =
39 covalentRadius(atomic_numbers[static_cast<std::size_t>(a)]);
40 const Eigen::Vector3d xa = positions.segment<3>(3 * a);
41 for (int b = a + 1; b < n; ++b) {
42 const double rb =
43 covalentRadius(atomic_numbers[static_cast<std::size_t>(b)]);
44 const Eigen::Vector3d xb = positions.segment<3>(3 * b);
45 const double r = box.displacement(xa, xb).norm();
46 if (r < 1.25 * (ra + rb)) bonds.emplace_back(a, b);
47 }
48 }
49 return bonds;
50}
double covalentRadius(int atomic_number)

◆ covalentRadius()

double gpr::geometry::covalentRadius ( int atomic_number)
nodiscard

Covalent radius in Å (Cordero et al., Dalton Trans. 2008, 2832; the low-spin values for Mn, Fe and Co, sp3 carbon). Throws for an atomic number outside the table.

Definition at line 15 of file ReactiveAtomTypes.cpp.

16{
17 constexpr int max_z = static_cast<int>(kCorderoRadiusPm.size()) - 1;
18 if (atomic_number < 1 || atomic_number > max_z) {
19 throw std::invalid_argument("covalent radius: atomic number " +
20 std::to_string(atomic_number) +
21 " outside the Cordero table");
22 }
23 return kCorderoRadiusPm[static_cast<std::size_t>(atomic_number)] / 100.0;
24}
constexpr std::array< double, 97 > kCorderoRadiusPm

◆ cutoffNeighbors()

std::vector< CutoffPair > gpr::geometry::cutoffNeighbors ( const double * positions,
std::size_t count,
const std::array< double, 9 > & cell,
const std::array< bool, 3 > & periodic,
double cutoff )

Half list of pairs inside a cutoff. Displacements belong to the caller's geometry convention; this function only supplies topology and image labels. Each call owns its allocation. A fully open cell calls linkcell pairs_open. Any periodic axis calls pairs_within_pbc. The command-line searches default to one neighbour thread per rank; RAYON_NUM_THREADS controls linkcell's pool.

Definition at line 16 of file CutoffNeighbors.cpp.

21{
22 if (!(cutoff > 0.0) || !std::isfinite(cutoff))
23 throw std::invalid_argument(
24 "neighbor cutoff must be finite and positive");
25 if (count == 0) return {};
26 if (!positions)
27 throw std::invalid_argument("neighbor positions are required");
28
29 const bool open = !periodic[0] && !periodic[1] && !periodic[2];
30 const linkcell::Cell box = linkcell::Cell::from_vectors(
31 {cell[0], cell[1], cell[2]}, {cell[3], cell[4], cell[5]},
32 {cell[6], cell[7], cell[8]});
33 // half keeps one side of (i, j, S) and (j, i, -S). An open cell has
34 // no lattice, so pairs_open is that half list on the occupied bins.
35 // A mask stays on pairs_within_pbc. A non-positive hint is the
36 // library default. A cutoff much smaller than the box asks for a
37 // mesh the library refuses; doubling the edge keeps the same pairs
38 // and stops once one bin covers the longest axis.
39 const auto query = [&](double hint) {
40 return open
41 ? linkcell::pairs_open(positions, count, cutoff, hint)
42 : linkcell::pairs_within_pbc(positions, count, box, periodic,
43 cutoff, nullptr, hint, true);
44 };
45 double hint = 0.0;
46 std::vector<linkcell::ShiftedPair> neighbors;
47 for (;;) {
48 try {
49 neighbors = query(hint);
50 break;
51 } catch (const linkcell::Error& error) {
52 const std::string message = error.what();
53 if (message.find("too fine") == std::string::npos) throw;
54 const double edge = hint > 0.0 ? hint : cutoff;
55 double longest = edge;
56 if (open) {
57 for (int axis = 0; axis < 3; ++axis) {
58 double lo = positions[axis], hi = lo;
59 for (std::size_t i = 1; i < count; ++i) {
60 const double value = positions[3 * i + axis];
61 lo = std::min(lo, value);
62 hi = std::max(hi, value);
63 }
64 longest = std::max(longest, hi - lo);
65 }
66 } else {
67 const double lengths[3] = {
68 std::hypot(cell[0], cell[1], cell[2]),
69 std::hypot(cell[3], cell[4], cell[5]),
70 std::hypot(cell[6], cell[7], cell[8])};
71 for (const double length: lengths)
72 if (length > 0.0) longest = std::max(longest, length);
73 }
74 const double next = std::min(edge * 2.0, std::max(edge, longest));
75 if (!(next > edge) || !std::isfinite(next)) throw;
76 hint = next;
77 }
78 }
79 std::vector<CutoffPair> pairs;
80 pairs.reserve(neighbors.size());
81 for (const auto& pair: neighbors)
82 pairs.push_back({static_cast<std::size_t>(pair.i),
83 static_cast<std::size_t>(pair.j), pair.shift});
84 std::sort(pairs.begin(), pairs.end(), [](const auto& a, const auto& b) {
85 return std::tie(a.first, a.second, a.shift) <
86 std::tie(b.first, b.second, b.shift);
87 });
88 return pairs;
89}

◆ flatMinimumImageDisplacement()

Eigen::VectorXd gpr::geometry::flatMinimumImageDisplacement ( const PairBox * box,
const Eigen::VectorXd & from,
const Eigen::VectorXd & to )
inlinenodiscard

Per-atom displacement of a flat xyzxyz vector. A null box, or a box that is not periodic, returns to - from.

Definition at line 259 of file MinImage.h.

261{
262 if (from.size() != to.size())
263 throw std::invalid_argument("minimum-image displacement size mismatch");
264 if (box == nullptr || !box->periodic()) return to - from;
265 if (from.size() % 3 != 0)
266 throw std::invalid_argument(
267 "minimum-image displacement needs 3N coordinates");
268 Eigen::VectorXd delta(from.size());
269 const int n_atoms = static_cast<int>(from.size() / 3);
270 for (int atom = 0; atom < n_atoms; ++atom) {
271 const Eigen::Vector3d p = from.segment<3>(3 * atom);
272 const Eigen::Vector3d q = to.segment<3>(3 * atom);
273 delta.segment<3>(3 * atom) = box->displacement(p, q);
274 }
275 return delta;
276}
bool periodic() const noexcept
Some axis is periodic.
Definition MinImage.h:198
void displacement(const double p[3], const double q[3], double dr[3]) const
Displacement from p to q. Cartesian q - p when the cell is zero.
Definition MinImage.h:210

◆ gabrielBondGraph()

std::vector< std::pair< int, int > > gpr::geometry::gabrielBondGraph ( int n_atoms,
const Eigen::VectorXd & positions,
const std::vector< char > & moving_atoms = {},
const std::array< double, 9 > & cell = {} )
nodiscard

Open diametric-ball graph (Gabriel and Sokal 1969). Scale-free: no radial cutoff. Frozen-frozen pairs are omitted when a moving-atom mask is supplied.

Definition at line 792 of file InternalCoordinates.cpp.

795{
796 return bondGraph(n_atoms, positions, moving_atoms, BondGraphKind::Gabriel,
797 cell);
798}
std::vector< std::pair< int, int > > bondGraph(int n_atoms, const Eigen::VectorXd &positions, const std::vector< char > &moving_atoms, BondGraphKind kind, const std::array< double, 9 > &cell)

◆ limitPairDistanceStep()

template<class Distance>
Eigen::VectorXd gpr::geometry::limitPairDistanceStep ( const Eigen::VectorXd & positions,
const Eigen::VectorXd & proposed,
double floor,
Distance && distance )

Keep a proposed Cartesian geometry inside a fixed contact domain. A seed outside the domain may increase its minimum distance; it cannot compress further. Feasible proposals, including outward motion at the boundary, pass through. The lower bracket always holds a feasible point.

Definition at line 75 of file PairDistanceDomain.h.

78{
79 if (!(floor > 0.0)) return proposed;
80 if (positions.size() != proposed.size() || !positions.allFinite())
81 return positions;
82 if (!proposed.allFinite()) return positions;
83 floor = std::min(floor, distance(positions));
84 if (distance(proposed) >= floor) return proposed;
85 double lo = 0.0, hi = 1.0;
86 Eigen::VectorXd accepted = positions;
87 const Eigen::VectorXd step = proposed - positions;
88 for (int i = 0; i < std::numeric_limits<double>::digits; ++i) {
89 const double mid = std::midpoint(lo, hi);
90 if (mid == lo || mid == hi) break;
91 Eigen::VectorXd trial = positions + mid * step;
92 if (trial.allFinite() && distance(trial) >= floor) {
93 lo = mid;
94 accepted = std::move(trial);
95 } else {
96 hi = mid;
97 }
98 }
99 return accepted;
100}

◆ micLattice() [1/2]

std::array< double, 9 > gpr::geometry::micLattice ( const double cell[9])
inlinenodiscardnoexcept

Definition at line 76 of file MinImage.h.

78{
79 std::array<double, 9> out{};
80 copyMicLattice(out.data(), cell);
81 return out;
82}
bool copyMicLattice(double dest[9], const double src[9]) noexcept
Copy src onto dest only when src is a MIC lattice.
Definition MinImage.h:68

◆ micLattice() [2/2]

std::array< double, 9 > gpr::geometry::micLattice ( const std::array< double, 9 > & cell)
inlinenodiscardnoexcept

Definition at line 84 of file MinImage.h.

86{
87 return micLattice(cell.data());
88}
std::array< double, 9 > micLattice(const double cell[9]) noexcept
Definition MinImage.h:76

◆ minimumContactDistance()

double gpr::geometry::minimumContactDistance ( const Eigen::VectorXd & positions,
const std::array< double, 9 > & cell,
double cutoff,
Eigen::Index moving_count = -1 )
inline

Minimum distance capped at the contact radius. Vesin supplies candidates; MinImage owns their distances. Frozen atoms follow the moving coordinates, and frozen-frozen contacts do not constrain the moving domain.

Definition at line 44 of file PairDistanceDomain.h.

48{
49 if (positions.size() % 3 != 0 || !positions.allFinite()) return 0.0;
50 const Eigen::Index count = positions.size() / 3;
51 if (moving_count < 0) moving_count = count;
52 const PairBox box(cell);
53 const std::array<bool, 3> periodic{box.periodic(), box.periodic(),
54 box.periodic()};
55 double minimum = cutoff;
56 for (const auto& pair:
57 cutoffNeighbors(positions.data(), count, cell, periodic, cutoff)) {
58 if (pair.first == pair.second ||
59 std::min(pair.first, pair.second) >=
60 static_cast<std::size_t>(moving_count))
61 continue;
62 minimum = std::min(
63 minimum,
64 std::sqrt(box.dist2(positions.segment<3>(3 * pair.first),
65 positions.segment<3>(3 * pair.second))));
66 }
67 return minimum;
68}
std::vector< CutoffPair > cutoffNeighbors(const double *positions, std::size_t count, const std::array< double, 9 > &cell, const std::array< bool, 3 > &periodic, double cutoff)

◆ minimumPairDistance()

double gpr::geometry::minimumPairDistance ( const Eigen::VectorXd & positions,
const std::array< double, 9 > & cell,
Eigen::Index moving_count = -1 )
inline

Shortest pair distance under the minimum image, the metric every contact floor, step cap and limiter in the band shares. One routine keeps a floor set from the endpoints and a floor enforced on a step in the same rounding. At least one atom of each pair lies before moving_count, when specified.

Definition at line 22 of file PairDistanceDomain.h.

25{
26 if (positions.size() % 3 != 0 || !positions.allFinite()) return 0.0;
27 const Eigen::Index count = positions.size() / 3;
28 if (count < 2) return std::numeric_limits<double>::infinity();
29 if (moving_count < 0) moving_count = count;
30 moving_count = std::min(moving_count, count);
31 const PairBox box(cell);
32 double minimum = std::numeric_limits<double>::infinity();
33 for (Eigen::Index left = 0; left < moving_count; ++left)
34 for (Eigen::Index right = left + 1; right < count; ++right)
35 minimum = std::min(
36 minimum, std::sqrt(box.dist2(positions.segment<3>(3 * left),
37 positions.segment<3>(3 * right))));
38 return minimum;
39}

◆ primitiveTopologyFromBondGraph()

std::vector< PrimitiveInternal > gpr::geometry::primitiveTopologyFromBondGraph ( int n_atoms,
const std::vector< std::pair< int, int > > & bonds )
nodiscard

Definition at line 577 of file InternalCoordinates.cpp.

579{
580 if (n_atoms < 0) {
581 throw std::invalid_argument(
582 "internal coordinate atom count is invalid");
583 }
584
585 std::set<std::pair<int, int>> unique_bonds;
586 for (const auto& bond: bonds) {
587 validateAtomIndex(bond.first, n_atoms);
588 validateAtomIndex(bond.second, n_atoms);
589 unique_bonds.insert(normalizedBond(bond.first, bond.second));
590 }
591
592 std::vector<std::vector<int>> neighbours(static_cast<std::size_t>(n_atoms));
593 std::vector<PrimitiveInternal> primitives;
594 primitives.reserve(unique_bonds.size());
595 for (const auto& bond: unique_bonds) {
596 primitives.push_back(PrimitiveInternal::bond(bond.first, bond.second));
597 neighbours[static_cast<std::size_t>(bond.first)].push_back(bond.second);
598 neighbours[static_cast<std::size_t>(bond.second)].push_back(bond.first);
599 }
600 for (auto& atoms: neighbours)
601 std::sort(atoms.begin(), atoms.end());
602
603 for (int center = 0; center < n_atoms; ++center) {
604 const auto& atoms = neighbours[static_cast<std::size_t>(center)];
605 for (std::size_t i = 0; i < atoms.size(); ++i) {
606 for (std::size_t k = i + 1; k < atoms.size(); ++k) {
607 primitives.push_back(
608 PrimitiveInternal::angle(atoms[i], center, atoms[k]));
609 }
610 }
611 }
612
613 std::set<std::array<int, 4>> unique_dihedrals;
614 for (const auto& bond: unique_bonds) {
615 const int b = bond.first;
616 const int c = bond.second;
617 for (const int a: neighbours[static_cast<std::size_t>(b)]) {
618 if (a == c) continue;
619 for (const int d: neighbours[static_cast<std::size_t>(c)]) {
620 if (d == b || d == a) continue;
621 std::array<int, 4> forward = {a, b, c, d};
622 std::array<int, 4> reverse = {d, c, b, a};
623 unique_dihedrals.insert(std::min(forward, reverse));
624 }
625 }
626 }
627 for (const auto& atoms: unique_dihedrals) {
628 primitives.push_back(PrimitiveInternal::dihedral(atoms[0], atoms[1],
629 atoms[2], atoms[3]));
630 }
631
632 return primitives;
633}
static PrimitiveInternal angle(int a, int b, int c)
static PrimitiveInternal dihedral(int a, int b, int c, int d)
static PrimitiveInternal bond(int a, int b)

◆ primitiveTopologyFromGeometry()

std::vector< PrimitiveInternal > gpr::geometry::primitiveTopologyFromGeometry ( int n_atoms,
const Eigen::VectorXd & positions,
const std::vector< char > & moving_atoms,
BondGraphKind kind,
const std::array< double, 9 > & cell )
nodiscard

Definition at line 830 of file InternalCoordinates.cpp.

834{
837 n_atoms, bondGraph(n_atoms, positions, moving_atoms, kind, cell)),
838 positions, cell);
839}
std::vector< PrimitiveInternal > primitiveTopologyFromBondGraph(int n_atoms, const std::vector< std::pair< int, int > > &bonds)
std::vector< PrimitiveInternal > resolveCollinearAngles(const std::vector< PrimitiveInternal > &primitives, const Eigen::VectorXd &positions, const std::array< double, 9 > &cell)

◆ relativeNeighborhoodBondGraph()

std::vector< std::pair< int, int > > gpr::geometry::relativeNeighborhoodBondGraph ( int n_atoms,
const Eigen::VectorXd & positions,
const std::vector< char > & moving_atoms = {},
const std::array< double, 9 > & cell = {} )
nodiscard

Relative neighborhood graph (Toussaint 1980). Strict Gabriel subgraph: edge (a,b) exists iff no k has both distances to a and b smaller than the distance between a and b. Same moving-atom rule, no cutoff.

Definition at line 800 of file InternalCoordinates.cpp.

803{
804 return bondGraph(n_atoms, positions, moving_atoms,
806}

◆ resolveCollinearAngles() [1/2]

std::vector< PrimitiveInternal > gpr::geometry::resolveCollinearAngles ( const std::vector< PrimitiveInternal > & primitives,
const Eigen::VectorXd & positions,
const std::array< double, 9 > & cell = {} )
nodiscard

Replace every valence angle that is collinear at ~positions~ by the pair of linear bends with orthogonal references, and drop every dihedral whose inner triple is collinear (its plane is undefined). Angles that are not collinear are returned unchanged.

Definition at line 521 of file InternalCoordinates.cpp.

524{
525 const PairBox box(cell);
526 std::vector<PrimitiveInternal> out;
527 out.reserve(primitives.size() + 4);
528 for (const auto& p: primitives) {
529 if (p.kind == PrimitiveKind::Angle) {
530 Eigen::Vector3d axis;
531 if (!tripleIsCollinear(positions, box, p.atoms[0], p.atoms[1],
532 p.atoms[2], &axis)) {
533 PrimitiveInternal kept = p;
534 const Eigen::Vector3d u =
535 box.displacement(atomPosition(positions, p.atoms[1]),
536 atomPosition(positions, p.atoms[0]));
537 const Eigen::Vector3d v =
538 box.displacement(atomPosition(positions, p.atoms[1]),
539 atomPosition(positions, p.atoms[2]));
540 const Eigen::Vector3d nrm = u.cross(v);
541 const double nn = nrm.norm();
542 if (nn > std::numeric_limits<double>::min())
543 kept.reference = nrm / nn;
544 out.push_back(kept);
545 continue;
546 }
547 // Orthonormal references: axis x (least-aligned Cartesian unit)
548 // and axis x that; both perpendicular to the molecular axis.
549 int least = 0;
550 for (int k = 1; k < 3; ++k) {
551 if (std::abs(axis(k)) < std::abs(axis(least))) least = k;
552 }
553 Eigen::Vector3d e = Eigen::Vector3d::Zero();
554 e(least) = 1.0;
555 Eigen::Vector3d n1 = axis.cross(e);
556 n1 /= n1.norm();
557 const Eigen::Vector3d n2 = axis.cross(n1);
558 out.push_back(PrimitiveInternal::linearBend(p.atoms[0], p.atoms[1],
559 p.atoms[2], n1));
560 out.push_back(PrimitiveInternal::linearBend(p.atoms[0], p.atoms[1],
561 p.atoms[2], n2));
562 continue;
563 }
564 if (p.kind == PrimitiveKind::Dihedral) {
565 if (tripleIsCollinear(positions, box, p.atoms[0], p.atoms[1],
566 p.atoms[2], nullptr) ||
567 tripleIsCollinear(positions, box, p.atoms[1], p.atoms[2],
568 p.atoms[3], nullptr)) {
569 continue;
570 }
571 }
572 out.push_back(p);
573 }
574 return out;
575}
Eigen::Vector3d reference
Reference direction of a LinearBend; unused by the other kinds.
static PrimitiveInternal linearBend(int a, int b, int c, const Eigen::Vector3d &reference)

◆ resolveCollinearAngles() [2/2]

std::vector< PrimitiveInternal > gpr::geometry::resolveCollinearAngles ( const std::vector< PrimitiveInternal > & primitives,
const std::vector< Eigen::VectorXd > & geometries,
const std::array< double, 9 > & cell = {} )
nodiscard

Same over several geometries (a path): an angle collinear at ANY of them becomes the bend pair (references from the first geometry where it is collinear), a dihedral with an inner triple collinear at any is dropped. A chart built from a path topology is evaluated at every geometry of the path, so collinearity anywhere on it breaks the valence angle there.

Definition at line 717 of file InternalCoordinates.cpp.

721{
722 if (geometries.empty()) return primitives;
723 const PairBox box(cell);
724 std::vector<PrimitiveInternal> out;
725 out.reserve(primitives.size() + 4);
726 for (const auto& p: primitives) {
727 if (p.kind == PrimitiveKind::Angle) {
728 bool resolved = false;
729 for (const auto& x: geometries) {
730 Eigen::Vector3d axis;
731 if (tripleIsCollinear(x, box, p.atoms[0], p.atoms[1],
732 p.atoms[2], &axis)) {
733 int least = 0;
734 for (int k = 1; k < 3; ++k) {
735 if (std::abs(axis(k)) < std::abs(axis(least)))
736 least = k;
737 }
738 Eigen::Vector3d e = Eigen::Vector3d::Zero();
739 e(least) = 1.0;
740 Eigen::Vector3d n1 = axis.cross(e);
741 n1 /= n1.norm();
742 const Eigen::Vector3d n2 = axis.cross(n1);
744 p.atoms[0], p.atoms[1], p.atoms[2], n1));
746 p.atoms[0], p.atoms[1], p.atoms[2], n2));
747 resolved = true;
748 break;
749 }
750 }
751 if (!resolved) {
752 // Keep the angle; remember the bending plane of the first
753 // geometry where it is bent, the reference for the limit
754 // gradient should a later query meet the triple collinear.
755 PrimitiveInternal kept = p;
756 for (const auto& x: geometries) {
757 const Eigen::Vector3d u =
758 box.displacement(atomPosition(x, p.atoms[1]),
759 atomPosition(x, p.atoms[0]));
760 const Eigen::Vector3d v =
761 box.displacement(atomPosition(x, p.atoms[1]),
762 atomPosition(x, p.atoms[2]));
763 const Eigen::Vector3d nrm = u.cross(v);
764 const double nn = nrm.norm();
765 if (nn > std::numeric_limits<double>::min()) {
766 kept.reference = nrm / nn;
767 break;
768 }
769 }
770 out.push_back(kept);
771 }
772 continue;
773 }
774 if (p.kind == PrimitiveKind::Dihedral) {
775 bool degenerate = false;
776 for (const auto& x: geometries) {
777 if (tripleIsCollinear(x, box, p.atoms[0], p.atoms[1],
778 p.atoms[2], nullptr) ||
779 tripleIsCollinear(x, box, p.atoms[1], p.atoms[2],
780 p.atoms[3], nullptr)) {
781 degenerate = true;
782 break;
783 }
784 }
785 if (degenerate) continue;
786 }
787 out.push_back(p);
788 }
789 return out;
790}
@ x
Definition Enums.h:28

◆ retractRestrictedStep()

Eigen::VectorXd gpr::geometry::retractRestrictedStep ( const InternalCoordinateSet & coordinates,
const Eigen::VectorXd & positions,
const Eigen::VectorXd & cartesian_step,
const Eigen::VectorXd & internal_trust_per_primitive = {} )
nodiscard

MaxInternalStep, then Gauss-Newton retraction onto the linearized internal-coordinate target. A valence target outside the angle chart returns the scaled Cartesian trial. Any other failure throws ~InternalCoordinateRetractionFailed~.

Definition at line 1834 of file InternalCoordinates.cpp.

1838{
1839 const Eigen::VectorXd scaled = scaleCartesianStepToInternalTrust(
1840 coordinates, positions, cartesian_step, internal_trust_per_primitive);
1841 const Eigen::VectorXd retracted =
1842 coordinates.retractLinearized(positions, scaled);
1843 if (retracted.size() != positions.size() || !retracted.allFinite()) {
1845 "internal coordinate retraction failed");
1846 }
1847 return retracted;
1848}
Eigen::VectorXd retractLinearized(const Eigen::VectorXd &positions, const Eigen::VectorXd &cartesian_step) const
Eigen::VectorXd scaleCartesianStepToInternalTrust(const InternalCoordinateSet &coordinates, const Eigen::VectorXd &positions, const Eigen::VectorXd &cartesian_step, const Eigen::VectorXd &internal_trust_per_primitive)

◆ scaleCartesianStepToInternalTrust()

Eigen::VectorXd gpr::geometry::scaleCartesianStepToInternalTrust ( const InternalCoordinateSet & coordinates,
const Eigen::VectorXd & positions,
const Eigen::VectorXd & cartesian_step,
const Eigen::VectorXd & internal_trust_per_primitive = {} )
nodiscard

Scale a Cartesian step so no linearized primitive change exceeds its trust radius (Sella MaxInternalStep). An empty trust vector uses ~sellaInternalTrust~.

Definition at line 1806 of file InternalCoordinates.cpp.

1810{
1811 if (cartesian_step.size() != positions.size() ||
1812 !cartesian_step.allFinite() || !positions.allFinite()) {
1813 return cartesian_step;
1814 }
1815 const Eigen::VectorXd trust = internal_trust_per_primitive.size() > 0
1816 ? internal_trust_per_primitive
1817 : sellaInternalTrust(coordinates);
1818 if (trust.size() == 0 || trust.maxCoeff() <= 0.0) return cartesian_step;
1819 const Eigen::VectorXd ds =
1820 coordinates.linearizedChange(positions, cartesian_step);
1821 if (ds.size() == 0) return cartesian_step;
1822 double worst_ratio = 1.0;
1823 for (Eigen::Index k = 0; k < ds.size(); ++k) {
1824 const double radius = k < trust.size() ? trust(k) : 0.0;
1825 if (!(radius > 0.0)) continue;
1826 const double change = std::abs(ds(k));
1827 if (std::isfinite(change) && change / radius > worst_ratio)
1828 worst_ratio = change / radius;
1829 }
1830 if (worst_ratio > 1.0) return cartesian_step / worst_ratio;
1831 return cartesian_step;
1832}
Eigen::VectorXd linearizedChange(const Eigen::VectorXd &positions, const Eigen::VectorXd &direction) const
Eigen::VectorXd sellaInternalTrust(const InternalCoordinateSet &coordinates)

◆ sellaInternalTrust()

Eigen::VectorXd gpr::geometry::sellaInternalTrust ( const InternalCoordinateSet & coordinates)
nodiscard

Sella restricted_step.MaxInternalStep radii: 0.2 Å for bonds and linear bends, 0.2 rad for valence angles, 0.3 rad for dihedrals.

Definition at line 1787 of file InternalCoordinates.cpp.

1788{
1789 const auto& primitives = coordinates.primitives();
1790 Eigen::VectorXd trust(static_cast<Eigen::Index>(primitives.size()));
1791 for (std::size_t i = 0; i < primitives.size(); ++i) {
1792 switch (primitives[i].kind) {
1794 trust(static_cast<Eigen::Index>(i)) = 0.3;
1795 break;
1799 trust(static_cast<Eigen::Index>(i)) = 0.2;
1800 break;
1801 }
1802 }
1803 return trust;
1804}
const std::vector< PrimitiveInternal > & primitives() const

◆ unionBondGraph()

std::vector< std::pair< int, int > > gpr::geometry::unionBondGraph ( int n_atoms,
const std::vector< Eigen::VectorXd > & geometries,
const std::vector< char > & moving_atoms = {},
BondGraphKind kind = BondGraphKind::Gabriel,
const std::array< double, 9 > & cell = {} )
nodiscard

Union of per-geometry bond graphs. A forming or breaking pair that is an edge at any listed geometry stays in the set.

Definition at line 816 of file InternalCoordinates.cpp.

820{
821 std::set<std::pair<int, int>> bonds;
822 for (const auto& positions: geometries) {
823 const auto graph =
824 bondGraph(n_atoms, positions, moving_atoms, kind, cell);
825 bonds.insert(graph.begin(), graph.end());
826 }
827 return {bonds.begin(), bonds.end()};
828}

◆ uniqueImageRadius() [1/2]

double gpr::geometry::uniqueImageRadius ( const double cell[9])
inlinenodiscardnoexcept

Radius inside which every pair displacement has one nearest image.

h_i is the length of lattice row i orthogonal to the span of the other periodic rows: the cell volume divided by the area of the other two rows for a bulk cell, the in-plane row spacing for a slab, or the row length for a wire. A sphere of radius min_i h_i / 2 fits inside the cell parallelepiped and so inside the Wigner-Seitz cell, whose boundary is where the nearest image changes and a pair displacement turns discontinuously. Zero for a cell that is not a MIC lattice.

Definition at line 112 of file MinImage.h.

113{
114 if (!cellIsMicLattice(cell)) return 0.0;
115 mi_cell box{};
116 for (int row = 0; row < 3; ++row) {
117 const double* src = cell + 3 * row;
118 double* dst = row == 0 ? &box.ax : row == 1 ? &box.bx : &box.cx;
119 dst[0] = src[0];
120 dst[1] = src[1];
121 dst[2] = src[2];
122 }
123 double radius = 0.0;
124 if (minimage_unique_image_radius(&box, &radius) != 0) return 0.0;
125 return radius;
126}

◆ uniqueImageRadius() [2/2]

double gpr::geometry::uniqueImageRadius ( const std::array< double, 9 > & cell)
inlinenodiscardnoexcept

Definition at line 128 of file MinImage.h.

130{
131 return uniqueImageRadius(cell.data());
132}
double uniqueImageRadius(const double cell[9]) noexcept
Definition MinImage.h:112

◆ zeroOpenAxes()

void gpr::geometry::zeroOpenAxes ( double cell[9],
const std::array< bool, 3 > & periodic )
inlinenoexcept

Copy of cell with the rows of the open axes of periodic set to zero, the form every distance consumer reads a periodicity mask from.

Definition at line 136 of file MinImage.h.

138{
139 for (int row = 0; row < 3; ++row)
140 if (!periodic[row])
141 for (int k = 0; k < 3; ++k)
142 cell[3 * row + k] = 0.0;
143}

Variable Documentation

◆ kCorderoRadiusPm

std::array<double, 97> gpr::geometry::kCorderoRadiusPm
inlineconstexpr

Cordero 2008 covalent radii (single-bond), indexed by atomic number Z = 1..96. Units: picometres. Z = 0 sentinel reserved for the "unknown / dummy" entry the lookup uses when Z is out of range.

Definition at line 14 of file CorderoRadii.h.

14 {
15 /* 0 X */ 0.0,
16 /* 1 H */ 31.0,
17 /* 2 He */ 28.0,
18 /* 3 Li */ 128.0,
19 /* 4 Be */ 96.0,
20 /* 5 B */ 84.0,
21 /* 6 C */ 76.0,
22 /* 7 N */ 71.0,
23 /* 8 O */ 66.0,
24 /* 9 F */ 57.0,
25 /* 10 Ne */ 58.0,
26 /* 11 Na */ 166.0,
27 /* 12 Mg */ 141.0,
28 /* 13 Al */ 121.0,
29 /* 14 Si */ 111.0,
30 /* 15 P */ 107.0,
31 /* 16 S */ 105.0,
32 /* 17 Cl */ 102.0,
33 /* 18 Ar */ 106.0,
34 /* 19 K */ 203.0,
35 /* 20 Ca */ 176.0,
36 /* 21 Sc */ 170.0,
37 /* 22 Ti */ 160.0,
38 /* 23 V */ 153.0,
39 /* 24 Cr */ 139.0,
40 /* 25 Mn */ 139.0,
41 /* 26 Fe */ 132.0,
42 /* 27 Co */ 126.0,
43 /* 28 Ni */ 124.0,
44 /* 29 Cu */ 132.0,
45 /* 30 Zn */ 122.0,
46 /* 31 Ga */ 122.0,
47 /* 32 Ge */ 120.0,
48 /* 33 As */ 119.0,
49 /* 34 Se */ 120.0,
50 /* 35 Br */ 120.0,
51 /* 36 Kr */ 116.0,
52 /* 37 Rb */ 220.0,
53 /* 38 Sr */ 195.0,
54 /* 39 Y */ 190.0,
55 /* 40 Zr */ 175.0,
56 /* 41 Nb */ 164.0,
57 /* 42 Mo */ 154.0,
58 /* 43 Tc */ 147.0,
59 /* 44 Ru */ 146.0,
60 /* 45 Rh */ 142.0,
61 /* 46 Pd */ 139.0,
62 /* 47 Ag */ 145.0,
63 /* 48 Cd */ 144.0,
64 /* 49 In */ 142.0,
65 /* 50 Sn */ 139.0,
66 /* 51 Sb */ 139.0,
67 /* 52 Te */ 138.0,
68 /* 53 I */ 139.0,
69 /* 54 Xe */ 140.0,
70 /* 55 Cs */ 244.0,
71 /* 56 Ba */ 215.0,
72 /* 57 La */ 207.0,
73 /* 58 Ce */ 204.0,
74 /* 59 Pr */ 203.0,
75 /* 60 Nd */ 201.0,
76 /* 61 Pm */ 199.0,
77 /* 62 Sm */ 198.0,
78 /* 63 Eu */ 198.0,
79 /* 64 Gd */ 196.0,
80 /* 65 Tb */ 194.0,
81 /* 66 Dy */ 192.0,
82 /* 67 Ho */ 192.0,
83 /* 68 Er */ 189.0,
84 /* 69 Tm */ 190.0,
85 /* 70 Yb */ 187.0,
86 /* 71 Lu */ 187.0,
87 /* 72 Hf */ 175.0,
88 /* 73 Ta */ 170.0,
89 /* 74 W */ 162.0,
90 /* 75 Re */ 151.0,
91 /* 76 Os */ 144.0,
92 /* 77 Ir */ 141.0,
93 /* 78 Pt */ 136.0,
94 /* 79 Au */ 136.0,
95 /* 80 Hg */ 132.0,
96 /* 81 Tl */ 145.0,
97 /* 82 Pb */ 146.0,
98 /* 83 Bi */ 148.0,
99 /* 84 Po */ 140.0,
100 /* 85 At */ 150.0,
101 /* 86 Rn */ 150.0,
102 /* 87 Fr */ 260.0,
103 /* 88 Ra */ 221.0,
104 /* 89 Ac */ 215.0,
105 /* 90 Th */ 206.0,
106 /* 91 Pa */ 200.0,
107 /* 92 U */ 196.0,
108 /* 93 Np */ 190.0,
109 /* 94 Pu */ 187.0,
110 /* 95 Am */ 180.0,
111 /* 96 Cm */ 169.0,
112};