73 |
|
cerr << "size does not match"<< endl; |
74 |
|
} |
75 |
|
|
76 |
+ |
if (storageLayout_ & dslForce && force.size() != size_) { |
77 |
+ |
//error |
78 |
+ |
cerr << "size does not match"<< endl; |
79 |
+ |
} |
80 |
+ |
|
81 |
|
if (storageLayout_ & dslAmat && aMat.size() != size_) { |
82 |
|
//error |
83 |
|
cerr << "size does not match"<< endl; |
88 |
|
cerr << "size does not match"<< endl; |
89 |
|
} |
90 |
|
|
91 |
< |
if (storageLayout_ & dslElectroFrame && electroFrame.size() != size_) { |
91 |
> |
if (storageLayout_ & dslTorque && torque.size() != size_) { |
92 |
|
//error |
93 |
|
cerr << "size does not match"<< endl; |
94 |
|
} |
95 |
|
|
96 |
< |
if (storageLayout_ & dslForce && force.size() != size_) { |
96 |
> |
if (storageLayout_ & dslParticlePot && particlePot.size() != size_) { |
97 |
|
//error |
98 |
|
cerr << "size does not match"<< endl; |
99 |
|
} |
100 |
|
|
101 |
< |
if (storageLayout_ & dslTorque && torque.size() != size_) { |
101 |
> |
if (storageLayout_ & dslDensity && density.size() != size_) { |
102 |
|
//error |
103 |
|
cerr << "size does not match"<< endl; |
104 |
|
} |
105 |
|
|
106 |
< |
if (storageLayout_ & dslParticlePot && particlePot.size() != size_) { |
106 |
> |
if (storageLayout_ & dslFunctional && functional.size() != size_) { |
107 |
|
//error |
108 |
|
cerr << "size does not match"<< endl; |
109 |
|
} |
110 |
|
|
111 |
< |
if (storageLayout_ & dslDensity && density.size() != size_) { |
111 |
> |
if (storageLayout_ & dslFunctionalDerivative && functionalDerivative.size() != size_) { |
112 |
|
//error |
113 |
|
cerr << "size does not match"<< endl; |
114 |
|
} |
115 |
|
|
116 |
< |
if (storageLayout_ & dslFunctional && functional.size() != size_) { |
116 |
> |
if (storageLayout_ & dslDipole && dipole.size() != size_) { |
117 |
|
//error |
118 |
|
cerr << "size does not match"<< endl; |
119 |
|
} |
120 |
|
|
121 |
< |
if (storageLayout_ & dslFunctionalDerivative && functionalDerivative.size() != size_) { |
121 |
> |
if (storageLayout_ & dslQuadrupole && quadrupole.size() != size_) { |
122 |
|
//error |
123 |
|
cerr << "size does not match"<< endl; |
124 |
|
} |
162 |
|
internalResize(velocity, newSize); |
163 |
|
} |
164 |
|
|
165 |
+ |
if (storageLayout_ & dslForce) { |
166 |
+ |
internalResize(force, newSize); |
167 |
+ |
} |
168 |
+ |
|
169 |
|
if (storageLayout_ & dslAmat) { |
170 |
|
internalResize(aMat, newSize); |
171 |
|
} |
173 |
|
if (storageLayout_ & dslAngularMomentum) { |
174 |
|
internalResize(angularMomentum, newSize); |
175 |
|
} |
167 |
– |
|
168 |
– |
if (storageLayout_ & dslElectroFrame) { |
169 |
– |
internalResize(electroFrame, newSize); |
170 |
– |
} |
176 |
|
|
172 |
– |
if (storageLayout_ & dslForce) { |
173 |
– |
internalResize(force, newSize); |
174 |
– |
} |
175 |
– |
|
177 |
|
if (storageLayout_ & dslTorque) { |
178 |
|
internalResize(torque, newSize); |
179 |
|
} |
194 |
|
internalResize(functionalDerivative, newSize); |
195 |
|
} |
196 |
|
|
197 |
+ |
if (storageLayout_ & dslDipole) { |
198 |
+ |
internalResize(dipole, newSize); |
199 |
+ |
} |
200 |
+ |
|
201 |
+ |
if (storageLayout_ & dslQuadrupole) { |
202 |
+ |
internalResize(quadrupole, newSize); |
203 |
+ |
} |
204 |
+ |
|
205 |
|
if (storageLayout_ & dslElectricField) { |
206 |
|
internalResize(electricField, newSize); |
207 |
|
} |
234 |
|
velocity.reserve(size); |
235 |
|
} |
236 |
|
|
237 |
+ |
if (storageLayout_ & dslForce) { |
238 |
+ |
force.reserve(size); |
239 |
+ |
} |
240 |
+ |
|
241 |
|
if (storageLayout_ & dslAmat) { |
242 |
|
aMat.reserve(size); |
243 |
|
} |
246 |
|
angularMomentum.reserve(size); |
247 |
|
} |
248 |
|
|
236 |
– |
if (storageLayout_ & dslElectroFrame) { |
237 |
– |
electroFrame.reserve(size); |
238 |
– |
} |
239 |
– |
|
240 |
– |
if (storageLayout_ & dslForce) { |
241 |
– |
force.reserve(size); |
242 |
– |
} |
243 |
– |
|
249 |
|
if (storageLayout_ & dslTorque) { |
250 |
|
torque.reserve(size); |
251 |
|
} |
264 |
|
|
265 |
|
if (storageLayout_ & dslFunctionalDerivative) { |
266 |
|
functionalDerivative.reserve(size); |
267 |
+ |
} |
268 |
+ |
|
269 |
+ |
if (storageLayout_ & dslDipole) { |
270 |
+ |
dipole.reserve(size); |
271 |
+ |
} |
272 |
+ |
|
273 |
+ |
if (storageLayout_ & dslQuadrupole) { |
274 |
+ |
quadrupole.reserve(size); |
275 |
|
} |
276 |
|
|
277 |
|
if (storageLayout_ & dslElectricField) { |
308 |
|
internalCopy(velocity, source, num, target); |
309 |
|
} |
310 |
|
|
311 |
+ |
if (storageLayout_ & dslForce) { |
312 |
+ |
internalCopy(force, source, num, target); |
313 |
+ |
} |
314 |
+ |
|
315 |
|
if (storageLayout_ & dslAmat) { |
316 |
|
internalCopy(aMat, source, num, target); |
317 |
|
} |
320 |
|
internalCopy(angularMomentum, source, num, target); |
321 |
|
} |
322 |
|
|
306 |
– |
if (storageLayout_ & dslElectroFrame) { |
307 |
– |
internalCopy(electroFrame, source, num, target); |
308 |
– |
} |
309 |
– |
|
310 |
– |
if (storageLayout_ & dslForce) { |
311 |
– |
internalCopy(force, source, num, target); |
312 |
– |
} |
313 |
– |
|
323 |
|
if (storageLayout_ & dslTorque) { |
324 |
|
internalCopy(torque, source, num, target); |
325 |
|
} |
340 |
|
internalCopy(functionalDerivative, source, num, target); |
341 |
|
} |
342 |
|
|
343 |
+ |
if (storageLayout_ & dslDipole) { |
344 |
+ |
internalCopy(dipole, source, num, target); |
345 |
+ |
} |
346 |
+ |
|
347 |
+ |
if (storageLayout_ & dslQuadrupole) { |
348 |
+ |
internalCopy(quadrupole, source, num, target); |
349 |
+ |
} |
350 |
+ |
|
351 |
|
if (storageLayout_ & dslElectricField) { |
352 |
|
internalCopy(electricField, source, num, target); |
353 |
|
} |
388 |
|
return internalGetArrayPointer(velocity); |
389 |
|
break; |
390 |
|
|
391 |
+ |
case dslForce: |
392 |
+ |
return internalGetArrayPointer(force); |
393 |
+ |
break; |
394 |
+ |
|
395 |
|
case dslAmat: |
396 |
|
return internalGetArrayPointer(aMat); |
397 |
|
break; |
400 |
|
return internalGetArrayPointer(angularMomentum); |
401 |
|
break; |
402 |
|
|
382 |
– |
case dslElectroFrame: |
383 |
– |
return internalGetArrayPointer(electroFrame); |
384 |
– |
break; |
385 |
– |
|
386 |
– |
case dslForce: |
387 |
– |
return internalGetArrayPointer(force); |
388 |
– |
break; |
389 |
– |
|
403 |
|
case dslTorque: |
404 |
|
return internalGetArrayPointer(torque); |
405 |
|
break; |
420 |
|
return internalGetArrayPointer(functionalDerivative); |
421 |
|
break; |
422 |
|
|
423 |
+ |
case dslDipole: |
424 |
+ |
return internalGetArrayPointer(dipole); |
425 |
+ |
break; |
426 |
+ |
|
427 |
+ |
case dslQuadrupole: |
428 |
+ |
return internalGetArrayPointer(quadrupole); |
429 |
+ |
break; |
430 |
+ |
|
431 |
|
case dslElectricField: |
432 |
|
return internalGetArrayPointer(electricField); |
433 |
|
break; |
463 |
|
} |
464 |
|
} |
465 |
|
|
466 |
< |
RealType* DataStorage::internalGetArrayPointer(std::vector<RotMat3x3d>& v) { |
466 |
> |
RealType* DataStorage::internalGetArrayPointer(std::vector<Mat3x3d>& v) { |
467 |
|
if (v.size() == 0) { |
468 |
|
return NULL; |
469 |
|
} else { |
523 |
|
if (layout & dslVelocity) { |
524 |
|
bytes += sizeof(Vector3d); |
525 |
|
} |
526 |
+ |
if (layout & dslForce) { |
527 |
+ |
bytes += sizeof(Vector3d); |
528 |
+ |
} |
529 |
|
if (layout & dslAmat) { |
530 |
|
bytes += sizeof(RotMat3x3d); |
531 |
|
} |
532 |
|
if (layout & dslAngularMomentum) { |
533 |
|
bytes += sizeof(Vector3d); |
534 |
|
} |
511 |
– |
if (layout & dslElectroFrame) { |
512 |
– |
bytes += sizeof(Mat3x3d); |
513 |
– |
} |
514 |
– |
if (layout & dslForce) { |
515 |
– |
bytes += sizeof(Vector3d); |
516 |
– |
} |
535 |
|
if (layout & dslTorque) { |
536 |
|
bytes += sizeof(Vector3d); |
537 |
|
} |
547 |
|
if (layout & dslFunctionalDerivative) { |
548 |
|
bytes += sizeof(RealType); |
549 |
|
} |
550 |
+ |
if (layout & dslDipole) { |
551 |
+ |
bytes += sizeof(Vector3d); |
552 |
+ |
} |
553 |
+ |
if (layout & dslQuadrupole) { |
554 |
+ |
bytes += sizeof(Mat3x3d); |
555 |
+ |
} |
556 |
|
if (layout & dslElectricField) { |
557 |
|
bytes += sizeof(Vector3d); |
558 |
|
} |