Loading...
Searching...
No Matches
eonc::neb::WeightedSpring Struct Reference

Energy-weighted spring constants (variable per segment). More...

#include <NEBSpringForce.h>

Public Member Functions

SpringResult compute (long i, const AtomMatrix &tangent, double distNext, double distPrev) const

Public Attributes

std::vector< double > springConstants

Detailed Description

Energy-weighted spring constants (variable per segment).

Definition at line 50 of file NEBSpringForce.h.

Member Function Documentation

◆ compute()

SpringResult eonc::neb::WeightedSpring::compute ( long i,
const AtomMatrix & tangent,
double distNext,
double distPrev ) const

Definition at line 45 of file NEBSpringForce.cpp.

46 {
47 if (i < 1 || static_cast<size_t>(i) >= springConstants.size()) {
48 throw std::invalid_argument(
49 "WeightedSpring::compute: image index out of range");
50 }
51 double kspNext = springConstants[i];
52 double kspPrev = springConstants[i - 1];
53
54 SpringResult result;
55 result.forceSpringPar =
56 ((kspNext * distNext) - (kspPrev * distPrev)) * tangent;
57 result.forceSpring = AtomMatrix::Zero(tangent.rows(), tangent.cols());
58 return result;
59}
std::vector< double > springConstants

Member Data Documentation

◆ springConstants

std::vector<double> eonc::neb::WeightedSpring::springConstants

Definition at line 51 of file NEBSpringForce.h.


The documentation for this struct was generated from the following files: