28#if !defined(LOOS_SPRING_FUNCTIONS_HPP)
29#define LOOS_SPRING_FUNCTIONS_HPP
77 typedef std::vector<double> Params;
83 virtual std::string
name()
const =0;
109 std::cerr <<
"Warning- negative spring constants found in " <<
name() <<
". Setting to 0.\n";
140 for (uint i=0; i<9; ++i)
170 std::string
name()
const {
return(
"DistanceCutoff"); }
188 double s = d.length2();
206 std::string
name()
const {
return(
"DistanceWeight"); }
225 double s = d.length();
226 return(pow(s, power));
242 std::string
name()
const {
return(
"ExponentialDistance"); }
260 double s = d.length();
261 return(exp(scale * s));
286 HCA(
const double rc,
const double a,
const double b,
const double c,
const double d) :
287 rcut(rc), k1(a), k2(b), k3(c), k4(d) { }
290 rcut(4.0), k1(205.5), k2(571.2), k3(305.9e3), k4(6.0) { }
292 std::string
name()
const {
return(
"HCA"); }
324 double s = d.length();
330 k = k3 * pow(s, -k4);
336 double rcut, k1, k2, k3, k4;
345 std::string
name()
const {
return(
"ConstBonded"); }
371 SpringFunction*
springFactory(
const std::string& spring_desc);
Bad spring function was requested.
Definition spring_functions.hpp:42
Unspecified problem with parameters in SpringFunction.
Definition spring_functions.hpp:49
Use a spring function that is a constant weight regardless of distance.
Definition spring_functions.hpp:340
std::string name() const
Name for this particular spring function.
Definition spring_functions.hpp:345
Params setParams(const Params &p)
Sets the internal constants, returning the unused ones.
Definition spring_functions.hpp:347
double constantImpl(const loos::GCoord &u, const loos::GCoord &v, const loos::GCoord &d)
Implementation of the spring constant calculation.
Definition spring_functions.hpp:361
uint paramSize() const
How many internal constants there are.
Definition spring_functions.hpp:359
bool validParams() const
Determines if the internal constants are "valid".
Definition spring_functions.hpp:357
Basic distance cutoff for "traditional" ENM.
Definition spring_functions.hpp:165
uint paramSize() const
How many internal constants there are.
Definition spring_functions.hpp:185
bool validParams() const
Determines if the internal constants are "valid".
Definition spring_functions.hpp:183
Params setParams(const Params &p)
Sets the internal constants, returning the unused ones.
Definition spring_functions.hpp:172
double constantImpl(const loos::GCoord &u, const loos::GCoord &v, const loos::GCoord &d)
Implementation of the spring constant calculation.
Definition spring_functions.hpp:187
std::string name() const
Name for this particular spring function.
Definition spring_functions.hpp:170
Distance weighting (i.e. )
Definition spring_functions.hpp:201
Params setParams(const Params &p)
Sets the internal constants, returning the unused ones.
Definition spring_functions.hpp:209
double constantImpl(const loos::GCoord &u, const loos::GCoord &v, const loos::GCoord &d)
Implementation of the spring constant calculation.
Definition spring_functions.hpp:224
uint paramSize() const
How many internal constants there are.
Definition spring_functions.hpp:221
bool validParams() const
Determines if the internal constants are "valid".
Definition spring_functions.hpp:219
std::string name() const
Name for this particular spring function.
Definition spring_functions.hpp:206
Exponential distance weighting (i.e. )
Definition spring_functions.hpp:237
uint paramSize() const
How many internal constants there are.
Definition spring_functions.hpp:256
Params setParams(const Params &p)
Sets the internal constants, returning the unused ones.
Definition spring_functions.hpp:244
double constantImpl(const loos::GCoord &u, const loos::GCoord &v, const loos::GCoord &d)
Implementation of the spring constant calculation.
Definition spring_functions.hpp:259
bool validParams() const
Determines if the internal constants are "valid".
Definition spring_functions.hpp:254
std::string name() const
Name for this particular spring function.
Definition spring_functions.hpp:242
HCA method (bimodal distance-based function)
Definition spring_functions.hpp:284
Params setParams(const Params &p)
Sets the internal constants, returning the unused ones.
Definition spring_functions.hpp:294
double constantImpl(const loos::GCoord &u, const loos::GCoord &v, const loos::GCoord &d)
Implementation of the spring constant calculation.
Definition spring_functions.hpp:323
bool validParams() const
Determines if the internal constants are "valid".
Definition spring_functions.hpp:318
uint paramSize() const
How many internal constants there are.
Definition spring_functions.hpp:320
std::string name() const
Name for this particular spring function.
Definition spring_functions.hpp:292
Interface for ENM spring functions.
Definition spring_functions.hpp:75
virtual loos::DoubleMatrix constant(const loos::GCoord &u, const loos::GCoord &v, const loos::GCoord &d)=0
Actually compute the spring constant as a 3x3 matrix.
virtual uint paramSize() const =0
How many internal constants there are.
double checkConstant(double d)
Check for negative spring-constants.
Definition spring_functions.hpp:105
virtual std::string name() const =0
Name for this particular spring function.
virtual Params setParams(const Params &konst)=0
Sets the internal constants, returning the unused ones.
virtual bool validParams() const =0
Determines if the internal constants are "valid".
Simple matrix template class using policy classes to determine behavior.
Definition MatrixImpl.hpp:148
Namespace to encapsulate Elastic Network Model routines.
Definition anm-lib.hpp:32
std::vector< std::string > springNames()
List of possible names for springFactory()
Definition spring_functions.cpp:76
SpringFunction * springFactory(const std::string &spring_desc)
Factory function for generating new SpringFunction instances based on a user string.
Definition spring_functions.cpp:36