| 1 | 
< | 
#ifndef _ABSTRACT_CLASSES_H_ | 
| 2 | 
< | 
#define _ABSTRACT_CLASSES_H_ | 
| 3 | 
< | 
 | 
| 4 | 
< | 
#include <string> | 
| 5 | 
< | 
#include "Atom.hpp" | 
| 6 | 
< | 
#ifdef IS_MPI | 
| 7 | 
< | 
 | 
| 8 | 
< | 
#include "mpi.h" | 
| 9 | 
< | 
#endif | 
| 10 | 
< | 
 | 
| 11 | 
< | 
using namespace std; | 
| 12 | 
< | 
 | 
| 13 | 
< | 
class Constraint{ | 
| 14 | 
< | 
 | 
| 15 | 
< | 
public: | 
| 16 | 
< | 
  Constraint(){} | 
| 17 | 
< | 
  ~Constraint(){} | 
| 18 | 
< | 
 | 
| 19 | 
< | 
  int    get_a()             {return a;} | 
| 20 | 
< | 
  void   set_a(int index)    {a = index;} | 
| 21 | 
< | 
  int    get_b()             {return b;} | 
| 22 | 
< | 
  void   set_b(int index)    {b = index;} | 
| 23 | 
< | 
  double get_dsqr()          {return dsqr;} | 
| 24 | 
< | 
  void   set_dsqr(double ds) {dsqr = ds;} | 
| 25 | 
< | 
 | 
| 26 | 
< | 
private: | 
| 27 | 
< | 
  int a; /* index of constrained atom a */ | 
| 28 | 
< | 
  int b; /* index of constrained atom b */ | 
| 29 | 
< | 
  double dsqr; /* the square of the constraint distance */ | 
| 30 | 
< | 
}; | 
| 31 | 
< | 
 | 
| 32 | 
< | 
class SRI{ | 
| 33 | 
< | 
 | 
| 34 | 
< | 
public: | 
| 35 | 
< | 
  SRI(){ c_potential_E = 0.0; } | 
| 36 | 
< | 
  virtual ~SRI() {} | 
| 37 | 
< | 
 | 
| 38 | 
< | 
  virtual void calc_forces() = 0; | 
| 39 | 
< | 
 | 
| 40 | 
< | 
  double get_potential(){ return c_potential_E; } | 
| 41 | 
< | 
  virtual int is_constrained() = 0; | 
| 42 | 
< | 
  virtual Constraint *get_constraint() = 0; | 
| 43 | 
< | 
  virtual void constrain(double bond_distance) = 0; | 
| 44 | 
< | 
 | 
| 45 | 
< | 
  virtual void printMe( void ) = 0; | 
| 46 | 
< | 
 | 
| 47 | 
< | 
protected: | 
| 48 | 
< | 
  double c_potential_E; | 
| 49 | 
< | 
}; | 
| 50 | 
< | 
 | 
| 51 | 
< | 
 | 
| 52 | 
< | 
class BaseIntegrator{ | 
| 53 | 
< | 
 | 
| 54 | 
< | 
public: | 
| 55 | 
< | 
  BaseIntegrator(){} | 
| 56 | 
< | 
  virtual ~BaseIntegrator(){} | 
| 57 | 
< | 
 | 
| 58 | 
< | 
  virtual void integrate( void ) = 0; | 
| 59 | 
< | 
  virtual double  getConservedQuantity(void) = 0; | 
| 60 | 
< | 
  virtual string getAdditionalParameters(void) = 0; | 
| 61 | 
< | 
}; | 
| 62 | 
< | 
#endif | 
| 1 | 
> | 
#ifndef _ABSTRACT_CLASSES_H_ | 
| 2 | 
> | 
#define _ABSTRACT_CLASSES_H_ | 
| 3 | 
> | 
 | 
| 4 | 
> | 
#include <string> | 
| 5 | 
> | 
#include "Atom.hpp" | 
| 6 | 
> | 
#ifdef IS_MPI | 
| 7 | 
> | 
 | 
| 8 | 
> | 
#include "mpi.h" | 
| 9 | 
> | 
#endif | 
| 10 | 
> | 
 | 
| 11 | 
> | 
using namespace std; | 
| 12 | 
> | 
 | 
| 13 | 
> | 
class Constraint{ | 
| 14 | 
> | 
  public: | 
| 15 | 
> | 
    Constraint(){ | 
| 16 | 
> | 
    } | 
| 17 | 
> | 
    ~Constraint(){ | 
| 18 | 
> | 
    } | 
| 19 | 
> | 
 | 
| 20 | 
> | 
    int get_a(){ | 
| 21 | 
> | 
      return a; | 
| 22 | 
> | 
    } | 
| 23 | 
> | 
    void set_a(int index){ | 
| 24 | 
> | 
      a = index; | 
| 25 | 
> | 
    } | 
| 26 | 
> | 
    int get_b(){ | 
| 27 | 
> | 
      return b; | 
| 28 | 
> | 
    } | 
| 29 | 
> | 
    void set_b(int index){ | 
| 30 | 
> | 
      b = index; | 
| 31 | 
> | 
    } | 
| 32 | 
> | 
    double get_dsqr(){ | 
| 33 | 
> | 
      return dsqr; | 
| 34 | 
> | 
    } | 
| 35 | 
> | 
    void set_dsqr(double ds){ | 
| 36 | 
> | 
      dsqr = ds; | 
| 37 | 
> | 
    } | 
| 38 | 
> | 
 | 
| 39 | 
> | 
  private: | 
| 40 | 
> | 
    int a; /* index of constrained atom a */ | 
| 41 | 
> | 
    int b; /* index of constrained atom b */ | 
| 42 | 
> | 
    double dsqr; /* the square of the constraint distance */ | 
| 43 | 
> | 
}; | 
| 44 | 
> | 
 | 
| 45 | 
> | 
class SRI{ | 
| 46 | 
> | 
  public: | 
| 47 | 
> | 
    SRI(){ | 
| 48 | 
> | 
      c_potential_E = 0.0; | 
| 49 | 
> | 
    } | 
| 50 | 
> | 
    virtual ~SRI(){ | 
| 51 | 
> | 
    } | 
| 52 | 
> | 
 | 
| 53 | 
> | 
    virtual void calc_forces() = 0; | 
| 54 | 
> | 
 | 
| 55 | 
> | 
    double get_potential(){ | 
| 56 | 
> | 
      return c_potential_E; | 
| 57 | 
> | 
    } | 
| 58 | 
> | 
    virtual int is_constrained() = 0; | 
| 59 | 
> | 
    virtual Constraint* get_constraint() = 0; | 
| 60 | 
> | 
    virtual void constrain(double bond_distance) = 0; | 
| 61 | 
> | 
 | 
| 62 | 
> | 
    virtual void printMe(void) = 0; | 
| 63 | 
> | 
 | 
| 64 | 
> | 
  protected: | 
| 65 | 
> | 
    double c_potential_E; | 
| 66 | 
> | 
}; | 
| 67 | 
> | 
 | 
| 68 | 
> | 
 | 
| 69 | 
> | 
class BaseIntegrator{ | 
| 70 | 
> | 
  public: | 
| 71 | 
> | 
    BaseIntegrator(){ | 
| 72 | 
> | 
    } | 
| 73 | 
> | 
    virtual ~BaseIntegrator(){ | 
| 74 | 
> | 
    } | 
| 75 | 
> | 
 | 
| 76 | 
> | 
    virtual void integrate(void) = 0; | 
| 77 | 
> | 
    virtual double getConservedQuantity(void) = 0; | 
| 78 | 
> | 
    virtual string getAdditionalParameters(void) = 0; | 
| 79 | 
> | 
}; | 
| 80 | 
> | 
#endif |