message<<"ShakeCluster::addAtom: "<<"atom "<<id<<" has more than 3 constraints!."<<std::endl;
throwOpenMMException(message.str());
}
if(_size>0&&dist!=_distance){
std::stringstreammessage;
message<<"ShakeCluster::addAtom: "<<"atom "<<id<<" has different constraint distances: "<<dist<<" and "<<_distance<<std::endl;
throwOpenMMException(message.str());
}
if(_size>0&&invMass!=_peripheralInvMass){
std::stringstreammessage;
message<<"ShakeCluster::addAtom: "<<" constrainted atoms associated w/ atom "<<id<<" have different masses: "<<invMass<<" and "<<_peripheralInvMass<<std::endl;
throwOpenMMException(message.str());
}
_peripheralID[_size++]=id;
_distance=dist;
_peripheralInvMass=invMass;
}
};
/**
*
* Encapsulates stochastic dynamics algorithm
*
*/
classBrookShakeAlgorithm:publicBrookCommon{
public:
/**
* Constructor
*
*/
BrookShakeAlgorithm();
/**
* Destructor
*
*/
~BrookShakeAlgorithm();
/**
* Get number of constraints
*
* @return number of constraints
*
*/
intgetNumberOfConstraints(void)const;
/**
* Get max iterations
*
* @return max iterations
*
*/
intgetMaxIterations(void)const;
/**
* Set max iterations
*
* @param max iterations
*
* @return DefaultReturnValue
*
*/
intsetMaxIterations(intmaxIterations);
/**
* Get SHAKE tolerance
*
* @return SHAKE tolerance
*
*/
BrookOpenMMFloatgetShakeTolerance(void)const;
/**
* Set SHAKE tolerance
*
* @param SHAKE tolerance
*
* @return DefaultReturnValue
*
*/
intsetShakeTolerance(BrookOpenMMFloattolerance);
/**
* Get Shake particle stream width
*
* @return particle stream width
*/
intgetShakeParticleStreamWidth(void)const;
/**
* Get Shake particle stream height
*
* @return particle stream height
*/
intgetShakeParticleStreamHeight(void)const;
/**
* Get Shake particle stream size
*
* @return particle stream size
*/
intgetShakeParticleStreamSize(void)const;
/**
* Get Shake constraint stream width
*
* @return constraint stream width
*/
intgetShakeConstraintStreamWidth(void)const;
/**
* Get Shake constraint stream height
*
* @return constraint stream height
*/
intgetShakeConstraintStreamHeight(void)const;
/**
* Get Shake constraint stream size
*
* @return constraint stream size
*/
intgetShakeConstraintStreamSize(void)const;
/**
* Get array of Shake streams
*
* @return array ofstreams
*
*/
BrookFloatStreamInternal**getStreams(void);
/*
* Setup of Shake parameters
*
* @param masses masses
* @param constraintIndices constraint particle indices