# | Line 11 | Line 11 | |
---|---|---|
11 | #include "simError.h" | |
12 | ||
13 | ||
14 | < | Integrator::Integrator( SimInfo *theInfo, ForceFields* the_ff ){ |
14 | > | template<typename T> Integrator<T>::Integrator( SimInfo *theInfo, ForceFields* the_ff ) { |
15 | ||
16 | info = theInfo; | |
17 | myFF = the_ff; | |
# | Line 41 | Line 41 | Integrator::Integrator( SimInfo *theInfo, ForceFields* | |
41 | checkConstraints(); | |
42 | } | |
43 | ||
44 | < | Integrator::~Integrator() { |
44 | > | template<typename T> Integrator<T>::~Integrator() { |
45 | ||
46 | if( nConstrained ){ | |
47 | delete[] constrainedA; | |
# | Line 54 | Line 54 | Integrator::~Integrator() { | |
54 | ||
55 | } | |
56 | ||
57 | < | void Integrator::checkConstraints( void ){ |
57 | > | template<typename T> void Integrator<T>::checkConstraints( void ){ |
58 | ||
59 | ||
60 | isConstrained = 0; | |
# | Line 155 | Line 155 | void Integrator::checkConstraints( void ){ | |
155 | } | |
156 | ||
157 | ||
158 | < | void Integrator::integrate( void ){ |
158 | > | template<typename T> void Integrator<T>::integrate( void ){ |
159 | ||
160 | int i, j; // loop counters | |
161 | ||
# | Line 196 | Line 196 | void Integrator::integrate( void ){ | |
196 | currThermal = thermalTime; | |
197 | currStatus = statusTime; | |
198 | ||
199 | < | dumpOut->writeDump( info->currTime ); |
200 | < | statOut->writeStat( info->currTime ); |
199 | > | dumpOut->writeDump( info->getTime() ); |
200 | > | statOut->writeStat( info->getTime() ); |
201 | ||
202 | readyCheck(); | |
203 | ||
# | Line 207 | Line 207 | void Integrator::integrate( void ){ | |
207 | MPIcheckPoint(); | |
208 | #endif // is_mpi | |
209 | ||
210 | < | while( info->currTime < runTime ){ |
210 | > | while( info->getTime() < runTime ){ |
211 | ||
212 | < | if( (info->currTime+dt) >= currStatus ){ |
212 | > | if( (info->getTime()+dt) >= currStatus ){ |
213 | calcPot = 1; | |
214 | calcStress = 1; | |
215 | } | |
216 | ||
217 | integrateStep( calcPot, calcStress ); | |
218 | ||
219 | < | info->currTime += dt; |
220 | < | info->setTime(info->currTime); |
219 | > | info->incrTime(dt); |
220 | ||
221 | if( info->setTemp ){ | |
222 | < | if( info->currTime >= currThermal ){ |
222 | > | if( info->getTime() >= currThermal ){ |
223 | tStats->velocitize(); | |
224 | currThermal += thermalTime; | |
225 | } | |
226 | } | |
227 | ||
228 | < | if( info->currTime >= currSample ){ |
229 | < | dumpOut->writeDump( info->currTime ); |
228 | > | if( info->getTime() >= currSample ){ |
229 | > | dumpOut->writeDump( info->getTime() ); |
230 | currSample += sampleTime; | |
231 | } | |
232 | ||
233 | < | if( info->currTime >= currStatus ){ |
234 | < | statOut->writeStat( info->currTime ); |
233 | > | if( info->getTime() >= currStatus ){ |
234 | > | statOut->writeStat( info->getTime() ); |
235 | calcPot = 0; | |
236 | calcStress = 0; | |
237 | currStatus += statusTime; | |
# | Line 246 | Line 245 | void Integrator::integrate( void ){ | |
245 | ||
246 | } | |
247 | ||
248 | < | dumpOut->writeFinal(info->currTime); |
248 | > | dumpOut->writeFinal(info->getTime()); |
249 | ||
250 | delete dumpOut; | |
251 | delete statOut; | |
252 | } | |
253 | ||
254 | < | void Integrator::integrateStep( int calcPot, int calcStress ){ |
254 | > | template<typename T> void Integrator<T>::integrateStep( int calcPot, int calcStress ){ |
255 | ||
256 | ||
257 | ||
# | Line 293 | Line 292 | void Integrator::integrateStep( int calcPot, int calcS | |
292 | } | |
293 | ||
294 | ||
295 | < | void Integrator::moveA( void ){ |
295 | > | template<typename T> void Integrator<T>::moveA( void ){ |
296 | ||
297 | int i, j; | |
298 | DirectionalAtom* dAtom; | |
# | Line 372 | Line 371 | void Integrator::moveA( void ){ | |
371 | } | |
372 | ||
373 | ||
374 | < | void Integrator::moveB( void ){ |
374 | > | template<typename T> void Integrator<T>::moveB( void ){ |
375 | int i, j; | |
376 | DirectionalAtom* dAtom; | |
377 | double Tb[3], ji[3]; | |
# | Line 414 | Line 413 | void Integrator::moveB( void ){ | |
413 | } | |
414 | } | |
415 | ||
416 | < | void Integrator::preMove( void ){ |
416 | > | template<typename T> void Integrator<T>::preMove( void ){ |
417 | int i, j; | |
418 | double pos[3]; | |
419 | ||
# | Line 432 | Line 431 | void Integrator::preMove( void ){ | |
431 | } | |
432 | } | |
433 | ||
434 | < | void Integrator::constrainA(){ |
434 | > | template<typename T> void Integrator<T>::constrainA(){ |
435 | ||
436 | int i,j,k; | |
437 | int done; | |
# | Line 583 | Line 582 | void Integrator::constrainA(){ | |
582 | ||
583 | } | |
584 | ||
585 | < | void Integrator::constrainB( void ){ |
585 | > | template<typename T> void Integrator<T>::constrainB( void ){ |
586 | ||
587 | int i,j,k; | |
588 | int done; | |
# | Line 692 | Line 691 | void Integrator::constrainB( void ){ | |
691 | ||
692 | } | |
693 | ||
694 | < | void Integrator::rotate( int axes1, int axes2, double angle, double ji[3], |
694 | > | template<typename T> void Integrator<T>::rotate( int axes1, int axes2, double angle, double ji[3], |
695 | double A[3][3] ){ | |
696 | ||
697 | int i,j,k; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |