# | Line 101 | Line 101 | namespace oopse { | |
---|---|---|
101 | //error | |
102 | std::cerr << "size does not match"<< std::endl; | |
103 | } | |
104 | < | |
104 | > | if (storageLayout_ & dslParticlePot && particlePot.size() != size_) { |
105 | > | //error |
106 | > | std::cerr << "size does not match"<< std::endl; |
107 | > | } |
108 | > | |
109 | return size_; | |
110 | ||
111 | } | |
# | Line 140 | Line 144 | namespace oopse { | |
144 | internalResize(torque, newSize); | |
145 | } | |
146 | ||
147 | + | if (storageLayout_ & dslParticlePot) { |
148 | + | internalResize(particlePot, newSize); |
149 | + | } |
150 | + | |
151 | size_ = newSize; | |
152 | } | |
153 | ||
# | Line 175 | Line 183 | namespace oopse { | |
183 | if (storageLayout_ & dslTorque) { | |
184 | torque.reserve(size); | |
185 | } | |
186 | + | |
187 | + | if (storageLayout_ & dslParticlePot) { |
188 | + | particlePot.reserve(size); |
189 | + | } |
190 | ||
191 | } | |
192 | ||
# | Line 214 | Line 226 | namespace oopse { | |
226 | if (storageLayout_ & dslTorque) { | |
227 | internalCopy(torque, source, num, target); | |
228 | } | |
229 | + | |
230 | + | if (storageLayout_ & dslParticlePot) { |
231 | + | internalCopy(particlePot, source, num, target); |
232 | + | } |
233 | ||
234 | ||
235 | } | |
# | Line 227 | Line 243 | namespace oopse { | |
243 | resize(size_); | |
244 | } | |
245 | ||
246 | < | double* DataStorage::getArrayPointer(int whichArray) { |
246 | > | RealType* DataStorage::getArrayPointer(int whichArray) { |
247 | ||
248 | switch (whichArray) { | |
249 | case dslPosition: | |
# | Line 260 | Line 276 | namespace oopse { | |
276 | ||
277 | case dslTorque: | |
278 | return internalGetArrayPointer(torque); | |
279 | < | break; |
279 | > | break; |
280 | > | |
281 | > | case dslParticlePot: |
282 | > | return internalGetArrayPointer(particlePot); |
283 | > | break; |
284 | ||
285 | default: | |
286 | //error message | |
# | Line 269 | Line 289 | namespace oopse { | |
289 | } | |
290 | } | |
291 | ||
292 | < | double* DataStorage::internalGetArrayPointer(std::vector<Vector3d>& v) { |
292 | > | RealType* DataStorage::internalGetArrayPointer(std::vector<Vector3d>& v) { |
293 | if (v.size() == 0) { | |
294 | return NULL; | |
295 | } else { | |
# | Line 277 | Line 297 | namespace oopse { | |
297 | } | |
298 | } | |
299 | ||
300 | < | double* DataStorage::internalGetArrayPointer(std::vector<RotMat3x3d>& v) { |
300 | > | RealType* DataStorage::internalGetArrayPointer(std::vector<RotMat3x3d>& v) { |
301 | if (v.size() == 0) { | |
302 | return NULL; | |
303 | } else { | |
# | Line 286 | Line 306 | namespace oopse { | |
306 | ||
307 | } | |
308 | ||
309 | < | double* DataStorage::internalGetArrayPointer(std::vector<double>& v) { |
309 | > | RealType* DataStorage::internalGetArrayPointer(std::vector<RealType>& v) { |
310 | if (v.size() == 0) { | |
311 | return NULL; | |
312 | } else { | |
# | Line 338 | Line 358 | namespace oopse { | |
358 | bytes += sizeof(Vector3d); | |
359 | } | |
360 | if (layout & dslAmat) { | |
361 | < | bytes += sizeof(Mat3x3d); |
361 | > | bytes += sizeof(RotMat3x3d); |
362 | } | |
363 | if (layout & dslAngularMomentum) { | |
364 | bytes += sizeof(Vector3d); | |
# | Line 347 | Line 367 | namespace oopse { | |
367 | bytes += sizeof(Mat3x3d); | |
368 | } | |
369 | if (layout & dslZAngle) { | |
370 | < | bytes += sizeof(Vector3d); |
370 | > | bytes += sizeof(RealType); |
371 | } | |
372 | if (layout & dslForce) { | |
373 | bytes += sizeof(Vector3d); | |
# | Line 355 | Line 375 | namespace oopse { | |
375 | if (layout & dslTorque) { | |
376 | bytes += sizeof(Vector3d); | |
377 | } | |
378 | + | if (layout & dslParticlePot) { |
379 | + | bytes += sizeof(RealType); |
380 | + | } |
381 | return bytes; | |
382 | } | |
383 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |