# | Line 146 | Line 146 | namespace OpenMD { | |
---|---|---|
146 | //error | |
147 | cerr << "size does not match"<< endl; | |
148 | } | |
149 | + | |
150 | + | if (storageLayout_ & dslSitePotential && sitePotential.size() != size_) { |
151 | + | //error |
152 | + | cerr << "size does not match"<< endl; |
153 | + | } |
154 | ||
155 | return size_; | |
156 | ||
# | Line 221 | Line 226 | namespace OpenMD { | |
226 | internalResize(flucQFrc, newSize); | |
227 | } | |
228 | ||
229 | + | if (storageLayout_ & dslSitePotential) { |
230 | + | internalResize(sitePotential, newSize); |
231 | + | } |
232 | + | |
233 | size_ = newSize; | |
234 | } | |
235 | ||
# | Line 292 | Line 301 | namespace OpenMD { | |
301 | if (storageLayout_ & dslFlucQForce) { | |
302 | flucQFrc.reserve(size); | |
303 | } | |
304 | + | |
305 | + | if (storageLayout_ & dslSitePotential) { |
306 | + | sitePotential.reserve(size); |
307 | + | } |
308 | } | |
309 | ||
310 | void DataStorage::copy(int source, int num, int target) { | |
# | Line 365 | Line 378 | namespace OpenMD { | |
378 | if (storageLayout_ & dslFlucQForce) { | |
379 | internalCopy(flucQFrc, source, num, target); | |
380 | } | |
381 | + | |
382 | + | if (storageLayout_ & dslSitePotential) { |
383 | + | internalCopy(sitePotential, source, num, target); |
384 | + | } |
385 | } | |
386 | ||
387 | int DataStorage::getStorageLayout() { | |
# | Line 430 | Line 447 | namespace OpenMD { | |
447 | case dslFlucQForce: | |
448 | return internalGetArrayPointer(flucQFrc); | |
449 | ||
450 | + | case dslSitePotential: |
451 | + | return internalGetArrayPointer(sitePotential); |
452 | + | |
453 | default: | |
454 | //error message | |
455 | return NULL; | |
# | Line 549 | Line 569 | namespace OpenMD { | |
569 | if (layout & dslFlucQForce) { | |
570 | bytes += sizeof(RealType); | |
571 | } | |
572 | + | if (layout & dslSitePotential) { |
573 | + | bytes += sizeof(RealType); |
574 | + | } |
575 | ||
576 | return bytes; | |
577 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |