From: Nava W. <nwh...@tc...> - 2007-05-30 23:13:38
|
On Mon, 28 May 2007, Paul R Brenner wrote: > Looks like there are Gravitation and ExternalGravitation forces. Thanks again, I've worked up a very simple Gravitation system, in case anybody else might find it useful it's online at: http://moloch.tchpc.tcd.ie/~new299/gravitation.tar.gz I have implemented my integrator basically as for Leapfrog but with the following run method (and overriding addModifierAfterInitialize, because I am performing two force calculations per timestep). It this the correct setup for Protomol?: void MyIntegrator::run(int numTimesteps) { if( numTimesteps < 1 ) return; preStepModify(); for( int i = 0; i < numTimesteps; i++ ) { * perform a single integration step * myTopo->time += getTimestep(); buildMolecularCenterOfMass(myPositions,myTopo); buildMolecularMomentum(myVelocities,myTopo); postDriftOrNextModify(); } postStepModify(); } The trajectory for my system appears to be more or less correct, but I have currently omitted the following code which is present in LeapfrogIntegrator::doKickdoDrift(). Could you give me some idea of what these methods do, and where I should include them?: if(anyPreDriftOrNextModify() || anyPreStepModify() || anyPostStepModify()){ if(anyPreStepModify() || anyPostStepModify()){ doHalfKick(); postStepModify(); preStepModify(); doHalfKick(); } else { doKick(); } doDriftOrNextIntegrator(); } else { ... integration step } Many Thanks, Dr Nava Whiteford Trinity Centre for High Performance Computing Room 203, Second Floor, Lloyd Building, Trinity College Dublin 2 Ireland Tel: +353 1 896 8458 |