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 40 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 33 of file NEBSpringForce.cpp.

34 {
35 if (i < 1 || static_cast<size_t>(i) >= springConstants.size()) {
36 throw std::invalid_argument(
37 "WeightedSpring::compute: image index out of range");
38 }
39 double kspNext = springConstants[i];
40 double kspPrev = springConstants[i - 1];
41
42 SpringResult result;
43 result.forceSpringPar =
44 ((kspNext * distNext) - (kspPrev * distPrev)) * tangent;
45 result.forceSpring = AtomMatrix::Zero(tangent.rows(), tangent.cols());
46 return result;
47}
std::vector< double > springConstants

Member Data Documentation

◆ springConstants

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

Definition at line 41 of file NEBSpringForce.h.


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