ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/primitives/DirectionalAtom.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/primitives/DirectionalAtom.cpp (file contents):
Revision 1930 by gezelter, Wed Jan 12 22:41:40 2005 UTC vs.
Revision 1957 by tim, Tue Jan 25 17:45:23 2005 UTC

# Line 40 | Line 40
40   */
41  
42   #include "primitives/DirectionalAtom.hpp"
43 <
43 > #include "utils/simError.h"
44   namespace oopse {
45  
46   DirectionalAtom::DirectionalAtom(DirectionalAtomType* dAtomType)
# Line 49 | Line 49 | DirectionalAtom::DirectionalAtom(DirectionalAtomType*
49      if (dAtomType->isMultipole()) {
50          electroBodyFrame_ = dAtomType->getElectroBodyFrame();
51      }
52 +
53 +    //check if one of the diagonal inertia tensor of this directional atom  is zero
54 +    int nLinearAxis = 0;
55 +    Mat3x3d inertiaTensor = getI();
56 +    for (int i = 0; i < 3; i++) {    
57 +        if (fabs(inertiaTensor(i, i)) < oopse::epsilon) {
58 +            linear_ = true;
59 +            linearAxis_ = i;
60 +            ++ nLinearAxis;
61 +        }
62 +    }
63 +
64 +    if (nLinearAxis > 1) {
65 +        sprintf( painCave.errMsg,
66 +            "Directional Atom error.\n"
67 +            "\tOOPSE found more than one axis in this directional atom with a vanishing \n"
68 +            "\tmoment of inertia.");
69 +        painCave.isFatal = 1;
70 +        simError();
71 +    }
72 +      
73   }
74  
75   Mat3x3d DirectionalAtom::getI() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines