# | Line 54 | Line 54 | namespace oopse { | |
---|---|---|
54 | class HarmonicBondType : public BondType { | |
55 | ||
56 | public: | |
57 | < | |
57 | > | |
58 | HarmonicBondType(RealType myR0, RealType myK) : BondType(myR0) { | |
59 | k = myK; | |
60 | } | |
61 | ||
62 | void setForceConstant(RealType myK) {k = myK; } | |
63 | < | |
63 | > | |
64 | RealType getForceConstant() {return k;} | |
65 | < | |
65 | > | |
66 | virtual void calcForce(RealType r, RealType& V, RealType& dVdr) { | |
67 | RealType dr; | |
68 | < | |
68 | > | |
69 | dr = r - r0; | |
70 | ||
71 | V = 0.5 * k * dr * dr; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |