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 296 by mmeineke, Thu Mar 6 20:05:39 2003 UTC vs.
Revision 299 by mmeineke, Fri Mar 7 19:31:02 2003 UTC

# Line 2 | Line 2
2   #define _ATOM_H_
3  
4   #include <cstring>
5 + #include <cstdlib>
6   #include <iostream>
7  
8   class Atom{
# Line 11 | Line 12 | class Atom{ (public)
12      has_dipole = 0;
13      is_VDW = 0;
14      is_LJ = 0;
15 +    pos = NULL;
16 +
17      index = theIndex;
18      offset = 3 * index;
19      offsetX = offset;
# Line 32 | Line 35 | class Atom{ (public)
35    virtual ~Atom() {}
36  
37    static void createArrays (int nElements) {
38 +    
39 +    if( pos != NULL ) destroyArrays();
40 +    
41      pos = new double[nElements*3];
42      vel = new double[nElements*3];
43      frc = new double[nElements*3];
# Line 46 | Line 52 | class Atom{ (public)
52      trq[offsetY] = 0.0;
53      trq[offsetZ] = 0.0;
54      
55 <    Amat[Axx] = 0.0;
55 >    Amat[Axx] = 1.0;
56      Amat[Axy] = 0.0;
57      Amat[Axz] = 0.0;
58      
59      Amat[Ayx] = 0.0;
60 <    Amat[Ayy] = 0.0;
60 >    Amat[Ayy] = 1.0;
61      Amat[Ayz] = 0.0;
62  
63      Amat[Azx] = 0.0;
64      Amat[Azy] = 0.0;
65 <    Amat[Azz] = 0.0;
65 >    Amat[Azz] = 1.0;
66  
67      mu[index] = 0.0;    
68  
# Line 209 | Line 215 | class GeneralAtom : public Atom{ (public)
215  
216    int isDirectional( void ){ return 0; }
217    void zeroForces() {
218 <    frc[offsetX]   = 0.0;
218 >    frc[offsetX] = 0.0;
219      frc[offsetY] = 0.0;
220      frc[offsetZ] = 0.0;
221    }
# Line 221 | Line 227 | class DirectionalAtom : public Atom { (public)
227    DirectionalAtom(int theIndex) : Atom(theIndex)
228    {
229      ssdIdentity = 0;
230 <
230 >    sux = 0.0;
231 >    suy = 0.0;
232 >    suz = 0.0;
233    }
234    virtual ~DirectionalAtom() {}
235  
# Line 251 | Line 259 | class DirectionalAtom : public Atom { (public)
259    void addTz( double the_tz ) { trq[offsetZ] += the_tz;}
260  
261    void zeroForces() {
262 <    frc[offsetX]   = 0.0;
262 >    frc[offsetX] = 0.0;
263      frc[offsetY] = 0.0;
264      frc[offsetZ] = 0.0;
265  
266 <    trq[offsetX]   = 0.0;
266 >    trq[offsetX] = 0.0;
267      trq[offsetY] = 0.0;
268      trq[offsetZ] = 0.0;
269    }
# Line 306 | Line 314 | class DirectionalAtom : public Atom { (public)
314  
315    void lab2Body( double r[3] );
316    void body2Lab( double r[3] );
317 +  void updateU( void );
318  
319   private:
320    int dIndex;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines