ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE_old/src/mdtools/libmdCode/Atom.hpp
(Generate patch)

Comparing trunk/OOPSE_old/src/mdtools/libmdCode/Atom.hpp (file contents):
Revision 299 by mmeineke, Fri Mar 7 19:31:02 2003 UTC vs.
Revision 370 by mmeineke, Thu Mar 20 17:10:43 2003 UTC

# Line 12 | Line 12 | class Atom{ (public)
12      has_dipole = 0;
13      is_VDW = 0;
14      is_LJ = 0;
15    pos = NULL;
15  
16      index = theIndex;
17      offset = 3 * index;
# Line 35 | Line 34 | class Atom{ (public)
34    virtual ~Atom() {}
35  
36    static void createArrays (int nElements) {
37 +    int i;
38      
39    if( pos != NULL ) destroyArrays();
40    
39      pos = new double[nElements*3];
40      vel = new double[nElements*3];
41      frc = new double[nElements*3];
42      trq = new double[nElements*3];
43      Amat = new double[nElements*9];
44      mu = new double[nElements];
45 <    ul = new double[nElements];
45 >    ul = new double[nElements*3];
46  
47      // init directional values to zero
48      
49 <    trq[offsetX] = 0.0;
50 <    trq[offsetY] = 0.0;
51 <    trq[offsetZ] = 0.0;
52 <    
53 <    Amat[Axx] = 1.0;
54 <    Amat[Axy] = 0.0;
55 <    Amat[Axz] = 0.0;
56 <    
57 <    Amat[Ayx] = 0.0;
58 <    Amat[Ayy] = 1.0;
59 <    Amat[Ayz] = 0.0;
60 <
61 <    Amat[Azx] = 0.0;
62 <    Amat[Azy] = 0.0;
63 <    Amat[Azz] = 1.0;
64 <
65 <    mu[index] = 0.0;    
66 <
67 <    ul[offsetX] = 0.0;
68 <    ul[offsetY] = 0.0;
69 <    ul[offsetZ] = 0.0;
49 >    for( i=0; i<nElements; i++){
50 >      trq[i] = 0.0;
51 >      trq[i+1] = 0.0;
52 >      trq[i+2] = 0.0;
53 >      
54 >      Amat[i] = 1.0;
55 >      Amat[i+1] = 0.0;
56 >      Amat[i+2] = 0.0;
57 >      
58 >      Amat[i+3] = 0.0;
59 >      Amat[i+4] = 1.0;
60 >      Amat[i+5] = 0.0;
61 >      
62 >      Amat[i+6] = 0.0;
63 >      Amat[i+7] = 0.0;
64 >      Amat[i+8] = 1.0;
65 >      
66 >      mu[i] = 0.0;    
67 >      
68 >      ul[i] = 0.0;
69 >      ul[i+1] = 0.0;
70 >      ul[i+2] = 0.0;
71 >    }
72    }
73    static void destroyArrays(void) {
74      delete[] pos;
# Line 97 | Line 97 | class Atom{ (public)
97    double get_vx() const  {return vel[offsetX];}
98    double get_vy() const  {return vel[offsetY];}
99    double get_vz() const  {return vel[offsetZ];}
100 <  void set_vx(double vx) {vel[offsetX]   = vx;}
100 >  void set_vx(double vx) {vel[offsetX] = vx;}
101    void set_vy(double vy) {vel[offsetY] = vy;}
102    void set_vz(double vz) {vel[offsetZ] = vz;}
103    
104    double getFx() const   {return frc[offsetX];}
105    double getFy() const   {return frc[offsetY];}
106    double getFz() const   {return frc[offsetZ];}
107 <  void addFx(double add) {frc[offsetX]   += add;}
107 >  void addFx(double add) {frc[offsetX] += add;}
108    void addFy(double add) {frc[offsetY] += add;}
109    void addFz(double add) {frc[offsetZ] += add;}
110    virtual void zeroForces() = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines