| 36 |
|
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
| 37 |
|
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
| 38 |
|
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
| 39 |
< |
* [4] Vardeman & Gezelter, in progress (2009). |
| 39 |
> |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
| 40 |
> |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
| 41 |
|
*/ |
| 42 |
|
|
| 43 |
|
/** |
| 127 |
|
//error |
| 128 |
|
std::cerr << "size does not match"<< std::endl; |
| 129 |
|
} |
| 130 |
+ |
|
| 131 |
+ |
if (storageLayout_ & dslSkippedCharge && skippedCharge.size() != size_) { |
| 132 |
+ |
//error |
| 133 |
+ |
std::cerr << "size does not match"<< std::endl; |
| 134 |
+ |
} |
| 135 |
|
|
| 136 |
|
return size_; |
| 137 |
|
|
| 191 |
|
internalResize(electricField, newSize); |
| 192 |
|
} |
| 193 |
|
|
| 194 |
+ |
if (storageLayout_ & dslSkippedCharge) { |
| 195 |
+ |
internalResize(skippedCharge, newSize); |
| 196 |
+ |
} |
| 197 |
+ |
|
| 198 |
|
size_ = newSize; |
| 199 |
|
} |
| 200 |
|
|
| 251 |
|
electricField.reserve(size); |
| 252 |
|
} |
| 253 |
|
|
| 254 |
+ |
if (storageLayout_ & dslSkippedCharge) { |
| 255 |
+ |
skippedCharge.reserve(size); |
| 256 |
+ |
} |
| 257 |
+ |
|
| 258 |
|
} |
| 259 |
|
|
| 260 |
|
void DataStorage::copy(int source, int num, int target) { |
| 313 |
|
if (storageLayout_ & dslElectricField) { |
| 314 |
|
internalCopy(electricField, source, num, target); |
| 315 |
|
} |
| 316 |
+ |
|
| 317 |
+ |
if (storageLayout_ & dslSkippedCharge) { |
| 318 |
+ |
internalCopy(skippedCharge, source, num, target); |
| 319 |
+ |
} |
| 320 |
|
} |
| 321 |
|
|
| 322 |
|
int DataStorage::getStorageLayout() { |
| 382 |
|
case dslElectricField: |
| 383 |
|
return internalGetArrayPointer(electricField); |
| 384 |
|
break; |
| 385 |
+ |
|
| 386 |
+ |
case dslSkippedCharge: |
| 387 |
+ |
return internalGetArrayPointer(skippedCharge); |
| 388 |
+ |
break; |
| 389 |
|
|
| 390 |
|
default: |
| 391 |
|
//error message |
| 495 |
|
if (layout & dslElectricField) { |
| 496 |
|
bytes += sizeof(Vector3d); |
| 497 |
|
} |
| 498 |
+ |
if (layout & dslSkippedCharge) { |
| 499 |
+ |
bytes += sizeof(RealType); |
| 500 |
+ |
} |
| 501 |
|
|
| 502 |
|
return bytes; |
| 503 |
|
} |