# | Line 1 | Line 1 | |
---|---|---|
1 | #include <math.h> | |
2 | ||
3 | < | #include "Atom.hpp" |
4 | < | #include "DirectionalAtom.hpp" |
5 | < | #include "simError.h" |
6 | < | #include "MatVec3.h" |
3 | > | #include "primitives/Atom.hpp" |
4 | > | #include "primitives/DirectionalAtom.hpp" |
5 | > | #include "utils/simError.h" |
6 | > | #include "math/MatVec3.h" |
7 | ||
8 | void DirectionalAtom::zeroForces() { | |
9 | if( hasCoords ){ | |
# | Line 69 | Line 69 | void DirectionalAtom::setI( double the_I[3][3] ){ | |
69 | } | |
70 | ||
71 | void DirectionalAtom::setI( double the_I[3][3] ){ | |
72 | + | |
73 | + | int n_linear_coords, i, j; |
74 | ||
75 | Ixx = the_I[0][0]; Ixy = the_I[0][1]; Ixz = the_I[0][2]; | |
76 | Iyx = the_I[1][0]; Iyy = the_I[1][1]; Iyz = the_I[1][2]; | |
77 | Izx = the_I[2][0]; Izy = the_I[2][1]; Izz = the_I[2][2]; | |
78 | + | |
79 | + | n_linear_coords = 0; |
80 | + | |
81 | + | for (i = 0; i<3; i++) { |
82 | + | if (fabs(the_I[i][i]) < momIntTol) { |
83 | + | is_linear = true; |
84 | + | n_linear_coords++; |
85 | + | linear_axis = i; |
86 | + | } |
87 | + | } |
88 | + | |
89 | + | if (n_linear_coords > 1) { |
90 | + | sprintf( painCave.errMsg, |
91 | + | "DirectionalAtom error.\n" |
92 | + | "\tOOPSE was told to set more than one axis in this\n" |
93 | + | "\tDirectionalAtom to a vanishing moment of inertia.\n" |
94 | + | "\tThis should not be a DirectionalAtom. Use an Atom.\n" |
95 | + | ); |
96 | + | painCave.isFatal = 1; |
97 | + | simError(); |
98 | + | } |
99 | + | |
100 | + | |
101 | } | |
102 | ||
103 | void DirectionalAtom::setQ( double the_q[4] ){ |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |