2 |
|
#include <stdlib.h> |
3 |
|
#include <math.h> |
4 |
|
#ifdef IS_MPI |
5 |
< |
#include "mpiSimulation.hpp" |
5 |
> |
#include "brains/mpiSimulation.hpp" |
6 |
|
#include <unistd.h> |
7 |
|
#endif //is_mpi |
8 |
|
|
9 |
|
#ifdef PROFILE |
10 |
< |
#include "mdProfile.hpp" |
10 |
> |
#include "profiling/mdProfile.hpp" |
11 |
|
#endif // profile |
12 |
|
|
13 |
< |
#include "Integrator.hpp" |
14 |
< |
#include "simError.h" |
13 |
> |
#include "integrators/Integrator.hpp" |
14 |
> |
#include "utils/simError.h" |
15 |
|
|
16 |
|
|
17 |
|
template<typename T> Integrator<T>::Integrator(SimInfo* theInfo, |
363 |
|
integrableObjects[i]->getVel(vel); |
364 |
|
integrableObjects[i]->getPos(pos); |
365 |
|
integrableObjects[i]->getFrc(frc); |
366 |
+ |
// std::cerr << "f = " << frc[0] << "\t" << frc[1] << "\t" << frc[2] << "\n"; |
367 |
|
|
368 |
|
mass = integrableObjects[i]->getMass(); |
369 |
|
|
377 |
|
integrableObjects[i]->setVel(vel); |
378 |
|
integrableObjects[i]->setPos(pos); |
379 |
|
|
380 |
+ |
|
381 |
|
if (integrableObjects[i]->isDirectional()){ |
382 |
|
|
383 |
|
// get and convert the torque to body frame |
384 |
|
|
385 |
|
integrableObjects[i]->getTrq(Tb); |
386 |
+ |
|
387 |
+ |
// std::cerr << "t = " << Tb[0] << "\t" << Tb[1] << "\t" << Tb[2] << "\n"; |
388 |
|
integrableObjects[i]->lab2Body(Tb); |
389 |
|
|
390 |
|
// get the angular momentum, and propagate a half step |
720 |
|
sd->getI(I); |
721 |
|
|
722 |
|
if (sd->isLinear()) { |
723 |
+ |
|
724 |
|
i = sd->linearAxis(); |
725 |
|
j = (i+1)%3; |
726 |
|
k = (i+2)%3; |
727 |
< |
|
727 |
> |
|
728 |
|
angle = dt2 * ji[j] / I[j][j]; |
729 |
|
this->rotate( k, i, angle, ji, A ); |
730 |
|
|