| 101 |
|
//error |
| 102 |
|
std::cerr << "size does not match"<< std::endl; |
| 103 |
|
} |
| 104 |
+ |
|
| 105 |
|
if (storageLayout_ & dslParticlePot && particlePot.size() != size_) { |
| 106 |
|
//error |
| 107 |
|
std::cerr << "size does not match"<< std::endl; |
| 108 |
|
} |
| 109 |
+ |
|
| 110 |
+ |
if (storageLayout_ & dslDensity && density.size() != size_) { |
| 111 |
+ |
//error |
| 112 |
+ |
std::cerr << "size does not match"<< std::endl; |
| 113 |
+ |
} |
| 114 |
+ |
|
| 115 |
+ |
if (storageLayout_ & dslFunctional && functional.size() != size_) { |
| 116 |
+ |
//error |
| 117 |
+ |
std::cerr << "size does not match"<< std::endl; |
| 118 |
+ |
} |
| 119 |
+ |
|
| 120 |
+ |
if (storageLayout_ & dslFunctionalDerivative && functionalDerivative.size() != size_) { |
| 121 |
+ |
//error |
| 122 |
+ |
std::cerr << "size does not match"<< std::endl; |
| 123 |
+ |
} |
| 124 |
+ |
|
| 125 |
+ |
if (storageLayout_ & dslElectricField && electricField.size() != size_) { |
| 126 |
+ |
//error |
| 127 |
+ |
std::cerr << "size does not match"<< std::endl; |
| 128 |
+ |
} |
| 129 |
|
|
| 130 |
|
return size_; |
| 131 |
|
|
| 169 |
|
internalResize(particlePot, newSize); |
| 170 |
|
} |
| 171 |
|
|
| 172 |
+ |
if (storageLayout_ & dslDensity) { |
| 173 |
+ |
internalResize(density, newSize); |
| 174 |
+ |
} |
| 175 |
+ |
|
| 176 |
+ |
if (storageLayout_ & dslFunctional) { |
| 177 |
+ |
internalResize(functional, newSize); |
| 178 |
+ |
} |
| 179 |
+ |
|
| 180 |
+ |
if (storageLayout_ & dslFunctionalDerivative) { |
| 181 |
+ |
internalResize(functionalDerivative, newSize); |
| 182 |
+ |
} |
| 183 |
+ |
|
| 184 |
+ |
if (storageLayout_ & dslElectricField) { |
| 185 |
+ |
internalResize(electricField, newSize); |
| 186 |
+ |
} |
| 187 |
+ |
|
| 188 |
|
size_ = newSize; |
| 189 |
|
} |
| 190 |
|
|
| 223 |
|
|
| 224 |
|
if (storageLayout_ & dslParticlePot) { |
| 225 |
|
particlePot.reserve(size); |
| 226 |
+ |
} |
| 227 |
+ |
|
| 228 |
+ |
if (storageLayout_ & dslDensity) { |
| 229 |
+ |
density.reserve(size); |
| 230 |
+ |
} |
| 231 |
+ |
|
| 232 |
+ |
if (storageLayout_ & dslFunctional) { |
| 233 |
+ |
functional.reserve(size); |
| 234 |
+ |
} |
| 235 |
+ |
|
| 236 |
+ |
if (storageLayout_ & dslFunctionalDerivative) { |
| 237 |
+ |
functionalDerivative.reserve(size); |
| 238 |
+ |
} |
| 239 |
+ |
|
| 240 |
+ |
if (storageLayout_ & dslElectricField) { |
| 241 |
+ |
electricField.reserve(size); |
| 242 |
|
} |
| 243 |
|
|
| 244 |
|
} |
| 283 |
|
if (storageLayout_ & dslParticlePot) { |
| 284 |
|
internalCopy(particlePot, source, num, target); |
| 285 |
|
} |
| 233 |
– |
|
| 286 |
|
|
| 287 |
+ |
if (storageLayout_ & dslDensity) { |
| 288 |
+ |
internalCopy(density, source, num, target); |
| 289 |
+ |
} |
| 290 |
+ |
|
| 291 |
+ |
if (storageLayout_ & dslFunctional) { |
| 292 |
+ |
internalCopy(functional, source, num, target); |
| 293 |
+ |
} |
| 294 |
+ |
|
| 295 |
+ |
if (storageLayout_ & dslFunctionalDerivative) { |
| 296 |
+ |
internalCopy(functionalDerivative, source, num, target); |
| 297 |
+ |
} |
| 298 |
+ |
|
| 299 |
+ |
if (storageLayout_ & dslElectricField) { |
| 300 |
+ |
internalCopy(electricField, source, num, target); |
| 301 |
+ |
} |
| 302 |
|
} |
| 303 |
|
|
| 304 |
|
int DataStorage::getStorageLayout() { |
| 348 |
|
case dslParticlePot: |
| 349 |
|
return internalGetArrayPointer(particlePot); |
| 350 |
|
break; |
| 351 |
< |
|
| 351 |
> |
|
| 352 |
> |
case dslDensity: |
| 353 |
> |
return internalGetArrayPointer(density); |
| 354 |
> |
break; |
| 355 |
> |
|
| 356 |
> |
case dslFunctional: |
| 357 |
> |
return internalGetArrayPointer(functional); |
| 358 |
> |
break; |
| 359 |
> |
|
| 360 |
> |
case dslFunctionalDerivative: |
| 361 |
> |
return internalGetArrayPointer(functionalDerivative); |
| 362 |
> |
break; |
| 363 |
> |
|
| 364 |
> |
case dslElectricField: |
| 365 |
> |
return internalGetArrayPointer(electricField); |
| 366 |
> |
break; |
| 367 |
> |
|
| 368 |
|
default: |
| 369 |
|
//error message |
| 370 |
|
return NULL; |
| 461 |
|
if (layout & dslParticlePot) { |
| 462 |
|
bytes += sizeof(RealType); |
| 463 |
|
} |
| 464 |
+ |
if (layout & dslDensity) { |
| 465 |
+ |
bytes += sizeof(RealType); |
| 466 |
+ |
} |
| 467 |
+ |
if (layout & dslFunctional) { |
| 468 |
+ |
bytes += sizeof(RealType); |
| 469 |
+ |
} |
| 470 |
+ |
if (layout & dslFunctionalDerivative) { |
| 471 |
+ |
bytes += sizeof(RealType); |
| 472 |
+ |
} |
| 473 |
+ |
if (layout & dslElectricField) { |
| 474 |
+ |
bytes += sizeof(Vector3d); |
| 475 |
+ |
} |
| 476 |
+ |
|
| 477 |
|
return bytes; |
| 478 |
|
} |
| 479 |
|
|