80 using RealPair = std::pair<RealType, RealType>;
83 twist0_(0.0), swingX0_(0.0), swingY0_(0.0), posZ0_(0.0),
84 printRest_(
false), restType_(0) {}
86 virtual ~Restraint() {}
91 void setReferenceStructure() {}
93 RealType getUnscaledPotential() {
return pot_; }
94 RealType getPotential() {
return scaleFactor_ * pot_; }
96 void setRestraintName(std::string name) { restName_ = name; }
97 std::string getRestraintName() {
return restName_; }
104 void setScaleFactor(RealType sf) { scaleFactor_ = sf; }
106 void setDisplacementForceConstant(RealType kDisp) {
108 restType_ |= rtDisplacement;
109 if (printRest_) restInfo_[rtDisplacement] = std::make_pair(0.0, 0.0);
112 void setDisplacementXForceConstant(RealType kDisp) {
114 restType_ |= rtDisplacementX;
115 if (printRest_) restInfo_[rtDisplacementX] = std::make_pair(0.0, 0.0);
117 void setDisplacementYForceConstant(RealType kDisp) {
119 restType_ |= rtDisplacementY;
120 if (printRest_) restInfo_[rtDisplacementY] = std::make_pair(0.0, 0.0);
122 void setDisplacementZForceConstant(RealType kDisp) {
124 restType_ |= rtDisplacementZ;
125 if (printRest_) restInfo_[rtDisplacementZ] = std::make_pair(0.0, 0.0);
128 void setAbsoluteForceConstant(RealType kAbs) {
130 restType_ |= rtAbsoluteZ;
131 if (printRest_) restInfo_[rtAbsoluteZ] = std::make_pair(0.0, 0.0);
134 void setTwistForceConstant(RealType kTwist) {
135 kTwist_ = kTwist / 4;
136 restType_ |= rtTwist;
137 if (printRest_) restInfo_[rtTwist] = std::make_pair(0.0, 0.0);
140 void setSwingXForceConstant(RealType kSwingX) {
142 restType_ |= rtSwingX;
143 if (printRest_) restInfo_[rtSwingX] = std::make_pair(0.0, 0.0);
146 void setSwingYForceConstant(RealType kSwingY) {
148 restType_ |= rtSwingY;
149 if (printRest_) restInfo_[rtSwingY] = std::make_pair(0.0, 0.0);
152 void setAbsolutePositionZ(RealType z0) {
154 restType_ |= rtAbsoluteZ;
155 if (printRest_) restInfo_[rtAbsoluteZ] = std::make_pair(0.0, 0.0);
162 void setRestrainedTwistAngle(RealType twist0) {
164 restType_ |= rtTwist;
165 if (printRest_) restInfo_[rtTwist] = std::make_pair(0.0, 0.0);
168 void setRestrainedSwingXAngle(RealType swingX0) {
170 restType_ |= rtSwingX;
171 if (printRest_) restInfo_[rtSwingX] = std::make_pair(0.0, 0.0);
174 void setRestrainedSwingYAngle(RealType swingY0) {
176 restType_ |= rtSwingY;
177 if (printRest_) restInfo_[rtSwingY] = std::make_pair(0.0, 0.0);
180 void setPrintRestraint(
bool printRest) { printRest_ = printRest; }
182 RealType getDisplacementForceConstant() {
return kDisp_; }
183 RealType getDisplacementXForceConstant() {
return kDispX_; }
184 RealType getDisplacementYForceConstant() {
return kDispY_; }
185 RealType getDisplacementZForceConstant() {
return kDispZ_; }
186 RealType getAbsoluteForceConstant() {
return kAbs_; }
187 RealType getAbsolutePositionZ() {
return posZ0_; }
188 RealType getTwistForceConstant() {
return kTwist_; }
189 RealType getSwingXForceConstant() {
return kSwingX_; }
190 RealType getSwingYForceConstant() {
return kSwingY_; }
191 RealType getRestrainedTwistAngle() {
return twist0_; }
192 RealType getRestrainedSwingXAngle() {
return swingX0_; }
193 RealType getRestrainedSwingYAngle() {
return swingY0_; }
194 std::map<int, RealPair> getRestraintInfo() {
return restInfo_; }
195 bool getPrintRestraint() {
return printRest_; }
198 RealType scaleFactor_;
215 std::string restName_;
216 std::map<int, RealPair> restInfo_;