| 1 | 
mmeineke | 
10 | 
#ifndef _INTEGRATOR_H_ | 
| 2 | 
  | 
  | 
#define _INTEGRATOR_H_ | 
| 3 | 
  | 
  | 
 | 
| 4 | 
  | 
  | 
#include "Atom.hpp" | 
| 5 | 
  | 
  | 
#include "LRI.hpp" | 
| 6 | 
  | 
  | 
#include "SRI.hpp" | 
| 7 | 
  | 
  | 
#include "AbstractClasses.hpp" | 
| 8 | 
  | 
  | 
#include "SimInfo.hpp" | 
| 9 | 
  | 
  | 
 | 
| 10 | 
  | 
  | 
class Verlet : public Integrator { | 
| 11 | 
  | 
  | 
 | 
| 12 | 
  | 
  | 
public: | 
| 13 | 
  | 
  | 
  Verlet( SimInfo &info ); | 
| 14 | 
  | 
  | 
  ~Verlet(); | 
| 15 | 
  | 
  | 
  void integrate( void ); | 
| 16 | 
  | 
  | 
  void integrate_b( double time_length, double dt,  | 
| 17 | 
  | 
  | 
                    int n_bond_0, int n_bond_f, | 
| 18 | 
  | 
  | 
                    int n_bend_0, int n_bend_f, | 
| 19 | 
  | 
  | 
                    int n_torsion_0, int n_trosion_f, | 
| 20 | 
  | 
  | 
                    bool do_bonds, bool do_bends, bool do_torsions, | 
| 21 | 
  | 
  | 
                    bool do_LRI ); | 
| 22 | 
  | 
  | 
 | 
| 23 | 
  | 
  | 
private: | 
| 24 | 
  | 
  | 
   | 
| 25 | 
  | 
  | 
  void move_a( double dt ); | 
| 26 | 
  | 
  | 
  void move_b( double dt ); | 
| 27 | 
  | 
  | 
 | 
| 28 | 
  | 
  | 
  SimInfo *entry_plug; // all the info we'll ever need | 
| 29 | 
  | 
  | 
  int c_natoms;  /* the number of atoms */ | 
| 30 | 
  | 
  | 
  Atom **c_atoms; /* array of atom pointers */ | 
| 31 | 
  | 
  | 
  SRI **c_sr_interactions; /* array of SRI pointers */ | 
| 32 | 
  | 
  | 
  LRI *longRange; /* the long ranghe forces */ | 
| 33 | 
  | 
  | 
  int c_n_SRI; /* the number of short range interactions */ | 
| 34 | 
  | 
  | 
 | 
| 35 | 
  | 
  | 
  int c_is_constrained; /*boolean to know whether the systems contains | 
| 36 | 
  | 
  | 
                          constraints. */ | 
| 37 | 
  | 
  | 
  int c_n_constrained; /*counter for number of constraints */ | 
| 38 | 
  | 
  | 
  int *c_constrained_i; /* the i of a constraint pair */ | 
| 39 | 
  | 
  | 
  int *c_constrained_j; /* the j of a constraint pair */ | 
| 40 | 
  | 
  | 
  double *c_constrained_dsqr; /* the square of the constraint distance */ | 
| 41 | 
  | 
  | 
  double *c_mass; /* the array of masses */ | 
| 42 | 
  | 
  | 
  short is_first; /*boolean for the first time integrate is called */ | 
| 43 | 
  | 
  | 
  double c_box_x; | 
| 44 | 
  | 
  | 
  double c_box_y; | 
| 45 | 
  | 
  | 
  double c_box_z; | 
| 46 | 
  | 
  | 
}; | 
| 47 | 
  | 
  | 
 | 
| 48 | 
  | 
  | 
class Symplectic : public Integrator { | 
| 49 | 
  | 
  | 
   | 
| 50 | 
  | 
  | 
public: | 
| 51 | 
  | 
  | 
  Symplectic( SimInfo* the_entry_plug ); | 
| 52 | 
  | 
  | 
  ~Symplectic(); | 
| 53 | 
  | 
  | 
   | 
| 54 | 
  | 
  | 
  void integrate( void ); | 
| 55 | 
  | 
  | 
 | 
| 56 | 
  | 
  | 
private: | 
| 57 | 
  | 
  | 
 | 
| 58 | 
  | 
  | 
  void rotate( int axes1, int axes2, double angle, double j[3],  | 
| 59 | 
  | 
  | 
               double A[3][3] ); | 
| 60 | 
  | 
  | 
 | 
| 61 | 
  | 
  | 
  SimInfo* entry_plug; | 
| 62 | 
  | 
  | 
 | 
| 63 | 
  | 
  | 
 | 
| 64 | 
  | 
  | 
  int is_constrained; /*boolean to know whether the systems contains | 
| 65 | 
  | 
  | 
                          constraints. */ | 
| 66 | 
  | 
  | 
  int n_constrained; /*counter for number of constraints */ | 
| 67 | 
  | 
  | 
  int *constrained_i; /* the i of a constraint pair */ | 
| 68 | 
  | 
  | 
  int *constrained_j; /* the j of a constraint pair */ | 
| 69 | 
  | 
  | 
  double *constrained_dsqr; /* the square of the constraint distance */ | 
| 70 | 
  | 
  | 
  double *mass; /* the array of masses */ | 
| 71 | 
  | 
  | 
 | 
| 72 | 
  | 
  | 
  short int isFirst; | 
| 73 | 
  | 
  | 
  SRI **srInteractions; /* array of SRI pointers */ | 
| 74 | 
  | 
  | 
  LRI *longRange; /* the long range forces */ | 
| 75 | 
  | 
  | 
  int nSRI; /* the number of short range interactions */ | 
| 76 | 
  | 
  | 
   | 
| 77 | 
  | 
  | 
}; | 
| 78 | 
  | 
  | 
 | 
| 79 | 
  | 
  | 
#endif |