ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/SHAPES/SphereHarm.cpp
(Generate patch)

Comparing trunk/SHAPES/SphereHarm.cpp (file contents):
Revision 1309 by chrisfen, Fri Jun 25 20:10:53 2004 UTC vs.
Revision 1360 by gezelter, Tue Jul 20 20:02:15 2004 UTC

# Line 111 | Line 111 | void SphereHarm::printShapesFileStart(char name[200],
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"
# Line 119 | Line 124 | void SphereHarm::printToShapesFile(char name[200], int
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;
# Line 158 | Line 170 | void SphereHarm::printToShapesFile(char name[200], int
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      
# Line 193 | Line 205 | void SphereHarm::printToShapesFile(char name[200], int
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    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines