| 111 |
|
|
| 112 |
|
void SphereHarm::printShapesFileStart(char name[200], char particle[80], |
| 113 |
|
double mass, double momInert[3][3]){ |
| 114 |
< |
ofstream shapes(name); |
| 114 |
> |
ofstream myShapes(name); |
| 115 |
> |
printShapesStreamStart(myShapes, particle, mass, momInert); |
| 116 |
> |
} |
| 117 |
> |
|
| 118 |
> |
void SphereHarm::printShapesStreamStart(ostream& shapes, char particle[80], |
| 119 |
> |
double mass, double momInert[3][3]){ |
| 120 |
|
shapes << "begin ShapeInfo\n"; |
| 121 |
|
shapes << "#name\t\tmass\tI_xx\tI_yy\tI_zz\n"; |
| 122 |
|
shapes << particle << "\t" << mass << "\t" << momInert[0][0] << "\t" |
| 124 |
|
shapes << "end ShapeInfo\n"; |
| 125 |
|
} |
| 126 |
|
|
| 127 |
< |
void SphereHarm::printToShapesFile(char name[200], int index){ |
| 127 |
> |
|
| 128 |
> |
|
| 129 |
> |
void SphereHarm::printToShapesFile(char name[200], int index, double tolVal){ |
| 130 |
|
ofstream shapes(name, ios::app); |
| 131 |
+ |
|
| 132 |
+ |
printToShapesStream(shapes, index, tolVal); |
| 133 |
+ |
} |
| 134 |
+ |
|
| 135 |
+ |
void SphereHarm::printToShapesStream(ostream& shapes, int index, double tolVal) { |
| 136 |
|
|
| 137 |
|
biggest = 0.0; |
| 138 |
|
nfuncs = 0; |
| 170 |
|
- icoeffs[dummy2]); |
| 171 |
|
} |
| 172 |
|
|
| 173 |
< |
if (fabs(cm) > 0.01 * biggest) nfuncs++; |
| 174 |
< |
if (fabs(sm) > 0.01 * biggest) nfuncs++; |
| 173 |
> |
if (fabs(cm) > tolVal * biggest) nfuncs++; |
| 174 |
> |
if (fabs(sm) > tolVal * biggest) nfuncs++; |
| 175 |
|
} |
| 176 |
|
} |
| 177 |
|
|
| 205 |
|
- icoeffs[dummy2]); |
| 206 |
|
} |
| 207 |
|
|
| 208 |
< |
if (fabs(cm) > 0.01 * biggest) |
| 208 |
> |
if (fabs(cm) > tolVal * biggest) |
| 209 |
|
shapes << l << "\t" << m << "\tcos\t\t" << cm << "\n"; |
| 210 |
< |
if (fabs(sm) > 0.01 * biggest) |
| 210 |
> |
if (fabs(sm) > tolVal * biggest) |
| 211 |
|
shapes << l << "\t" << m << "\tsin\t\t" << sm << "\n"; |
| 212 |
|
} |
| 213 |
|
} |