| 45 |  | #include "utils/simError.h" | 
| 46 |  | namespace OpenMD { | 
| 47 |  |  | 
| 48 | < | Shake::Shake(SimInfo* info) : info_(info), maxConsIteration_(10), consTolerance_(1.0e-6), doShake_(false) { | 
| 48 | > | Shake::Shake(SimInfo* info) : info_(info), maxConsIteration_(10), | 
| 49 | > | consTolerance_(1.0e-6), doShake_(false), | 
| 50 | > | currConstraintTime_(0.0)  { | 
| 51 |  |  | 
| 52 |  | if (info_->getNGlobalConstraints() > 0) | 
| 53 |  | doShake_ = true; | 
| 54 |  |  | 
| 55 | + | if (!doShake_) return; | 
| 56 | + |  | 
| 57 |  | Globals* simParams = info_->getSimParams(); | 
| 58 |  |  | 
| 59 |  | currentSnapshot_ = info_->getSnapshotManager()->getCurrentSnapshot(); | 
| 63 |  | constraintTime_ = simParams->getStatusTime(); | 
| 64 |  | } | 
| 65 |  |  | 
| 66 | < | constraintOutputFile_ = getPrefix(info_->getFinalConfigFileName()) + ".constraintForces"; | 
| 66 | > | constraintOutputFile_ = getPrefix(info_->getFinalConfigFileName()) + | 
| 67 | > | ".constraintForces"; | 
| 68 |  |  | 
| 69 |  | // create ConstraintWriter | 
| 70 | < | constraintWriter_ = new ConstraintWriter(info_, constraintOutputFile_.c_str()); | 
| 70 | > | constraintWriter_ = new ConstraintWriter(info_, | 
| 71 | > | constraintOutputFile_.c_str()); | 
| 72 |  |  | 
| 73 |  | if (!constraintWriter_){ | 
| 74 |  | sprintf(painCave.errMsg, "Failed to create ConstraintWriter\n"); |