62 |
|
class PolynomialBendType : public BendType{ |
63 |
|
|
64 |
|
public: |
65 |
< |
PolynomialBendType(double theta) : BendType(theta) {} |
65 |
> |
PolynomialBendType(RealType theta) : BendType(theta) {} |
66 |
|
|
67 |
< |
void setCoefficient(int power, double coefficient) { |
67 |
> |
void setCoefficient(int power, RealType coefficient) { |
68 |
|
polynomial_.setCoefficient(power, coefficient); |
69 |
|
} |
70 |
|
|
71 |
< |
double getCoefficient(int power) { |
71 |
> |
RealType getCoefficient(int power) { |
72 |
|
return polynomial_.getCoefficient(power); |
73 |
|
} |
74 |
|
|
75 |
< |
void calcForce(double theta, double & V, double & dVdr) { |
76 |
< |
double delta = theta - theta0_; |
75 |
> |
void calcForce(RealType theta, RealType & V, RealType & dVdr) { |
76 |
> |
RealType delta = theta - theta0_; |
77 |
|
V = polynomial_.evaluate(delta); |
78 |
|
dVdr = polynomial_.evaluateDerivative(delta); |
79 |
|
|