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 |
+ |
if (storageLayout_ & dslSkippedCharge && skippedCharge.size() != size_) { |
131 |
+ |
//error |
132 |
+ |
std::cerr << "size does not match"<< std::endl; |
133 |
+ |
} |
134 |
|
|
135 |
|
return size_; |
136 |
|
|
174 |
|
internalResize(particlePot, newSize); |
175 |
|
} |
176 |
|
|
177 |
+ |
if (storageLayout_ & dslDensity) { |
178 |
+ |
internalResize(density, newSize); |
179 |
+ |
} |
180 |
+ |
|
181 |
+ |
if (storageLayout_ & dslFunctional) { |
182 |
+ |
internalResize(functional, newSize); |
183 |
+ |
} |
184 |
+ |
|
185 |
+ |
if (storageLayout_ & dslFunctionalDerivative) { |
186 |
+ |
internalResize(functionalDerivative, newSize); |
187 |
+ |
} |
188 |
+ |
|
189 |
+ |
if (storageLayout_ & dslElectricField) { |
190 |
+ |
internalResize(electricField, newSize); |
191 |
+ |
} |
192 |
+ |
|
193 |
+ |
if (storageLayout_ & dslSkippedCharge) { |
194 |
+ |
internalResize(skippedCharge, newSize); |
195 |
+ |
} |
196 |
+ |
|
197 |
|
size_ = newSize; |
198 |
|
} |
199 |
|
|
232 |
|
|
233 |
|
if (storageLayout_ & dslParticlePot) { |
234 |
|
particlePot.reserve(size); |
235 |
+ |
} |
236 |
+ |
|
237 |
+ |
if (storageLayout_ & dslDensity) { |
238 |
+ |
density.reserve(size); |
239 |
+ |
} |
240 |
+ |
|
241 |
+ |
if (storageLayout_ & dslFunctional) { |
242 |
+ |
functional.reserve(size); |
243 |
+ |
} |
244 |
+ |
|
245 |
+ |
if (storageLayout_ & dslFunctionalDerivative) { |
246 |
+ |
functionalDerivative.reserve(size); |
247 |
+ |
} |
248 |
+ |
|
249 |
+ |
if (storageLayout_ & dslElectricField) { |
250 |
+ |
electricField.reserve(size); |
251 |
+ |
} |
252 |
+ |
|
253 |
+ |
if (storageLayout_ & dslSkippedCharge) { |
254 |
+ |
skippedCharge.reserve(size); |
255 |
|
} |
256 |
|
|
257 |
|
} |
296 |
|
if (storageLayout_ & dslParticlePot) { |
297 |
|
internalCopy(particlePot, source, num, target); |
298 |
|
} |
233 |
– |
|
299 |
|
|
300 |
+ |
if (storageLayout_ & dslDensity) { |
301 |
+ |
internalCopy(density, source, num, target); |
302 |
+ |
} |
303 |
+ |
|
304 |
+ |
if (storageLayout_ & dslFunctional) { |
305 |
+ |
internalCopy(functional, source, num, target); |
306 |
+ |
} |
307 |
+ |
|
308 |
+ |
if (storageLayout_ & dslFunctionalDerivative) { |
309 |
+ |
internalCopy(functionalDerivative, source, num, target); |
310 |
+ |
} |
311 |
+ |
|
312 |
+ |
if (storageLayout_ & dslElectricField) { |
313 |
+ |
internalCopy(electricField, source, num, target); |
314 |
+ |
} |
315 |
+ |
|
316 |
+ |
if (storageLayout_ & dslSkippedCharge) { |
317 |
+ |
internalCopy(skippedCharge, source, num, target); |
318 |
+ |
} |
319 |
|
} |
320 |
|
|
321 |
|
int DataStorage::getStorageLayout() { |
365 |
|
case dslParticlePot: |
366 |
|
return internalGetArrayPointer(particlePot); |
367 |
|
break; |
368 |
< |
|
368 |
> |
|
369 |
> |
case dslDensity: |
370 |
> |
return internalGetArrayPointer(density); |
371 |
> |
break; |
372 |
> |
|
373 |
> |
case dslFunctional: |
374 |
> |
return internalGetArrayPointer(functional); |
375 |
> |
break; |
376 |
> |
|
377 |
> |
case dslFunctionalDerivative: |
378 |
> |
return internalGetArrayPointer(functionalDerivative); |
379 |
> |
break; |
380 |
> |
|
381 |
> |
case dslElectricField: |
382 |
> |
return internalGetArrayPointer(electricField); |
383 |
> |
break; |
384 |
> |
|
385 |
> |
case dslSkippedCharge: |
386 |
> |
return internalGetArrayPointer(skippedCharge); |
387 |
> |
break; |
388 |
> |
|
389 |
|
default: |
390 |
|
//error message |
391 |
|
return NULL; |
482 |
|
if (layout & dslParticlePot) { |
483 |
|
bytes += sizeof(RealType); |
484 |
|
} |
485 |
+ |
if (layout & dslDensity) { |
486 |
+ |
bytes += sizeof(RealType); |
487 |
+ |
} |
488 |
+ |
if (layout & dslFunctional) { |
489 |
+ |
bytes += sizeof(RealType); |
490 |
+ |
} |
491 |
+ |
if (layout & dslFunctionalDerivative) { |
492 |
+ |
bytes += sizeof(RealType); |
493 |
+ |
} |
494 |
+ |
if (layout & dslElectricField) { |
495 |
+ |
bytes += sizeof(Vector3d); |
496 |
+ |
} |
497 |
+ |
if (layout & dslSkippedCharge) { |
498 |
+ |
bytes += sizeof(RealType); |
499 |
+ |
} |
500 |
+ |
|
501 |
|
return bytes; |
502 |
|
} |
503 |
|
|